diff --git a/IPA.Injector/Updates.cs b/IPA.Injector/Updates.cs index 7d870fc5..382f4f77 100644 --- a/IPA.Injector/Updates.cs +++ b/IPA.Injector/Updates.cs @@ -1,8 +1,10 @@ using IPA.Utilities; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection; using static IPA.Logging.Logger; namespace IPA.Injector @@ -10,7 +12,37 @@ namespace IPA.Injector internal static class Updates { private const string DeleteFileName = Updating.BeatMods.Updater.SpecialDeletionsFile; + public static void InstallPendingUpdates() + { + InstallPendingSelfUpdates(); + InstallPendingModUpdates(); + } + + private static void InstallPendingSelfUpdates() + { + var path = Path.Combine(BeatSaber.InstallPath, "IPA.exe"); + if (!File.Exists(path)) return; + + var ipaVersion = new Version(FileVersionInfo.GetVersionInfo(path).FileVersion); + var selfVersion = Assembly.GetExecutingAssembly().GetName().Version; + + if (ipaVersion > selfVersion) + { + Process.Start(new ProcessStartInfo + { + // will never actually be null + FileName = path, + Arguments = $"\"-nw={Process.GetCurrentProcess().Id},s={string.Join(" ", Environment.GetCommandLineArgs().Skip(1)).Replace("\\", "\\\\").Replace(",", "\\,")}\"", + UseShellExecute = false + }); + + updater.Info("Updating BSIPA..."); + Environment.Exit(0); + } + } + + private static void InstallPendingModUpdates() { var pendingDir = Path.Combine(BeatSaber.InstallPath, "IPA", "Pending"); if (!Directory.Exists(pendingDir)) return; diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index b69c4033..cb7ae0c2 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -37,7 +37,7 @@ namespace IPA.Config } internal const string IPAName = "Beat Saber IPA"; - internal const string IPAVersion = "3.12.23"; + internal const string IPAVersion = "3.12.24"; public bool Regenerate = true; diff --git a/IPA.Loader/Loader/manifest.json b/IPA.Loader/Loader/manifest.json index 1393dfce..3c057e66 100644 --- a/IPA.Loader/Loader/manifest.json +++ b/IPA.Loader/Loader/manifest.json @@ -8,7 +8,7 @@ "gameVersion": "1.1.0", "id": "BSIPA", "name": "Beat Saber IPA", - "version": "3.12.23", + "version": "3.12.24", "icon": "IPA.icon.png", "features": [ "define-feature(print, IPA.Loader.Features.PrintFeature)", diff --git a/IPA/Arguments.cs b/IPA/Arguments.cs index b7d91f29..904a2564 100644 --- a/IPA/Arguments.cs +++ b/IPA/Arguments.cs @@ -57,6 +57,7 @@ namespace IPA var subBuildState = new StringBuilder(); var parsingValue = false; + var escaped = false; var mainChar = ' '; foreach (var chr in argument) { @@ -74,16 +75,23 @@ namespace IPA } else { - if (chr == ',') + if (!escaped) { - parsingValue = false; - flags[mainChar] = subBuildState.ToString(); - subBuildState = new StringBuilder(); - } - else - { - subBuildState.Append(chr); + if (chr == ',') + { + parsingValue = false; + flags[mainChar] = subBuildState.ToString(); + subBuildState = new StringBuilder(); + continue; + } + else if (chr == '\\') + { + escaped = true; + continue; + } } + + subBuildState.Append(chr); } } diff --git a/IPA/Program.cs b/IPA/Program.cs index 86fc39d2..e67c861d 100644 --- a/IPA/Program.cs +++ b/IPA/Program.cs @@ -23,7 +23,7 @@ namespace IPA Unknown } - public const string FileVersion = "3.12.23"; + public const string FileVersion = "3.12.24"; public static Version Version => Assembly.GetEntryAssembly().GetName().Version; diff --git a/Refs/UnityEngine.CoreModule.dll b/Refs/UnityEngine.CoreModule.dll index bf2ff633..f6478af7 100644 Binary files a/Refs/UnityEngine.CoreModule.dll and b/Refs/UnityEngine.CoreModule.dll differ diff --git a/appveyor.yml b/appveyor.yml index 44ffedfd..7c0266e7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 'BSIPA-{branch}-{build}' environment: - bsipa_version: '3.12.23' + bsipa_version: '3.12.24' gh_token: secure: E42gl/yepETuoLSwbJZ1GmEIPK6cCJu6zkd59NA21XiICtEV6COOLW7aehi1tcVU BUILD_DOCS: 'no'