-
Notifications
You must be signed in to change notification settings - Fork 97
Add workspace to MiniInstaller #1037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,4 +140,4 @@ private static void Backup(string from, string backupDst = null) { | |
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: (for readability)
Suggested change
(& similarly for the other |
||||||
|
|
||||||
| 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); | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -80,25 +80,43 @@ public static int StandardMode(string[] args) { | |||||
| LibAndDepHandling.SetupNativeLibs(); | ||||||
| LibAndDepHandling.CopyControllerDB(); | ||||||
|
|
||||||
| if (Directory.Exists(Globals.PathMiniInstallerWorkspace)) { | ||||||
| Logger.LogLine("MiniInstaller workspace already exists, cleaning before continuing."); | ||||||
| Directory.Delete(Globals.PathMiniInstallerWorkspace, true); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: (readability)
Suggested change
(& similarly for the other recursive Directory.Delete) |
||||||
| } | ||||||
|
|
||||||
| Directory.CreateDirectory(Globals.PathMiniInstallerWorkspace); | ||||||
|
|
||||||
| 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")); | ||||||
|
|
||||||
Wartori54 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| DepCalls.LoadModders(); | ||||||
|
|
||||||
| DepCalls.ConvertToNETCore(Path.Combine(Globals.PathOrig, "Celeste.exe"), Globals.PathCelesteExe); | ||||||
| DepCalls.ConvertToNETCore(Path.Combine(Globals.PathOrig, "Celeste.exe"), coreifiedCeleste); | ||||||
Wartori54 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| 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(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(Globals.PathCelesteExe, 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); | ||||||
Wartori54 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| MiscUtil.MoveExecutable(moddedFNA, Path.Combine(Globals.PathGame, "FNA.dll")); | ||||||
| MiscUtil.MoveExecutable(hookGenTempOutput, hookGenOutput); | ||||||
|
|
||||||
| MiscUtil.MoveExecutable(Globals.PathCelesteExe, 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(Globals.PathMiniInstallerWorkspace, true); | ||||||
|
|
||||||
| // If we're updating, start the game. Otherwise, close the window. | ||||||
| if (Globals.PathUpdate != null) { | ||||||
| InGameUpdaterHelper.StartGame(); | ||||||
|
|
@@ -126,7 +144,7 @@ public static int StandardMode(string[] args) { | |||||
|
|
||||||
| return 0; | ||||||
| } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// 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 | ||||||
|
|
@@ -180,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); | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: (for readability)