Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add FactoryGameSteam and FactoryGameEGS install types #223

Merged
merged 4 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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": []
}
]
}
10 changes: 9 additions & 1 deletion backend/ficsitcli/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ficsitcli
import (
"fmt"
"log/slog"
"slices"
"sync"
"time"

Expand Down Expand Up @@ -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() {
Expand All @@ -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
}
Expand Down
11 changes: 11 additions & 0 deletions backend/installfinders/common/gameinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions backend/installfinders/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 2 additions & 0 deletions build/windows/installer/project.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
Loading