Fix hwrm install path for Manjaro
This commit is contained in:
6
main.go
6
main.go
@@ -26,6 +26,12 @@ var (
|
||||
"$HOME/.steam/steam",
|
||||
}
|
||||
|
||||
// fixes not found installation path on Manjaro (HomeworldRM is affected only)
|
||||
defaultInstallPaths = []string{
|
||||
"$HOME/.local/share/Steam/steamapps/common/Homeworld/HomeworldRM/bin/Release",
|
||||
"$HOME/.local/share/Steam/steamapps/common/Homeworld/HomeworldRM/Bin/Release",
|
||||
}
|
||||
|
||||
flagWindowed bool
|
||||
flagModPath string
|
||||
flagHelp bool
|
||||
|
||||
23
steam.go
23
steam.go
@@ -117,7 +117,7 @@ func getSteamArguments(game string, windowed bool, modPath string, gameRootPath
|
||||
}
|
||||
|
||||
case hw1rem:
|
||||
gameExe = fmt.Sprintf("%s/HomeworldRM/bin/Release/HomeworldRM.exe", gameRootPath)
|
||||
gameExe = fmt.Sprintf("%s/HomeworldRM.exe", getHomeworldRMPath())
|
||||
gameOptions = append(gameOptions, "-dlccampaign HW1Campaign.big")
|
||||
gameOptions = append(gameOptions, "-campaign HomeworldClassic")
|
||||
gameOptions = append(gameOptions, "-moviepath DataHW1Campaign")
|
||||
@@ -126,7 +126,7 @@ func getSteamArguments(game string, windowed bool, modPath string, gameRootPath
|
||||
}
|
||||
|
||||
case hw2rem:
|
||||
gameExe = fmt.Sprintf("%s/HomeworldRM/bin/Release/HomeworldRM.exe", gameRootPath)
|
||||
gameExe = fmt.Sprintf("%s/HomeworldRM.exe", getHomeworldRMPath())
|
||||
gameOptions = append(gameOptions, "-dlccampaign HW2Campaign.big")
|
||||
gameOptions = append(gameOptions, "-campaign Ascension")
|
||||
gameOptions = append(gameOptions, "-moviepath DataHW2Campaign")
|
||||
@@ -135,7 +135,7 @@ func getSteamArguments(game string, windowed bool, modPath string, gameRootPath
|
||||
}
|
||||
|
||||
case hwmp:
|
||||
gameExe = fmt.Sprintf("%s/HomeworldRM/bin/Release/HomeworldRM.exe", gameRootPath)
|
||||
gameExe = fmt.Sprintf("%s/HomeworldRM.exe", getHomeworldRMPath())
|
||||
if windowed {
|
||||
gameOptions = append(gameOptions, "-windowed")
|
||||
}
|
||||
@@ -207,3 +207,20 @@ func getSteamEnvironment(steamPath, protonPath string) []string {
|
||||
fmt.Sprintf("STEAM_COMPAT_CLIENT_INSTALL_PATH=%s", steamPath),
|
||||
}...)
|
||||
}
|
||||
|
||||
func getHomeworldRMPath() string {
|
||||
installPath := ""
|
||||
for _, path := range defaultInstallPaths {
|
||||
resolvedPath := os.ExpandEnv(path)
|
||||
log.Debug("Checking " + resolvedPath + " for HomeworldRM")
|
||||
if _, err := os.Stat(resolvedPath); err == nil {
|
||||
installPath = resolvedPath
|
||||
break
|
||||
}
|
||||
}
|
||||
if installPath == "" {
|
||||
help()
|
||||
os.Exit(1)
|
||||
}
|
||||
return installPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user