Various changes.

This commit is contained in:
Eusth 2017-01-20 18:16:54 +01:00
parent 68a45d1fab
commit e8873c191e
5 changed files with 18 additions and 14 deletions

View file

@ -89,7 +89,7 @@
<Launcher Include="$(SolutionDir)Launcher\$(OutDir)Launcher.exe" />
<Dlls Include="$(SolutionDir)IllusionInjector\$(OutDir)**\*" />
</ItemGroup>
<Copy SourceFiles="@(Dlls)" DestinationFolder="$(OutputPath)IPA\Managed" />
<Copy SourceFiles="@(Dlls)" DestinationFolder="$(OutputPath)IPA\Data\Managed" />
<Copy SourceFiles="@(Launcher)" DestinationFolder="$(OutputPath)IPA" />
</Target>
</Project>

View file

@ -17,26 +17,27 @@ namespace IPA
}
string launcherSrc = Path.Combine("IPA", "Launcher.exe");
string managedFolder = Path.Combine("IPA", "Managed");
string dataSrcPath = Path.Combine("IPA", "Data");
string pluginsFolder = "Plugins";
string projectName = Path.GetFileNameWithoutExtension(args[0]);
string dataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(args[0]), projectName + "_Data"), "Managed");
string engineFile = Path.Combine(dataPath, "UnityEngine.dll");
string assemblyFile = Path.Combine(dataPath, "Assembly-Csharp.dll");
string dataDstPath = Path.Combine(Path.GetDirectoryName(args[0]), projectName + "_Data");
string managedPath = Path.Combine(dataDstPath, "Managed");
string engineFile = Path.Combine(managedPath, "UnityEngine.dll");
string assemblyFile = Path.Combine(managedPath, "Assembly-Csharp.dll");
// Sanitizing
if (!File.Exists(launcherSrc)) Fail("Couldn't find DLLs! Make sure you extracted all contents of the release archive.");
if(!Directory.Exists(dataPath) || !File.Exists(engineFile) || !File.Exists(assemblyFile))
if(!Directory.Exists(dataDstPath) || !File.Exists(engineFile) || !File.Exists(assemblyFile))
{
Fail("Game does not seem to be a Unity project. Could not find the libraries to patch.");
Fail("Game does not seem to be a Unity project. Could not find the libraries to patch. ");
}
try
{
// Copying
Console.Write("Updating files... ");
CopyAll(new DirectoryInfo(managedFolder), new DirectoryInfo(dataPath));
CopyAll(new DirectoryInfo(dataSrcPath), new DirectoryInfo(dataDstPath));
Console.WriteLine("Successfully updated files!");
if (!Directory.Exists(pluginsFolder))

View file

@ -10,6 +10,14 @@ namespace IllusionInjector
{
public event Action Destroyed = delegate {};
void Awake()
{
if (Environment.CommandLine.Contains("--verbose") && !Screen.fullScreen)
{
Windows.GuiConsole.CreateConsole();
}
}
void Start()
{
Destroy(gameObject);

View file

@ -1,4 +1,5 @@
using System;
using System.IO;
using UnityEngine;
namespace IllusionInjector
@ -11,7 +12,6 @@ namespace IllusionInjector
if (!injected)
{
injected = true;
var bootstrapper = new GameObject("Bootstrapper").AddComponent<Bootstrapper>();
bootstrapper.Destroyed += Bootstrapper_Destroyed;
}

View file

@ -14,11 +14,6 @@ namespace IllusionInjector
{
DontDestroyOnLoad(gameObject);
if (Environment.CommandLine.Contains("--verbose") && !Screen.fullScreen)
{
Windows.GuiConsole.CreateConsole();
}
plugins = new CompositePlugin(PluginManager.Plugins);
plugins.OnApplicationStart();
}