diff options
Diffstat (limited to 'src/SMAPI.Installer')
-rw-r--r-- | src/SMAPI.Installer/Framework/InstallerPaths.cs | 18 | ||||
-rw-r--r-- | src/SMAPI.Installer/InteractiveInstaller.cs | 21 | ||||
-rw-r--r-- | src/SMAPI.Installer/SMAPI.Installer.csproj | 15 | ||||
-rw-r--r-- | src/SMAPI.Installer/assets/README.txt (renamed from src/SMAPI.Installer/README.txt) | 0 | ||||
-rw-r--r-- | src/SMAPI.Installer/assets/System.Numerics.dll | bin | 0 -> 54272 bytes | |||
-rw-r--r-- | src/SMAPI.Installer/assets/System.Runtime.Caching.dll | bin | 0 -> 71168 bytes | |||
-rw-r--r-- | src/SMAPI.Installer/assets/unix-install.sh (renamed from src/SMAPI.Installer/unix-install.sh) | 0 | ||||
-rw-r--r-- | src/SMAPI.Installer/assets/unix-launcher.sh (renamed from src/SMAPI.Installer/unix-launcher.sh) | 0 | ||||
-rw-r--r-- | src/SMAPI.Installer/assets/windows-exe-config.xml (renamed from src/SMAPI.Installer/windows-exe-config.xml) | 0 | ||||
-rw-r--r-- | src/SMAPI.Installer/assets/windows-install.bat (renamed from src/SMAPI.Installer/windows-install.bat) | 0 |
10 files changed, 40 insertions, 14 deletions
diff --git a/src/SMAPI.Installer/Framework/InstallerPaths.cs b/src/SMAPI.Installer/Framework/InstallerPaths.cs index 9393e14f..ac6c3a8e 100644 --- a/src/SMAPI.Installer/Framework/InstallerPaths.cs +++ b/src/SMAPI.Installer/Framework/InstallerPaths.cs @@ -8,6 +8,9 @@ namespace StardewModdingAPI.Installer.Framework /********* ** Accessors *********/ + /**** + ** Main folders + ****/ /// <summary>The directory path containing the files to copy into the game folder.</summary> public DirectoryInfo BundleDir { get; } @@ -17,9 +20,18 @@ namespace StardewModdingAPI.Installer.Framework /// <summary>The directory into which to install mods.</summary> public DirectoryInfo ModsDir { get; } + /**** + ** Installer paths + ****/ /// <summary>The full path to directory path containing the files to copy into the game folder.</summary> public string BundlePath => this.BundleDir.FullName; + /// <summary>The full path to the backup API user settings folder, if applicable.</summary> + public string BundleApiUserConfigPath { get; } + + /**** + ** Game paths + ****/ /// <summary>The full path to the directory containing the installed game.</summary> public string GamePath => this.GameDir.FullName; @@ -29,6 +41,9 @@ namespace StardewModdingAPI.Installer.Framework /// <summary>The full path to SMAPI's internal configuration file.</summary> public string ApiConfigPath { get; } + /// <summary>The full path to the user's config overrides file.</summary> + public string ApiUserConfigPath { get; } + /// <summary>The full path to the installed SMAPI executable file.</summary> public string ExecutablePath { get; } @@ -55,11 +70,14 @@ namespace StardewModdingAPI.Installer.Framework this.GameDir = gameDir; this.ModsDir = new DirectoryInfo(Path.Combine(gameDir.FullName, "Mods")); + this.BundleApiUserConfigPath = Path.Combine(bundleDir.FullName, "smapi-internal", "config.user.json"); + this.ExecutablePath = Path.Combine(gameDir.FullName, gameExecutableName); this.UnixLauncherPath = Path.Combine(gameDir.FullName, "StardewValley"); this.UnixSmapiLauncherPath = Path.Combine(gameDir.FullName, "StardewModdingAPI"); this.UnixBackupLauncherPath = Path.Combine(gameDir.FullName, "StardewValley-original"); this.ApiConfigPath = Path.Combine(gameDir.FullName, "smapi-internal", "config.json"); + this.ApiUserConfigPath = Path.Combine(gameDir.FullName, "smapi-internal", "config.user.json"); } } } diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index 964300ac..2d58baf0 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -352,6 +352,12 @@ namespace StardewModdingApi.Installer Console.WriteLine(); /**** + ** Back up user settings + ****/ + if (File.Exists(paths.ApiUserConfigPath)) + File.Copy(paths.ApiUserConfigPath, paths.BundleApiUserConfigPath); + + /**** ** Always uninstall old files ****/ // restore game launcher @@ -373,6 +379,21 @@ namespace StardewModdingApi.Installer this.InteractivelyDelete(path); } + // move global save data folder (changed in 3.2) + { + string dataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley"); + DirectoryInfo oldDir = new DirectoryInfo(Path.Combine(dataPath, "Saves", ".smapi")); + DirectoryInfo newDir = new DirectoryInfo(Path.Combine(dataPath, ".smapi")); + + if (oldDir.Exists) + { + if (newDir.Exists) + this.InteractivelyDelete(oldDir.FullName); + else + oldDir.MoveTo(newDir.FullName); + } + } + /**** ** Install new files ****/ diff --git a/src/SMAPI.Installer/SMAPI.Installer.csproj b/src/SMAPI.Installer/SMAPI.Installer.csproj index 3f01c8fe..79e19d89 100644 --- a/src/SMAPI.Installer/SMAPI.Installer.csproj +++ b/src/SMAPI.Installer/SMAPI.Installer.csproj @@ -8,7 +8,6 @@ <LangVersion>latest</LangVersion> <OutputType>Exe</OutputType> <PlatformTarget>x86</PlatformTarget> - <OutputPath>$(SolutionDir)\..\bin\$(Configuration)\Installer</OutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> </PropertyGroup> @@ -17,19 +16,7 @@ </ItemGroup> <ItemGroup> - <None Update="README.txt"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="windows-exe-config.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="windows-install.bat"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="unix-install.sh"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Include="unix-launcher.sh"> + <None Update="assets\*"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> diff --git a/src/SMAPI.Installer/README.txt b/src/SMAPI.Installer/assets/README.txt index 0da49a46..0da49a46 100644 --- a/src/SMAPI.Installer/README.txt +++ b/src/SMAPI.Installer/assets/README.txt diff --git a/src/SMAPI.Installer/assets/System.Numerics.dll b/src/SMAPI.Installer/assets/System.Numerics.dll Binary files differnew file mode 100644 index 00000000..fed0f92c --- /dev/null +++ b/src/SMAPI.Installer/assets/System.Numerics.dll diff --git a/src/SMAPI.Installer/assets/System.Runtime.Caching.dll b/src/SMAPI.Installer/assets/System.Runtime.Caching.dll Binary files differnew file mode 100644 index 00000000..a062391d --- /dev/null +++ b/src/SMAPI.Installer/assets/System.Runtime.Caching.dll diff --git a/src/SMAPI.Installer/unix-install.sh b/src/SMAPI.Installer/assets/unix-install.sh index 6d0c86ce..6d0c86ce 100644 --- a/src/SMAPI.Installer/unix-install.sh +++ b/src/SMAPI.Installer/assets/unix-install.sh diff --git a/src/SMAPI.Installer/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh index b72eed22..b72eed22 100644 --- a/src/SMAPI.Installer/unix-launcher.sh +++ b/src/SMAPI.Installer/assets/unix-launcher.sh diff --git a/src/SMAPI.Installer/windows-exe-config.xml b/src/SMAPI.Installer/assets/windows-exe-config.xml index 386c7f1a..386c7f1a 100644 --- a/src/SMAPI.Installer/windows-exe-config.xml +++ b/src/SMAPI.Installer/assets/windows-exe-config.xml diff --git a/src/SMAPI.Installer/windows-install.bat b/src/SMAPI.Installer/assets/windows-install.bat index d02dd4c6..d02dd4c6 100644 --- a/src/SMAPI.Installer/windows-install.bat +++ b/src/SMAPI.Installer/assets/windows-install.bat |