This commit is contained in:
Taskeren 2024-04-19 02:14:23 +08:00
parent 22af356016
commit fd4137176c
No known key found for this signature in database
GPG Key ID: BC3749B9DFBE1F00
17 changed files with 67 additions and 5 deletions

View File

@ -12,9 +12,9 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<SignAssembly>true</SignAssembly>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>sign_key.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
<PublicSign>false</PublicSign>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -39,8 +39,8 @@
<Reference Include="CoreLibNet, Version=5.0.8614.32711, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NetLimiter.5.2.10\lib\net462\CoreLibNet.dll</HintPath>
</Reference>
<Reference Include="Gma.System.MouseKeyHook, Version=5.6.130.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MouseKeyHook.5.6.0\lib\net40\Gma.System.MouseKeyHook.dll</HintPath>
<Reference Include="Gma.System.MouseKeyHook, Version=5.7.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MouseKeyHook.5.7.1\lib\net472\Gma.System.MouseKeyHook.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>

View File

@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using FinalSolution.Properties;
namespace FinalSolution
{
@ -16,6 +18,22 @@ namespace FinalSolution
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += (sender, args) =>
{
var ex = args.Exception;
var dt = DateTime.Now;
var fileName = $"crash-report_{dt.Day}_{dt.Month}_{dt.Year}-{dt.Hour}_{dt.Minute}_{dt.Second}.txt";
using (var writer = new StreamWriter(fileName, true))
{
writer.WriteLine("##############" + dt + "##############");
writer.WriteLine("An exception occurred while running Final Solution");
writer.WriteLine(ex);
}
MessageBox.Show(string.Format(Resources.Program_Main_Crash_Dialog, fileName));
};
Application.Run(new MainForm());
}
}

View File

@ -111,5 +111,14 @@ namespace FinalSolution.Properties {
return ResourceManager.GetString("Config_ReadConfig_Go_To_Read_README", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unexpected error occurred while you using Final Solution! A debug information is generated to {0}.
/// </summary>
internal static string Program_Main_Crash_Dialog {
get {
return ResourceManager.GetString("Program_Main_Crash_Dialog", resourceCulture);
}
}
}
}

View File

@ -137,4 +137,7 @@ Finally, Final Solution is closed-sourced but free-to-use. If you bought it from
<data name="Config_ReadConfig_Awareness_Title" xml:space="preserve">
<value>NOT SO FAST!</value>
</data>
<data name="Program_Main_Crash_Dialog" xml:space="preserve">
<value>Unexpected error occurred while you using Final Solution! A debug information is generated to {0}</value>
</data>
</root>

View File

@ -34,4 +34,7 @@
<data name="Config_ReadConfig_Awareness_Title" xml:space="preserve">
<value>慢一些!</value>
</data>
<data name="Program_Main_Crash_Dialog" xml:space="preserve">
<value>执行最终解决方案时发生了未知错误,崩溃信息存储在{0}。</value>
</data>
</root>

View File

@ -0,0 +1,29 @@
# This script is used to create a release package.
# Usage:
# $env:VERSION=<the_version_number> ; .\make-release-package.ps1
#
# So that a release package named VERSION.zip will be created.
#
# go to the release folder and create a output.zip
Set-Location .\bin\Release
zip output -r .
# go back to the root
Set-Location ..\..\
# delete the old output.zip if exists
if (Test-Path output.zip) {
Remove-Item output.zip
}
# move the new output.zip to the root
Move-Item .\bin\Release\output.zip .
# rename to $VERSION.zip if version is specified
if ($null -eq $env:VERSION) {
Write-Output "Version is not specified."
}
else {
# delete the old $VERSION.zip if exists
if(Test-Path "$env:VERSION.zip") {
Remove-Item "$env:VERSION.zip"
}
Move-Item output.zip "$env:VERSION.zip"
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Extensions.Logging.Abstractions" version="5.0.0" targetFramework="net472" />
<package id="MouseKeyHook" version="5.6.0" targetFramework="net472" />
<package id="MouseKeyHook" version="5.7.1" targetFramework="net472" />
<package id="NetLimiter" version="5.2.10" targetFramework="net472" />
</packages>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB