Browse Source

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

pull/32/head
Anairkoen Schno 5 years ago
parent
commit
3ad1763f93
8 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/Assembly-CSharp.dll
  7. BIN
      Refs/UnityEngine.CoreModule.dll
  8. +1
    -1
      appveyor.yml

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

@ -1,8 +1,10 @@
using IPA.Utilities; using IPA.Utilities;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using static IPA.Logging.Logger; using static IPA.Logging.Logger;
namespace IPA.Injector namespace IPA.Injector
@ -10,7 +12,37 @@ namespace IPA.Injector
internal static class Updates internal static class Updates
{ {
private const string DeleteFileName = Updating.BeatMods.Updater.SpecialDeletionsFile; private const string DeleteFileName = Updating.BeatMods.Updater.SpecialDeletionsFile;
public static void InstallPendingUpdates() 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"); var pendingDir = Path.Combine(BeatSaber.InstallPath, "IPA", "Pending");
if (!Directory.Exists(pendingDir)) return; 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 IPAName = "Beat Saber IPA";
internal const string IPAVersion = "3.12.23";
internal const string IPAVersion = "3.12.24";
public bool Regenerate = true; public bool Regenerate = true;


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

@ -8,7 +8,7 @@
"gameVersion": "1.1.0", "gameVersion": "1.1.0",
"id": "BSIPA", "id": "BSIPA",
"name": "Beat Saber IPA", "name": "Beat Saber IPA",
"version": "3.12.23",
"version": "3.12.24",
"icon": "IPA.icon.png", "icon": "IPA.icon.png",
"features": [ "features": [
"define-feature(print, IPA.Loader.Features.PrintFeature)", "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 subBuildState = new StringBuilder();
var parsingValue = false; var parsingValue = false;
var escaped = false;
var mainChar = ' '; var mainChar = ' ';
foreach (var chr in argument) foreach (var chr in argument)
{ {
@ -74,16 +75,23 @@ namespace IPA
} }
else 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 Unknown
} }
public const string FileVersion = "3.12.23";
public const string FileVersion = "3.12.24";
public static Version Version => Assembly.GetEntryAssembly().GetName().Version; public static Version Version => Assembly.GetEntryAssembly().GetName().Version;


BIN
Refs/Assembly-CSharp.dll View File


BIN
Refs/UnityEngine.CoreModule.dll View File


+ 1
- 1
appveyor.yml View File

@ -1,7 +1,7 @@
version: 'BSIPA-{branch}-{build}' version: 'BSIPA-{branch}-{build}'
environment: environment:
bsipa_version: '3.12.23'
bsipa_version: '3.12.24'
gh_token: gh_token:
secure: E42gl/yepETuoLSwbJZ1GmEIPK6cCJu6zkd59NA21XiICtEV6COOLW7aehi1tcVU secure: E42gl/yepETuoLSwbJZ1GmEIPK6cCJu6zkd59NA21XiICtEV6COOLW7aehi1tcVU
BUILD_DOCS: 'no' BUILD_DOCS: 'no'


Loading…
Cancel
Save