Skip to content

Commit

Permalink
Don't generate more MMHOOK files if one already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
harbingerofme committed Dec 27, 2020
1 parent eff5258 commit bc3d3b3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
10 changes: 10 additions & 0 deletions HookGenPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ public static void Initialize()
string pathIn = Path.Combine(Paths.ManagedPath, "Assembly-CSharp.dll");
string pathOut = Path.Combine(Paths.PluginPath, "MMHOOK_Assembly-CSharp.dll");

foreach(string mmhookFile in Directory.EnumerateFiles(Paths.PluginPath, "MMHOOK_Assembly-CSharp.dll",SearchOption.AllDirectories))
{
if (Path.GetFileName(mmhookFile).Equals("MMHOOK_Assembly-CSharp.dll"))
{
pathOut = mmhookFile;
Logger.LogInfo("Previous MMHOOK location found. Using that location to save instead.");
break;
}
}

var size = new FileInfo(pathIn).Length;

if (File.Exists(pathOut))
Expand Down
16 changes: 9 additions & 7 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
using System.Reflection;
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Bepinex.Monomod.HookGenPatcher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("Runtime hookgen for bepinex")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("HarbingerOfMe")]
[assembly: AssemblyProduct("Bepinex.Monomod.HookGenPatcher")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("HarbingerOfMe2020")]
[assembly: AssemblyTrademark("MIT")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand All @@ -32,5 +33,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: NeutralResourcesLanguage("")]

0 comments on commit bc3d3b3

Please sign in to comment.