From bac86b42274e7106344b182b96b2d5e9bd78ddac Mon Sep 17 00:00:00 2001 From: DashingCat <65317616+DashingCat@users.noreply.github.com> Date: Wed, 10 Dec 2025 23:36:23 +0100 Subject: [PATCH 1/4] Add workspace to MiniInstaller --- MiniInstaller/DepCalls.cs | 2 +- MiniInstaller/Globals.cs | 2 +- MiniInstaller/LibAndDepHandling.cs | 4 ++-- MiniInstaller/MiscUtil.cs | 9 +++------ MiniInstaller/Program.cs | 26 ++++++++++++++++++++++---- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/MiniInstaller/DepCalls.cs b/MiniInstaller/DepCalls.cs index 7cdc4f7fd..a09988005 100644 --- a/MiniInstaller/DepCalls.cs +++ b/MiniInstaller/DepCalls.cs @@ -132,4 +132,4 @@ public static void ConvertToNETCoreSingle(string asmFrom, string asmTo) { File.Delete(Path.ChangeExtension(asmTmp, "mdb")); } } -} \ No newline at end of file +} diff --git a/MiniInstaller/Globals.cs b/MiniInstaller/Globals.cs index 2c2688d55..4331f1137 100644 --- a/MiniInstaller/Globals.cs +++ b/MiniInstaller/Globals.cs @@ -87,4 +87,4 @@ public static void DetermineInstallPlatform() { Logger.LogLine($"Determined install platform: {Platform}"); } -} \ No newline at end of file +} diff --git a/MiniInstaller/LibAndDepHandling.cs b/MiniInstaller/LibAndDepHandling.cs index 161684567..d5d1affad 100644 --- a/MiniInstaller/LibAndDepHandling.cs +++ b/MiniInstaller/LibAndDepHandling.cs @@ -106,8 +106,7 @@ void CopyNativeLib(string src, string dst) { // Copy our Steamworks.NET.dll string steamworksLibDst = Path.Combine(Globals.PathGame, "Steamworks.NET.dll"); - File.Delete(steamworksLibDst); - File.Copy(steamworksLibSrc, steamworksLibDst); + File.Copy(steamworksLibSrc, steamworksLibDst, true); // Delete old libraries foreach (string libFile in Globals.WindowsNativeLibFileNames) @@ -268,6 +267,7 @@ public static void SetupAppHosts(string appExe, string appDll, string resDll = n // Bind Linux apphost Logger.LogLine($"Binding Linux apphost {Path.ChangeExtension(appExe, null)}"); HostWriter.CreateAppHost(Path.Combine(hostsDir, "linux"), Path.ChangeExtension(appExe, null), Path.GetRelativePath(Path.GetDirectoryName(appExe), appDll)); + File.Delete(Globals.PathCelesteExe); } break; case Globals.InstallPlatform.MacOS: { // Bind OS X apphost diff --git a/MiniInstaller/MiscUtil.cs b/MiniInstaller/MiscUtil.cs index 91ad471e7..803ecad91 100644 --- a/MiniInstaller/MiscUtil.cs +++ b/MiniInstaller/MiscUtil.cs @@ -72,18 +72,15 @@ public static bool IsSteamworksNet(string file) { } // This is not "pure" but I guess it also somewhat fits here public static void MoveExecutable(string srcPath, string dstPath) { - File.Delete(dstPath); - File.Move(srcPath, dstPath); + File.Move(srcPath, dstPath, true); if (Path.GetFullPath(Path.ChangeExtension(srcPath, null)) != Path.GetFullPath(Path.ChangeExtension(dstPath, null))) { if (File.Exists(Path.ChangeExtension(srcPath, ".pdb"))) { - File.Delete(Path.ChangeExtension(dstPath, ".pdb")); - File.Move(Path.ChangeExtension(srcPath, ".pdb"), Path.ChangeExtension(dstPath, ".pdb")); + File.Move(Path.ChangeExtension(srcPath, ".pdb"), Path.ChangeExtension(dstPath, ".pdb"), true); } if (File.Exists(Path.ChangeExtension(srcPath, ".mdb"))) { - File.Delete(Path.ChangeExtension(dstPath, ".mdb")); - File.Move(Path.ChangeExtension(srcPath, ".mdb"), Path.ChangeExtension(dstPath, ".mdb")); + File.Move(Path.ChangeExtension(srcPath, ".mdb"), Path.ChangeExtension(dstPath, ".mdb"), true); } } } diff --git a/MiniInstaller/Program.cs b/MiniInstaller/Program.cs index 2f8d16cfc..1ee8cfbf5 100644 --- a/MiniInstaller/Program.cs +++ b/MiniInstaller/Program.cs @@ -80,25 +80,43 @@ public static int StandardMode(string[] args) { LibAndDepHandling.SetupNativeLibs(); LibAndDepHandling.CopyControllerDB(); + string miniInstallerWorkspace = "MiniInstallerWorkspace"; + string miniInstallerWorkspaceWIP = Path.Combine(miniInstallerWorkspace, "wip"); // intermediate steps + string miniInstallerWorkspaceDone = Path.Combine(miniInstallerWorkspace, "done"); // final binaries + + if (Directory.Exists(miniInstallerWorkspace)) { + Logger.LogLine("MiniInstaller workspace already exists, cleaning before continuing."); + Directory.Delete(miniInstallerWorkspace, true); + } + + Directory.CreateDirectory(miniInstallerWorkspaceWIP); + Directory.CreateDirectory(miniInstallerWorkspaceDone); + + string coreifiedCeleste = Path.Combine(miniInstallerWorkspaceWIP, "Celeste.exe"); + string coreifiedModdedCeleste = Path.Combine(miniInstallerWorkspaceDone, "Celeste.dll"); + DepCalls.LoadModders(); - DepCalls.ConvertToNETCore(Path.Combine(Globals.PathOrig, "Celeste.exe"), Globals.PathCelesteExe); + DepCalls.ConvertToNETCore(Path.Combine(Globals.PathOrig, "Celeste.exe"), coreifiedCeleste); string everestModDLL = Path.ChangeExtension(Globals.PathCelesteExe, ".Mod.mm.dll"); string[] mods = new string[] { Globals.PathEverestLib, everestModDLL }; DepCalls.RunMonoMod(Path.Combine(Globals.PathEverestLib, "FNA.dll"), Path.Combine(Globals.PathGame, "FNA.dll"), dllPaths: mods); // We need to patch some methods in FNA as well - DepCalls.RunMonoMod(Globals.PathCelesteExe, dllPaths: mods); + DepCalls.RunMonoMod(coreifiedCeleste, coreifiedModdedCeleste, dllPaths: mods); string hookGenOutput = Path.Combine(Globals.PathGame, "MMHOOK_" + Path.ChangeExtension(Path.GetFileName(Globals.PathCelesteExe), ".dll")); - DepCalls.RunHookGen(Globals.PathCelesteExe, Globals.PathCelesteExe); + DepCalls.RunHookGen(coreifiedModdedCeleste, Globals.PathCelesteExe); DepCalls.RunMonoMod(hookGenOutput, dllPaths: mods); // We need to fix some MonoMod crimes, so relink it against the legacy MonoMod layer - MiscUtil.MoveExecutable(Globals.PathCelesteExe, Globals.PathEverestDLL); + MiscUtil.MoveExecutable(coreifiedModdedCeleste, Globals.PathEverestDLL); LibAndDepHandling.CreateRuntimeConfigFiles(Globals.PathEverestDLL, new string[] { everestModDLL, hookGenOutput }); LibAndDepHandling.SetupAppHosts(Globals.PathCelesteExe, Globals.PathEverestDLL, Globals.PathEverestDLL); XmlDoc.CombineXMLDoc(Path.ChangeExtension(Globals.PathCelesteExe, ".Mod.mm.xml"), Path.ChangeExtension(Globals.PathCelesteExe, ".xml")); + // Everything went well, cleaning MiniInstaller workspace + Directory.Delete(miniInstallerWorkspace, true); + // If we're updating, start the game. Otherwise, close the window. if (Globals.PathUpdate != null) { InGameUpdaterHelper.StartGame(); From eb150898fe716bee88d61dbead4eee2c683ce588 Mon Sep 17 00:00:00 2001 From: DashingCat <65317616+DashingCat@users.noreply.github.com> Date: Thu, 18 Dec 2025 00:39:41 +0100 Subject: [PATCH 2/4] Address comments related to MiniInstaller's workspace --- MiniInstaller/BackUp.cs | 2 +- MiniInstaller/DepCalls.cs | 4 ++-- MiniInstaller/Globals.cs | 3 +++ MiniInstaller/LibAndDepHandling.cs | 1 + MiniInstaller/Program.cs | 34 +++++++++++++++--------------- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/MiniInstaller/BackUp.cs b/MiniInstaller/BackUp.cs index aece3d4bb..5478d70fe 100644 --- a/MiniInstaller/BackUp.cs +++ b/MiniInstaller/BackUp.cs @@ -140,4 +140,4 @@ private static void Backup(string from, string backupDst = null) { } } } -} \ No newline at end of file +} diff --git a/MiniInstaller/DepCalls.cs b/MiniInstaller/DepCalls.cs index a09988005..e361c4abe 100644 --- a/MiniInstaller/DepCalls.cs +++ b/MiniInstaller/DepCalls.cs @@ -63,7 +63,7 @@ public static void RunMonoMod(string asmFrom, string asmTo = null, string[] dllP string asmTmp = Path.Combine(Globals.PathTmp, Path.GetFileName(asmTo)); try { // We're lazy. - Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", Globals.PathGame); + Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", $"{Globals.PathMiniInstallerWorkspace}:{Globals.PathGame}"); // Prioritize workspace Environment.SetEnvironmentVariable("MONOMOD_DEPENDENCY_MISSING_THROW", "0"); int returnCode = (int) AsmMonoMod.EntryPoint.Invoke(null, new object[] { Enumerable.Repeat(asmFrom, 1).Concat(dllPaths).Append(asmTmp).ToArray() }); @@ -84,7 +84,7 @@ public static void RunMonoMod(string asmFrom, string asmTo = null, string[] dllP public static void RunHookGen(string asm, string targetName) { Logger.LogLine($"Running MonoMod.RuntimeDetour.HookGen for {asm}"); // We're lazy. - Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", Globals.PathGame); + Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", $"{Globals.PathMiniInstallerWorkspace}:{Globals.PathGame}"); // Prioritize workspace Environment.SetEnvironmentVariable("MONOMOD_DEPENDENCY_MISSING_THROW", "0"); AsmHookGen.EntryPoint.Invoke(null, new object[] { new string[] { "--private", asm, Path.Combine(Path.GetDirectoryName(targetName), "MMHOOK_" + Path.ChangeExtension(Path.GetFileName(targetName), "dll")) } }); } diff --git a/MiniInstaller/Globals.cs b/MiniInstaller/Globals.cs index 4331f1137..486c3d7d3 100644 --- a/MiniInstaller/Globals.cs +++ b/MiniInstaller/Globals.cs @@ -22,9 +22,12 @@ public static class Globals { public static string PathOrig; public static string PathLog; public static string PathTmp; + public static string PathMiniInstallerWorkspace; + public static bool SetupPaths() { PathGame = Directory.GetCurrentDirectory(); Console.WriteLine(PathGame); + PathMiniInstallerWorkspace = Path.Combine(PathGame, "MiniInstallerWorkspace"); if (Path.GetFileName(PathGame) == "everest-update" && ( File.Exists(Path.Combine(Path.GetDirectoryName(PathGame), "Celeste.exe")) || diff --git a/MiniInstaller/LibAndDepHandling.cs b/MiniInstaller/LibAndDepHandling.cs index d5d1affad..bbaca3a03 100644 --- a/MiniInstaller/LibAndDepHandling.cs +++ b/MiniInstaller/LibAndDepHandling.cs @@ -277,6 +277,7 @@ public static void SetupAppHosts(string appExe, string appDll, string resDll = n File.Delete(Path.Combine(Globals.PathOSXExecDir, Path.GetFileNameWithoutExtension(appExe))); File.CreateSymbolicLink(Path.Combine(Globals.PathOSXExecDir, Path.GetFileNameWithoutExtension(appExe)), Path.GetRelativePath(Globals.PathOSXExecDir, Path.ChangeExtension(appExe, null))); + File.Delete(Globals.PathCelesteExe); } break; } } diff --git a/MiniInstaller/Program.cs b/MiniInstaller/Program.cs index 1ee8cfbf5..6643c4d44 100644 --- a/MiniInstaller/Program.cs +++ b/MiniInstaller/Program.cs @@ -80,20 +80,17 @@ public static int StandardMode(string[] args) { LibAndDepHandling.SetupNativeLibs(); LibAndDepHandling.CopyControllerDB(); - string miniInstallerWorkspace = "MiniInstallerWorkspace"; - string miniInstallerWorkspaceWIP = Path.Combine(miniInstallerWorkspace, "wip"); // intermediate steps - string miniInstallerWorkspaceDone = Path.Combine(miniInstallerWorkspace, "done"); // final binaries - - if (Directory.Exists(miniInstallerWorkspace)) { + if (Directory.Exists(Globals.PathMiniInstallerWorkspace)) { Logger.LogLine("MiniInstaller workspace already exists, cleaning before continuing."); - Directory.Delete(miniInstallerWorkspace, true); + Directory.Delete(Globals.PathMiniInstallerWorkspace, true); } - Directory.CreateDirectory(miniInstallerWorkspaceWIP); - Directory.CreateDirectory(miniInstallerWorkspaceDone); + Directory.CreateDirectory(Globals.PathMiniInstallerWorkspace); - string coreifiedCeleste = Path.Combine(miniInstallerWorkspaceWIP, "Celeste.exe"); - string coreifiedModdedCeleste = Path.Combine(miniInstallerWorkspaceDone, "Celeste.dll"); + string coreifiedCeleste = Path.Combine(Globals.PathMiniInstallerWorkspace, "Celeste.Core.dll"); + string coreifiedModdedCeleste = Path.Combine(Globals.PathMiniInstallerWorkspace, "Celeste.dll"); + string moddedFNA = Path.Combine(Globals.PathMiniInstallerWorkspace, "FNA.dll"); + string hookGenTempOutput = Path.Combine(Globals.PathMiniInstallerWorkspace, "MMHOOK_" + Path.ChangeExtension(Path.GetFileName(Globals.PathCelesteExe), ".dll")); DepCalls.LoadModders(); @@ -101,21 +98,24 @@ public static int StandardMode(string[] args) { string everestModDLL = Path.ChangeExtension(Globals.PathCelesteExe, ".Mod.mm.dll"); string[] mods = new string[] { Globals.PathEverestLib, everestModDLL }; - DepCalls.RunMonoMod(Path.Combine(Globals.PathEverestLib, "FNA.dll"), Path.Combine(Globals.PathGame, "FNA.dll"), dllPaths: mods); // We need to patch some methods in FNA as well + DepCalls.RunMonoMod(Path.Combine(Globals.PathEverestLib, "FNA.dll"), moddedFNA, dllPaths: mods); // We need to patch some methods in FNA as well DepCalls.RunMonoMod(coreifiedCeleste, coreifiedModdedCeleste, dllPaths: mods); string hookGenOutput = Path.Combine(Globals.PathGame, "MMHOOK_" + Path.ChangeExtension(Path.GetFileName(Globals.PathCelesteExe), ".dll")); - DepCalls.RunHookGen(coreifiedModdedCeleste, Globals.PathCelesteExe); - DepCalls.RunMonoMod(hookGenOutput, dllPaths: mods); // We need to fix some MonoMod crimes, so relink it against the legacy MonoMod layer + DepCalls.RunHookGen(coreifiedModdedCeleste, coreifiedModdedCeleste); + DepCalls.RunMonoMod(hookGenTempOutput, dllPaths: mods); // We need to fix some MonoMod crimes, so relink it against the legacy MonoMod layer MiscUtil.MoveExecutable(coreifiedModdedCeleste, Globals.PathEverestDLL); + MiscUtil.MoveExecutable(moddedFNA, Path.Combine(Globals.PathGame, "FNA.dll")); + MiscUtil.MoveExecutable(hookGenTempOutput, hookGenOutput); + LibAndDepHandling.CreateRuntimeConfigFiles(Globals.PathEverestDLL, new string[] { everestModDLL, hookGenOutput }); LibAndDepHandling.SetupAppHosts(Globals.PathCelesteExe, Globals.PathEverestDLL, Globals.PathEverestDLL); XmlDoc.CombineXMLDoc(Path.ChangeExtension(Globals.PathCelesteExe, ".Mod.mm.xml"), Path.ChangeExtension(Globals.PathCelesteExe, ".xml")); // Everything went well, cleaning MiniInstaller workspace - Directory.Delete(miniInstallerWorkspace, true); + Directory.Delete(Globals.PathMiniInstallerWorkspace, true); // If we're updating, start the game. Otherwise, close the window. if (Globals.PathUpdate != null) { @@ -144,7 +144,7 @@ public static int StandardMode(string[] args) { return 0; } - + /// /// Fast mode serves as a way to speed up development environments, /// allowing disabling most parts of the installation process to only focus on the ones @@ -198,10 +198,10 @@ public static int FastMode(string[] args) { string[] mods = new string[] { Globals.PathEverestLib, everestModDLL }; string coreGameCacheFile = Path.ChangeExtension(Globals.PathCelesteExe, ".CoreGameCache.dll"); - + if (doMainGame && !File.Exists(coreGameCacheFile)) coreGameCacheRegen = true; - + if (coreGameCacheRegen && File.Exists(coreGameCacheFile)) File.Delete(coreGameCacheFile); From 79dd046bcbbc7128dee4dab825db1ef100314b9c Mon Sep 17 00:00:00 2001 From: DashingCat <65317616+DashingCat@users.noreply.github.com> Date: Thu, 18 Dec 2025 23:26:45 +0100 Subject: [PATCH 3/4] Use `Path.PathSeparator` instead of `:` --- MiniInstaller/DepCalls.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MiniInstaller/DepCalls.cs b/MiniInstaller/DepCalls.cs index e361c4abe..d8454a981 100644 --- a/MiniInstaller/DepCalls.cs +++ b/MiniInstaller/DepCalls.cs @@ -63,7 +63,7 @@ public static void RunMonoMod(string asmFrom, string asmTo = null, string[] dllP string asmTmp = Path.Combine(Globals.PathTmp, Path.GetFileName(asmTo)); try { // We're lazy. - Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", $"{Globals.PathMiniInstallerWorkspace}:{Globals.PathGame}"); // Prioritize workspace + Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", $"{Globals.PathMiniInstallerWorkspace}{Path.PathSeparator}{Globals.PathGame}"); // Prioritize workspace Environment.SetEnvironmentVariable("MONOMOD_DEPENDENCY_MISSING_THROW", "0"); int returnCode = (int) AsmMonoMod.EntryPoint.Invoke(null, new object[] { Enumerable.Repeat(asmFrom, 1).Concat(dllPaths).Append(asmTmp).ToArray() }); @@ -84,7 +84,7 @@ public static void RunMonoMod(string asmFrom, string asmTo = null, string[] dllP public static void RunHookGen(string asm, string targetName) { Logger.LogLine($"Running MonoMod.RuntimeDetour.HookGen for {asm}"); // We're lazy. - Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", $"{Globals.PathMiniInstallerWorkspace}:{Globals.PathGame}"); // Prioritize workspace + Environment.SetEnvironmentVariable("MONOMOD_DEPDIRS", $"{Globals.PathMiniInstallerWorkspace}{Path.PathSeparator}{Globals.PathGame}"); // Prioritize workspace Environment.SetEnvironmentVariable("MONOMOD_DEPENDENCY_MISSING_THROW", "0"); AsmHookGen.EntryPoint.Invoke(null, new object[] { new string[] { "--private", asm, Path.Combine(Path.GetDirectoryName(targetName), "MMHOOK_" + Path.ChangeExtension(Path.GetFileName(targetName), "dll")) } }); } From 33be98875dfe91e76322aa772eea1d2023f737cb Mon Sep 17 00:00:00 2001 From: DashingCat <65317616+DashingCat@users.noreply.github.com> Date: Thu, 8 Jan 2026 19:37:11 +0100 Subject: [PATCH 4/4] Add missing parameter names --- MiniInstaller/BackUp.cs | 2 +- MiniInstaller/InGameUpdaterHelper.cs | 4 ++-- MiniInstaller/LibAndDepHandling.cs | 10 +++++----- MiniInstaller/MiscUtil.cs | 6 +++--- MiniInstaller/Program.cs | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MiniInstaller/BackUp.cs b/MiniInstaller/BackUp.cs index 5478d70fe..fa50563e5 100644 --- a/MiniInstaller/BackUp.cs +++ b/MiniInstaller/BackUp.cs @@ -65,7 +65,7 @@ static void ApplyVanillaPatchLibs(string patchLibsDir, string targetDir) { Logger.LogLine("Applying patch vanilla libraries"); ApplyVanillaPatchLibs(patchLibsDir, Globals.PathOrig); - Directory.Delete(patchLibsDir, true); + Directory.Delete(patchLibsDir, recursive: true); } //Create symlinks diff --git a/MiniInstaller/InGameUpdaterHelper.cs b/MiniInstaller/InGameUpdaterHelper.cs index a2b9ebf33..4db6fd839 100644 --- a/MiniInstaller/InGameUpdaterHelper.cs +++ b/MiniInstaller/InGameUpdaterHelper.cs @@ -18,7 +18,7 @@ public static void MoveFilesFromUpdate(string srcPath = null, string dstPath = n // Check if we have a new runtime (=there is a piton-runtime folder both in the game and the update directory) if (Directory.Exists(Path.Combine(Globals.PathGame, "piton-runtime")) && Directory.Exists(Path.Combine(Globals.PathUpdate, "piton-runtime"))) - Directory.Delete(Path.Combine(Globals.PathGame, "piton-runtime"), true); + Directory.Delete(Path.Combine(Globals.PathGame, "piton-runtime"), recursive: true); } if (!Directory.Exists(dstPath)) @@ -29,7 +29,7 @@ public static void MoveFilesFromUpdate(string srcPath = null, string dstPath = n if (File.Exists(entrySrc)) { Logger.LogLine($"Copying {entrySrc} +> {entryDst}"); - File.Copy(entrySrc, entryDst, true); + File.Copy(entrySrc, entryDst, overwrite: true); } else MoveFilesFromUpdate(entrySrc, entryDst); } diff --git a/MiniInstaller/LibAndDepHandling.cs b/MiniInstaller/LibAndDepHandling.cs index bbaca3a03..78539e331 100644 --- a/MiniInstaller/LibAndDepHandling.cs +++ b/MiniInstaller/LibAndDepHandling.cs @@ -85,7 +85,7 @@ void CopyNativeLib(string src, string dst) { dst = Path.Combine(Path.GetDirectoryName(dst), mappedName); } - File.Copy(src, dst, true); + File.Copy(src, dst, overwrite: true); if (symlinkPath != null && symlinkPath != dst) { File.Delete(symlinkPath); @@ -106,7 +106,7 @@ void CopyNativeLib(string src, string dst) { // Copy our Steamworks.NET.dll string steamworksLibDst = Path.Combine(Globals.PathGame, "Steamworks.NET.dll"); - File.Copy(steamworksLibSrc, steamworksLibDst, true); + File.Copy(steamworksLibSrc, steamworksLibDst, overwrite: true); // Delete old libraries foreach (string libFile in Globals.WindowsNativeLibFileNames) @@ -114,11 +114,11 @@ void CopyNativeLib(string src, string dst) { foreach (string libDir in new string[] { "lib", "lib64", "everest-lib64", "runtimes" }) { if (Directory.Exists(Path.Combine(Globals.PathGame, libDir))) - Directory.Delete(Path.Combine(Globals.PathGame, libDir), true); + Directory.Delete(Path.Combine(Globals.PathGame, libDir), recursive: true); } if (Globals.PathOSXExecDir != null && Path.Exists(Path.Combine(Globals.PathOSXExecDir, "osx"))) - Directory.Delete(Path.Combine(Globals.PathOSXExecDir, "osx"), true); + Directory.Delete(Path.Combine(Globals.PathOSXExecDir, "osx"), recursive: true); // Finally make EverestSplash executable if (Globals.Platform is Globals.InstallPlatform.Linux or Globals.InstallPlatform.MacOS) { @@ -137,7 +137,7 @@ void CopyNativeLib(string src, string dst) { } public static void CopyControllerDB() { - File.Copy(Path.Combine(Globals.PathEverestLib, "gamecontrollerdb.txt"), Path.Combine(Globals.PathGame, "gamecontrollerdb.txt"), true); + File.Copy(Path.Combine(Globals.PathEverestLib, "gamecontrollerdb.txt"), Path.Combine(Globals.PathGame, "gamecontrollerdb.txt"), overwrite: true); Logger.LogLine("Copied gamecontrollerdb.txt"); } diff --git a/MiniInstaller/MiscUtil.cs b/MiniInstaller/MiscUtil.cs index 803ecad91..8b5ee44f9 100644 --- a/MiniInstaller/MiscUtil.cs +++ b/MiniInstaller/MiscUtil.cs @@ -72,15 +72,15 @@ public static bool IsSteamworksNet(string file) { } // This is not "pure" but I guess it also somewhat fits here public static void MoveExecutable(string srcPath, string dstPath) { - File.Move(srcPath, dstPath, true); + File.Move(srcPath, dstPath, overwrite: true); if (Path.GetFullPath(Path.ChangeExtension(srcPath, null)) != Path.GetFullPath(Path.ChangeExtension(dstPath, null))) { if (File.Exists(Path.ChangeExtension(srcPath, ".pdb"))) { - File.Move(Path.ChangeExtension(srcPath, ".pdb"), Path.ChangeExtension(dstPath, ".pdb"), true); + File.Move(Path.ChangeExtension(srcPath, ".pdb"), Path.ChangeExtension(dstPath, ".pdb"), overwrite: true); } if (File.Exists(Path.ChangeExtension(srcPath, ".mdb"))) { - File.Move(Path.ChangeExtension(srcPath, ".mdb"), Path.ChangeExtension(dstPath, ".mdb"), true); + File.Move(Path.ChangeExtension(srcPath, ".mdb"), Path.ChangeExtension(dstPath, ".mdb"), overwrite: true); } } } diff --git a/MiniInstaller/Program.cs b/MiniInstaller/Program.cs index 6643c4d44..0f0658160 100644 --- a/MiniInstaller/Program.cs +++ b/MiniInstaller/Program.cs @@ -82,7 +82,7 @@ public static int StandardMode(string[] args) { if (Directory.Exists(Globals.PathMiniInstallerWorkspace)) { Logger.LogLine("MiniInstaller workspace already exists, cleaning before continuing."); - Directory.Delete(Globals.PathMiniInstallerWorkspace, true); + Directory.Delete(Globals.PathMiniInstallerWorkspace, recursive: true); } Directory.CreateDirectory(Globals.PathMiniInstallerWorkspace); @@ -115,7 +115,7 @@ public static int StandardMode(string[] args) { XmlDoc.CombineXMLDoc(Path.ChangeExtension(Globals.PathCelesteExe, ".Mod.mm.xml"), Path.ChangeExtension(Globals.PathCelesteExe, ".xml")); // Everything went well, cleaning MiniInstaller workspace - Directory.Delete(Globals.PathMiniInstallerWorkspace, true); + Directory.Delete(Globals.PathMiniInstallerWorkspace, recursive: true); // If we're updating, start the game. Otherwise, close the window. if (Globals.PathUpdate != null) {