diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..022a656a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Launch Wails Development Server", + "type": "shell", + "command": "wails dev", + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/backend/ficsitcli/wrapper.go b/backend/ficsitcli/wrapper.go index 5969cf90..4d955a59 100644 --- a/backend/ficsitcli/wrapper.go +++ b/backend/ficsitcli/wrapper.go @@ -3,6 +3,7 @@ package ficsitcli import ( "fmt" "log/slog" + "slices" "sync" "time" @@ -45,6 +46,13 @@ func Init() error { return nil } +// With and without `.exe` variants in case it is missing on Linux +var executableNames = []string{ + "FactoryGame-Win64-Shipping.exe", "FactoryGame-Win64-Shipping", + "FactoryGameSteam-Win64-Shipping.exe", "FactoryGameSteam-Win64-Shipping", + "FactoryGameEGS-Win64-Shipping.exe", "FactoryGameEGS-Win64-Shipping", +} + func (f *ficsitCLI) StartGameRunningWatcher() { gameRunningTicker := time.NewTicker(5 * time.Second) go func() { @@ -56,7 +64,7 @@ func (f *ficsitCLI) StartGameRunningWatcher() { } f.isGameRunning = false for _, process := range processes { - if process.Executable() == "FactoryGame-Win64-Shipping.exe" || process.Executable() == "FactoryGame-Win64-Shipping" { + if slices.Contains(executableNames, process.Executable()) { f.isGameRunning = true break } diff --git a/backend/installfinders/common/gameinfo.go b/backend/installfinders/common/gameinfo.go index 3fdae109..0b18a290 100644 --- a/backend/installfinders/common/gameinfo.go +++ b/backend/installfinders/common/gameinfo.go @@ -41,6 +41,17 @@ var gameInfo = []installType{ versionPath: filepath.Join("Engine", "Binaries", "Win64", "FactoryServer-Win64-Shipping.version"), installType: InstallTypeWindowsServer, }, + // Update 1.0 stuff + { + executable: "FactoryGameSteam.exe", + versionPath: filepath.Join("Engine", "Binaries", "Win64", "FactoryGameSteam-Win64-Shipping.version"), + installType: InstallTypeWindowsClient, + }, + { + executable: "FactoryGameEGS.exe", + versionPath: filepath.Join("Engine", "Binaries", "Win64", "FactoryGameEGS-Win64-Shipping.version"), + installType: InstallTypeWindowsClient, + }, } type GameVersionFile struct { diff --git a/backend/installfinders/common/types.go b/backend/installfinders/common/types.go index 9cccb530..a97ff041 100644 --- a/backend/installfinders/common/types.go +++ b/backend/installfinders/common/types.go @@ -3,6 +3,7 @@ package common type GameBranch string var ( + // TODO rename to BranchRelease later https://github.com/satisfactorymodding/SatisfactoryModManager/pull/223#issuecomment-2342831142 BranchEarlyAccess GameBranch = "Early Access" BranchExperimental GameBranch = "Experimental" ) diff --git a/build/windows/installer/project.nsi b/build/windows/installer/project.nsi index 33f67a49..9312f275 100644 --- a/build/windows/installer/project.nsi +++ b/build/windows/installer/project.nsi @@ -253,6 +253,8 @@ Function .onVerifyInstDir Check: IfFileExists $currentDir\FactoryGame.exe GameExists + IfFileExists $currentDir\FactoryGameSteam.exe GameExists + IfFileExists $currentDir\FactoryGameEGS.exe GameExists IfFileExists $currentDir\FactoryServer.exe GameExists IfFileExists $currentDir\FactoryServer.sh GameExists ${GetParent} $currentDir $currentDir diff --git a/cspell.json b/cspell.json index b90ee782..ab666615 100644 --- a/cspell.json +++ b/cspell.json @@ -26,7 +26,8 @@ "Unignore", "urql", "wailsjs", - "wailsjsdir" + "wailsjsdir", + "xsync" ], // flagWords - list of words to be always considered incorrect // This is useful for offensive words and common spelling errors. diff --git a/go.mod b/go.mod index da79828f..385d64be 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/puzpuzpuz/xsync/v3 v3.0.2 github.com/samber/lo v1.39.0 github.com/samber/slog-multi v1.0.2 - github.com/satisfactorymodding/ficsit-cli v0.5.1-0.20240505210117-d051b5800ad7 + github.com/satisfactorymodding/ficsit-cli v0.5.1-0.20240911000311-d948fdd42ee4 github.com/satisfactorymodding/ficsit-resolver v0.0.2 github.com/shirou/gopsutil/v3 v3.24.3 github.com/spf13/viper v1.18.1 diff --git a/go.sum b/go.sum index b334cd93..9065640e 100644 --- a/go.sum +++ b/go.sum @@ -151,8 +151,8 @@ github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= github.com/samber/slog-multi v1.0.2 h1:6BVH9uHGAsiGkbbtQgAOQJMpKgV8unMrHhhJaw+X1EQ= github.com/samber/slog-multi v1.0.2/go.mod h1:uLAvHpGqbYgX4FSL0p1ZwoLuveIAJvBECtE07XmYvFo= -github.com/satisfactorymodding/ficsit-cli v0.5.1-0.20240505210117-d051b5800ad7 h1:ITYfjBI+SYQs4CmykE5CIi6IU8UFpMoeYLwqUKRxysc= -github.com/satisfactorymodding/ficsit-cli v0.5.1-0.20240505210117-d051b5800ad7/go.mod h1:sJNDolwt76b/+iUr475IXzok710dGIJZ3xJvNkp0smI= +github.com/satisfactorymodding/ficsit-cli v0.5.1-0.20240911000311-d948fdd42ee4 h1:3LaQ6LMl2Lk9RYjDTKj+tJmA9EpMlMSkdu04UDcIgVA= +github.com/satisfactorymodding/ficsit-cli v0.5.1-0.20240911000311-d948fdd42ee4/go.mod h1:sJNDolwt76b/+iUr475IXzok710dGIJZ3xJvNkp0smI= github.com/satisfactorymodding/ficsit-resolver v0.0.2 h1:dj/OsDLpaMUqCHpfBVHvDMUv2nf5gT4HS2ydBMkmtcQ= github.com/satisfactorymodding/ficsit-resolver v0.0.2/go.mod h1:ckKMmMvDoYbbkEbWXEsMes608uvv6EKphXPhHX8LKSc= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=