Browse Source

Revert `Assembly.GetExecutingAssembly` workaround

monomod-reorg
Meivyn 11 months ago
parent
commit
5ed3539fe4
No known key found for this signature in database GPG Key ID: 8BDD3E48158B2F71
6 changed files with 7 additions and 11 deletions
  1. +2
    -4
      IPA.Injector/Injector.cs
  2. +1
    -1
      IPA.Injector/Updates.cs
  3. +2
    -2
      IPA.Loader/Loader/LibLoader.cs
  4. +1
    -3
      IPA.Loader/Loader/PluginLoader.cs
  5. +1
    -1
      IPA.Loader/Utilities/UnityGame.cs
  6. BIN
      LocalPackages/HarmonyX.2.11.0.nupkg

+ 2
- 4
IPA.Injector/Injector.cs View File

@ -35,8 +35,6 @@ namespace IPA.Injector
private static Task? permissionFixTask;
//private static string otherNewtonsoftJson = null;
public static Assembly ExecutingAssembly => typeof(Injector).Assembly;
// ReSharper disable once UnusedParameter.Global
internal static void Main(string[] args)
{ // entry point for doorstop
@ -143,8 +141,8 @@ namespace IPA.Injector
{
var sw = Stopwatch.StartNew();
var cAsmName = ExecutingAssembly.GetName();
var managedPath = Path.GetDirectoryName(ExecutingAssembly.Location)!;
var cAsmName = Assembly.GetExecutingAssembly().GetName();
var managedPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
var dataDir = new DirectoryInfo(managedPath).Parent!.Name;
var gameName = dataDir.Substring(0, dataDir.Length - 5);


+ 1
- 1
IPA.Injector/Updates.cs View File

@ -35,7 +35,7 @@ namespace IPA.Injector
if (!File.Exists(path)) return;
var ipaVersion = new Version(FileVersionInfo.GetVersionInfo(path).FileVersion);
var selfVersion = Injector.ExecutingAssembly.GetName().Version;
var selfVersion = Assembly.GetExecutingAssembly().GetName().Version;
if (ipaVersion > selfVersion)
{


+ 2
- 2
IPA.Loader/Loader/LibLoader.cs View File

@ -21,8 +21,8 @@ namespace IPA.Loader
{
internal class CecilLibLoader : BaseAssemblyResolver
{
private static readonly string CurrentAssemblyName = PluginLoader.ExecutingAssembly.GetName().Name;
private static readonly string CurrentAssemblyPath = PluginLoader.ExecutingAssembly.Location;
private static readonly string CurrentAssemblyName = Assembly.GetExecutingAssembly().GetName().Name;
private static readonly string CurrentAssemblyPath = Assembly.GetExecutingAssembly().Location;
public override AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters)
{


+ 1
- 3
IPA.Loader/Loader/PluginLoader.cs View File

@ -36,8 +36,6 @@ namespace IPA.Loader
{
internal static PluginMetadata SelfMeta = null!;
public static Assembly ExecutingAssembly => typeof(PluginLoader).Assembly;
internal static Task LoadTask() =>
TaskEx.Run(() =>
{
@ -93,7 +91,7 @@ namespace IPA.Loader
{
var selfMeta = new PluginMetadata
{
Assembly = ExecutingAssembly,
Assembly = Assembly.GetExecutingAssembly(),
File = new FileInfo(Path.Combine(UnityGame.InstallPath, "IPA.exe")),
PluginType = null,
IsSelf = true


+ 1
- 1
IPA.Loader/Utilities/UnityGame.cs View File

@ -143,7 +143,7 @@ namespace IPA.Utilities
{
if (_installRoot == null)
_installRoot = Path.GetFullPath(
Path.Combine(Path.GetDirectoryName(PluginLoader.ExecutingAssembly.Location), "..", ".."));
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "..", ".."));
return _installRoot;
}
}


BIN
LocalPackages/HarmonyX.2.11.0.nupkg View File


Loading…
Cancel
Save