Skip to content

Commit

Permalink
feat: Add support for Unreal
Browse files Browse the repository at this point in the history
  • Loading branch information
cetteup committed Jan 24, 2023
1 parent 402bab8 commit cb397b4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/joinme.click-launcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import (
"time"

filerepo "github.com/cetteup/filerepo/pkg"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"

"github.com/cetteup/joinme.click-launcher/internal"
"github.com/cetteup/joinme.click-launcher/internal/router"
"github.com/cetteup/joinme.click-launcher/internal/titles"
"github.com/cetteup/joinme.click-launcher/pkg/game_launcher"
"github.com/cetteup/joinme.click-launcher/pkg/registry_repository"
"github.com/cetteup/joinme.click-launcher/pkg/software_finder"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)

func init() {
Expand Down Expand Up @@ -48,6 +49,7 @@ func init() {
gameRouter.AddTitle(titles.Paraworld)
gameRouter.AddTitle(titles.Swat4)
gameRouter.AddTitle(titles.Swat4X)
gameRouter.AddTitle(titles.Unreal)
gameRouter.AddTitle(titles.UT)
gameRouter.AddTitle(titles.UT2003)
gameRouter.AddTitle(titles.UT2004)
Expand Down
40 changes: 40 additions & 0 deletions internal/titles/unreal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package titles

import (
"github.com/cetteup/joinme.click-launcher/internal/domain"
"github.com/cetteup/joinme.click-launcher/internal/titles/internal"
"github.com/cetteup/joinme.click-launcher/pkg/game_launcher"
"github.com/cetteup/joinme.click-launcher/pkg/software_finder"
)

var Unreal = domain.GameTitle{
Name: "Unreal",
ProtocolScheme: "unreal",
FinderConfigs: []software_finder.Config{
{
ForType: software_finder.RegistryFinder,
RegistryKey: software_finder.RegistryKeyLocalMachine,
RegistryPath: "SOFTWARE\\Unreal Technology\\Installed Apps\\Unreal Gold",
RegistryValueName: "folder",
},
{
ForType: software_finder.RegistryFinder,
RegistryKey: software_finder.RegistryKeyCurrentUser, // When installed via Steam, key is CurrentUser instead of LocalMachine
RegistryPath: "SOFTWARE\\Unreal Technology\\Installed Apps\\Unreal Gold",
RegistryValueName: "folder",
},
{
ForType: software_finder.RegistryFinder,
RegistryKey: software_finder.RegistryKeyLocalMachine,
RegistryPath: "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Unreal.exe", // TODO Points to the "System" dir for Unreal Gold
RegistryValueName: "Path",
},
},
LauncherConfig: game_launcher.Config{
ExecutableName: "Unreal.exe",
ExecutablePath: "System",
CloseBeforeLaunch: true,
},
URLValidator: internal.IPPortURLValidator,
CmdBuilder: internal.PlainCmdBuilder,
}

0 comments on commit cb397b4

Please sign in to comment.