Skip to content

Commit 9e6e165

Browse files
Core: Fix FF7 Steam game copy in prefix after GOG edition installed
1 parent d2442b0 commit 9e6e165

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/main.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,11 +1636,11 @@ final class LauncherEngine {
16361636

16371637
setupWineEnvironment()
16381638

1639-
// For Memoria, pre-resolve game install before deciding whether to prompt for a custom installer.
1639+
// Pre-resolve game install before deciding whether to prompt for a custom installer.
16401640
// Prefer GOG-in-prefix path first to avoid falling back to Steam copy when GOG is already installed.
16411641
// Prompt suppression should trigger only when the game is already set up in this Wine prefix
16421642
// (either via GOG-in-prefix path or a Steam setup already present in prefix manifests).
1643-
let preDetectedGOGInstall = product.id == "memoria" ? findGOGGamePath() : nil
1643+
let preDetectedGOGInstall = findGOGGamePath()
16441644
let hasSteamSetupInPrefix = product.id == "memoria" ? hasSteamInstallInPrefix() : false
16451645
let preDetectedGameInstall = preDetectedGOGInstall ?? (product.id == "memoria" ? findGamePath() : nil)
16461646

@@ -1653,9 +1653,11 @@ final class LauncherEngine {
16531653
preDetectedGOGInstall == nil &&
16541654
!hasSteamSetupInPrefix
16551655
} else {
1656+
// For other products, check if game is already installed in prefix (GOG) before checking targetExe
1657+
let hasExistingInstallInPrefix = preDetectedGOGInstall != nil || FileManager.default.fileExists(atPath: paths.targetExe.path)
16561658
shouldPromptForCustomInstaller =
16571659
product.allowsCustomGameInstaller &&
1658-
!FileManager.default.fileExists(atPath: paths.targetExe.path)
1660+
!hasExistingInstallInPrefix
16591661
}
16601662
let selectedCustomInstaller = shouldPromptForCustomInstaller ? promptForCustomGameInstaller() : nil
16611663

@@ -1683,7 +1685,8 @@ final class LauncherEngine {
16831685
} else if product.id == "memoria" {
16841686
resolvedGameInstall = findGOGGamePath() ?? findGamePath()
16851687
} else {
1686-
resolvedGameInstall = findGamePath()
1688+
// For non-Memoria products, also check GOG first before falling back to Steam
1689+
resolvedGameInstall = findGOGGamePath() ?? findGamePath()
16871690
}
16881691

16891692
guard let gameInstall = resolvedGameInstall else {

0 commit comments

Comments
 (0)