diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-05-03 20:16:20 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-05-03 20:16:20 -0400 |
commit | 7dd3e37dec6924b1acd3f3045aefe5ebc8f91e8f (patch) | |
tree | 5f30d4c12937be2346a99bf6addf853d5ea50052 /src/SMAPI.Installer | |
parent | 5d3d919d490fd414fe9647e566e92c71d7f64509 (diff) | |
parent | 6b1c4589e96f25b771ff8ddd4bbdbb9198a0ab9c (diff) | |
download | SMAPI-7dd3e37dec6924b1acd3f3045aefe5ebc8f91e8f.tar.gz SMAPI-7dd3e37dec6924b1acd3f3045aefe5ebc8f91e8f.tar.bz2 SMAPI-7dd3e37dec6924b1acd3f3045aefe5ebc8f91e8f.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Installer')
-rw-r--r-- | src/SMAPI.Installer/InteractiveInstaller.cs | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index 83ecd257..55e9c064 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -45,6 +45,7 @@ namespace StardewModdingApi.Installer yield return GetInstallPath("StardewModdingAPI.exe.mdb"); // Linux/macOS only yield return GetInstallPath("StardewModdingAPI.pdb"); // Windows only yield return GetInstallPath("StardewModdingAPI.xml"); + yield return GetInstallPath("StardewModdingAPI-x64.exe"); // not normally added to game folder, but may be mistakenly added by a manual install yield return GetInstallPath("smapi-internal"); yield return GetInstallPath("steam_appid.txt"); @@ -424,25 +425,23 @@ namespace StardewModdingApi.Installer this.RecursiveCopy(sourceEntry, paths.GameDir); } - if (isWindows64Bit) + // handle 64-bit file { - this.PrintDebug("Making SMAPI 64-bit..."); - FileInfo x64Executable = new FileInfo(Path.Combine(paths.BundleDir.FullName, "StardewModdingAPI-x64.exe")); - if (x64Executable.Exists) + FileInfo x64Executable = new FileInfo(Path.Combine(paths.GameDir.FullName, "StardewModdingAPI-x64.exe")); + if (isWindows64Bit) { - string targetName = "StardewModdingAPI.exe"; - this.InteractivelyDelete(Path.Combine(paths.GameDir.FullName, targetName)); - this.InteractivelyDelete(Path.Combine(paths.GameDir.FullName, x64Executable.Name)); - - this.RecursiveCopy(x64Executable, paths.GameDir); - File.Move(Path.Combine(paths.GamePath, x64Executable.Name), Path.Combine(paths.GamePath, targetName)); - } - else - { - this.PrintError($"Oops! Could not find the required '{x64Executable.Name}' installer file. SMAPI was unable to install correctly."); - Console.ReadLine(); - return; + this.PrintDebug("Making SMAPI 64-bit..."); + if (x64Executable.Exists) + { + string targetPath = Path.Combine(paths.GameDir.FullName, "StardewModdingAPI.exe"); + this.InteractivelyDelete(targetPath); + x64Executable.MoveTo(targetPath); + } + else + this.PrintError($"Oops! Could not find the required '{x64Executable.Name}' installer file. SMAPI may not work correctly."); } + else if (x64Executable.Exists) + x64Executable.Delete(); } // replace mod launcher (if possible) |