diff --git a/Injector/Injector.csproj b/Injector/Injector.csproj
index 3ddce1f..9aa06f5 100644
--- a/Injector/Injector.csproj
+++ b/Injector/Injector.csproj
@@ -73,12 +73,14 @@
{5c2d3832-ddcb-4c1d-855c-5510625db149}
Loader
+ False
- start cmd.exe /C ""$(ReferencePath)\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt""
+ copy ..\..\..\..\Loader\bin\x64\Release\LoadARMS.dll LoadARMS.dll
+ start cmd.exe /C ""$(ReferencePath)\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt""
diff --git a/Injector/Properties/VersionInfo.cs b/Injector/Properties/VersionInfo.cs
index 5969d70..578f21f 100644
--- a/Injector/Properties/VersionInfo.cs
+++ b/Injector/Properties/VersionInfo.cs
@@ -12,4 +12,4 @@
// 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("0.5.1.0")]
+[assembly: AssemblyVersion("0.5.2.0")]
diff --git a/Loader/LoadArms.cs b/Loader/LoadArms.cs
index 9d47e2b..7a08eeb 100644
--- a/Loader/LoadArms.cs
+++ b/Loader/LoadArms.cs
@@ -10,7 +10,9 @@
using System.Xml;
using RGiesecke.DllExport;
using Sandbox;
+using Sandbox.Game.World;
using Sandbox.Graphics.GUI;
+using VRage.Game.Components;
using VRage.Plugins;
namespace Rynchodon.Loader
@@ -82,8 +84,7 @@ public static void RunInSEProcess()
{
if (_instance != null)
return;
- LoadArms instance = new LoadArms();
- MySandboxGame.Static.Invoke(() => instance.Init(MySandboxGame.Static));
+ MySandboxGame.Static.Invoke(() => typeof(MyPlugins).GetMethod("LoadPlugins", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, new object[] { Assembly.GetExecutingAssembly() }));
return;
}
Thread.Sleep(1);
@@ -157,7 +158,7 @@ private struct Data
private ParallelTasks.Task _task;
private DownloadProgress.Stats _downProgress = new DownloadProgress.Stats();
private List _plugins;
- private bool _startedRobocopy;
+ private bool _initialized, _startedRobocopy;
///
/// Creates an instance of LoadArms and starts the updating process.
@@ -239,6 +240,7 @@ public void Init(object gameInstance)
{
if (_instance != this)
return;
+ _initialized = true;
if (!_task.IsComplete)
MyGuiSandbox.AddScreen(new DownloadProgress(_task, _downProgress));
@@ -251,6 +253,8 @@ void IPlugin.Update()
{
if (_instance != this)
return;
+ if (!_initialized)
+ Init(MySandboxGame.Static);
if (_plugins != null)
{
diff --git a/Publish.bat b/Publish.bat
index 107c623..41024b6 100644
--- a/Publish.bat
+++ b/Publish.bat
@@ -1,2 +1,3 @@
cd Injector\bin\x64\Release
-"C:\Games\Steam\SteamApps\common\SpaceEngineers\Bin64\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds --publish LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt"
\ No newline at end of file
+"C:\Games\Steam\SteamApps\common\SpaceEngineers\Bin64\LoadArms.exe" --author=Rynchodon --repo=Load-ARMS --allBuilds --publish LoadARMS.exe LoadArms.dll "..\..\..\..\Load-ARMS Readme.txt" "..\..\..\..\Load-ARMS License.txt"
+timeout 60