summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI.Installer/InteractiveInstaller.cs18
2 files changed, 11 insertions, 8 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 558ed004..00ed6e9c 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,6 +8,7 @@
* Added console warning for mods which don't have update checks configured.
* Fixed console color scheme on Mac or in PowerShell, configurable via `StardewModdingAPI.config.json`.
* Fixed detection of GOG Galaxy install path in rare cases.
+ * Fixed install error on Linux/Mac in some cases.
* For modders:
* Added code analysis to mod build config package to flag common issues as warnings.
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs
index 3ce71673..2b9dd95e 100644
--- a/src/SMAPI.Installer/InteractiveInstaller.cs
+++ b/src/SMAPI.Installer/InteractiveInstaller.cs
@@ -233,7 +233,7 @@ namespace StardewModdingApi.Installer
Console.ReadLine();
return;
}
- if (!this.HasXNA(platform))
+ if (!this.HasXna(platform))
{
this.PrintError("You don't seem to have XNA Framework installed. Please run the game at least once before installing SMAPI, so it can perform its first-time setup.");
Console.ReadLine();
@@ -317,10 +317,13 @@ namespace StardewModdingApi.Installer
if (platform.IsMono())
{
this.PrintDebug("Safely replacing game launcher...");
- if (!File.Exists(paths.unixLauncherBackup))
- File.Move(paths.unixLauncher, paths.unixLauncherBackup);
- else if (File.Exists(paths.unixLauncher))
- this.InteractivelyDelete(paths.unixLauncher);
+ if (File.Exists(paths.unixLauncher))
+ {
+ if (!File.Exists(paths.unixLauncherBackup))
+ File.Move(paths.unixLauncher, paths.unixLauncherBackup);
+ else
+ this.InteractivelyDelete(paths.unixLauncher);
+ }
File.Move(paths.unixSmapiLauncher, paths.unixLauncher);
}
@@ -471,7 +474,7 @@ namespace StardewModdingApi.Installer
/// <summary>Get whether the current system has XNA Framework installed. This only applies on Windows.</summary>
/// <param name="platform">The current platform.</param>
/// <exception cref="NotSupportedException">The current platform is not Windows.</exception>
- private bool HasXNA(Platform platform)
+ private bool HasXna(Platform platform)
{
switch (platform)
{
@@ -514,8 +517,7 @@ namespace StardewModdingApi.Installer
return;
// delete children
- var folder = entry as DirectoryInfo;
- if (folder != null)
+ if (entry is DirectoryInfo folder)
{
foreach (FileSystemInfo child in folder.GetFileSystemInfos())
this.ForceDelete(child);