Add error message box in Injector

This commit is contained in:
goat 2019-11-23 14:22:05 +09:00
parent 4777bbd525
commit 5df18f8f30
2 changed files with 11 additions and 5 deletions

View file

@ -14,10 +14,10 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="Feature"> <PropertyGroup Label="Feature">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyVersion>4.1.0.3</AssemblyVersion> <AssemblyVersion>4.1.0.6</AssemblyVersion>
<FileVersion>4.1.0.3</FileVersion> <FileVersion>4.1.0.6</FileVersion>
<Description>XIVLauncher addon injection</Description> <Description>XIVLauncher addon injection</Description>
<Version>4.1.0.3</Version> <Version>4.1.0.6</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile></DocumentationFile> <DocumentationFile></DocumentationFile>
@ -29,4 +29,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dalamud\Dalamud.csproj" /> <ProjectReference Include="..\Dalamud\Dalamud.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project> </Project>

View file

@ -4,6 +4,7 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms;
using Dalamud.DiscordBot; using Dalamud.DiscordBot;
using Dalamud.Game.Chat; using Dalamud.Game.Chat;
using EasyHook; using EasyHook;
@ -15,8 +16,10 @@ namespace Dalamud.Injector {
AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs) AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs)
{ {
File.WriteAllText("InjectorException.txt", eventArgs.ExceptionObject.ToString()); File.WriteAllText("InjectorException.txt", eventArgs.ExceptionObject.ToString());
Process.GetCurrentProcess().Kill(); MessageBox.Show("Failed to inject the XIVLauncher in-game addon. Please report this error:\n\n" + eventArgs.ExceptionObject, "XIVLauncher Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0);
}; };
var pid = int.Parse(args[0]); var pid = int.Parse(args[0]);