Browse Source

BSIPA will now automatically run IPA.exe if it detects it to be a newer version

pull/46/head
Anairkoen Schno 4 years ago
parent
commit
85117ec4d8
7 changed files with 52 additions and 12 deletions
  1. +32
    -0
      IPA.Injector/Updates.cs
  2. +1
    -1
      IPA.Loader/Config/SelfConfig.cs
  3. +1
    -1
      IPA.Loader/Loader/manifest.json
  4. +16
    -8
      IPA/Arguments.cs
  5. +1
    -1
      IPA/Program.cs
  6. BIN
      Refs/UnityEngine.CoreModule.dll
  7. +1
    -1
      appveyor.yml

+ 32
- 0
IPA.Injector/Updates.cs View File

@ -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;


+ 1
- 1
IPA.Loader/Config/SelfConfig.cs View File

@ -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;


+ 1
- 1
IPA.Loader/Loader/manifest.json View File

@ -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)",


+ 16
- 8
IPA/Arguments.cs View File

@ -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);
}
}


+ 1
- 1
IPA/Program.cs View File

@ -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;


BIN
Refs/UnityEngine.CoreModule.dll View File


+ 1
- 1
appveyor.yml View File

@ -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'


Loading…
Cancel
Save