summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Installer/InteractiveInstaller.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-04-24 13:30:49 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-04-24 13:30:49 -0400
commit22806ab900721a61b142937bc58dd33727d377f9 (patch)
treebc5062865b0d5d384b6fb13326c1b32313a0038a /src/StardewModdingAPI.Installer/InteractiveInstaller.cs
parentdbb9bd84306830456032778fc11fb9a34dd140c7 (diff)
parentfee89a99da3295c6bb35d6543a112db8924057de (diff)
downloadSMAPI-22806ab900721a61b142937bc58dd33727d377f9.tar.gz
SMAPI-22806ab900721a61b142937bc58dd33727d377f9.tar.bz2
SMAPI-22806ab900721a61b142937bc58dd33727d377f9.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI.Installer/InteractiveInstaller.cs')
-rw-r--r--src/StardewModdingAPI.Installer/InteractiveInstaller.cs39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs
index fffba30f..38c19d2b 100644
--- a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs
+++ b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs
@@ -65,30 +65,30 @@ namespace StardewModdingApi.Installer
/// <param name="modsDir">The folder for SMAPI mods.</param>
private IEnumerable<string> GetUninstallPaths(DirectoryInfo installDir, DirectoryInfo modsDir)
{
- Func<string, string> installPath = path => Path.Combine(installDir.FullName, path);
+ string GetInstallPath(string path) => Path.Combine(installDir.FullName, path);
// common
- yield return installPath("Mono.Cecil.dll");
- yield return installPath("Newtonsoft.Json.dll");
- yield return installPath("StardewModdingAPI.exe");
- yield return installPath("StardewModdingAPI.config.json");
- yield return installPath("StardewModdingAPI.data.json");
- yield return installPath("StardewModdingAPI.AssemblyRewriters.dll");
- yield return installPath("steam_appid.txt");
+ yield return GetInstallPath("Mono.Cecil.dll");
+ yield return GetInstallPath("Newtonsoft.Json.dll");
+ yield return GetInstallPath("StardewModdingAPI.exe");
+ yield return GetInstallPath("StardewModdingAPI.config.json");
+ yield return GetInstallPath("StardewModdingAPI.data.json");
+ yield return GetInstallPath("StardewModdingAPI.AssemblyRewriters.dll");
+ yield return GetInstallPath("steam_appid.txt");
// Linux/Mac only
- yield return installPath("StardewModdingAPI");
- yield return installPath("StardewModdingAPI.exe.mdb");
- yield return installPath("System.Numerics.dll");
- yield return installPath("System.Runtime.Caching.dll");
+ yield return GetInstallPath("StardewModdingAPI");
+ yield return GetInstallPath("StardewModdingAPI.exe.mdb");
+ yield return GetInstallPath("System.Numerics.dll");
+ yield return GetInstallPath("System.Runtime.Caching.dll");
// Windows only
- yield return installPath("StardewModdingAPI.pdb");
+ yield return GetInstallPath("StardewModdingAPI.pdb");
// obsolete
- yield return installPath("Mods/.cache"); // 1.3-1.4
- yield return installPath("Mono.Cecil.Rocks.dll"); // 1.3–1.8
- yield return installPath("StardewModdingAPI-settings.json"); // 1.0-1.4
+ yield return GetInstallPath("Mods/.cache"); // 1.3-1.4
+ yield return GetInstallPath("Mono.Cecil.Rocks.dll"); // 1.3–1.8
+ yield return GetInstallPath("StardewModdingAPI-settings.json"); // 1.0-1.4
if (modsDir.Exists)
{
foreach (DirectoryInfo modDir in modsDir.EnumerateDirectories())
@@ -435,7 +435,7 @@ namespace StardewModdingApi.Installer
catch (Exception ex)
{
this.PrintError($"Oops! The installer couldn't delete {path}: [{ex.GetType().Name}] {ex.Message}.");
- this.PrintError("Please delete it yourself, then press any key to retry.");
+ this.PrintError("Try rebooting your computer and then run the installer again. If that doesn't work, try deleting it yourself then press any key to retry.");
Console.ReadKey();
}
}
@@ -592,7 +592,7 @@ namespace StardewModdingApi.Installer
if (isDir && packagedModNames.Contains(entry.Name, StringComparer.InvariantCultureIgnoreCase))
{
this.PrintDebug($" Deleting {entry.Name} because it's bundled into SMAPI...");
- entry.Delete();
+ this.InteractivelyDelete(entry.FullName);
continue;
}
@@ -626,9 +626,8 @@ namespace StardewModdingApi.Installer
private void Move(FileSystemInfo entry, string newPath)
{
// file
- if (entry is FileInfo)
+ if (entry is FileInfo file)
{
- FileInfo file = (FileInfo)entry;
file.CopyTo(newPath);
file.Delete();
}