diff --git a/FinalSolution/FinalSolution.csproj b/FinalSolution/FinalSolution.csproj index a7e7e3d..083d391 100644 --- a/FinalSolution/FinalSolution.csproj +++ b/FinalSolution/FinalSolution.csproj @@ -12,9 +12,9 @@ 512 true true - true + false sign_key.snk - true + false AnyCPU @@ -39,8 +39,8 @@ ..\packages\NetLimiter.5.2.10\lib\net462\CoreLibNet.dll - - ..\packages\MouseKeyHook.5.6.0\lib\net40\Gma.System.MouseKeyHook.dll + + ..\packages\MouseKeyHook.5.7.1\lib\net472\Gma.System.MouseKeyHook.dll ..\packages\Microsoft.Extensions.Logging.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll diff --git a/FinalSolution/Program.cs b/FinalSolution/Program.cs index 4545f9d..1f25fb5 100644 --- a/FinalSolution/Program.cs +++ b/FinalSolution/Program.cs @@ -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()); } } diff --git a/FinalSolution/Properties/Resources.Designer.cs b/FinalSolution/Properties/Resources.Designer.cs index 4868c28..997a591 100644 --- a/FinalSolution/Properties/Resources.Designer.cs +++ b/FinalSolution/Properties/Resources.Designer.cs @@ -111,5 +111,14 @@ namespace FinalSolution.Properties { return ResourceManager.GetString("Config_ReadConfig_Go_To_Read_README", resourceCulture); } } + + /// + /// Looks up a localized string similar to Unexpected error occurred while you using Final Solution! A debug information is generated to {0}. + /// + internal static string Program_Main_Crash_Dialog { + get { + return ResourceManager.GetString("Program_Main_Crash_Dialog", resourceCulture); + } + } } } diff --git a/FinalSolution/Properties/Resources.resx b/FinalSolution/Properties/Resources.resx index 80dd6dc..821bb35 100644 --- a/FinalSolution/Properties/Resources.resx +++ b/FinalSolution/Properties/Resources.resx @@ -137,4 +137,7 @@ Finally, Final Solution is closed-sourced but free-to-use. If you bought it from NOT SO FAST! + + Unexpected error occurred while you using Final Solution! A debug information is generated to {0} + \ No newline at end of file diff --git a/FinalSolution/Properties/Resources.zh-hans.resx b/FinalSolution/Properties/Resources.zh-hans.resx index 7c9678f..0b25187 100644 --- a/FinalSolution/Properties/Resources.zh-hans.resx +++ b/FinalSolution/Properties/Resources.zh-hans.resx @@ -34,4 +34,7 @@ 慢一些! + + 执行最终解决方案时发生了未知错误,崩溃信息存储在{0}。 + \ No newline at end of file diff --git a/FinalSolution/make-release-package.ps1 b/FinalSolution/make-release-package.ps1 new file mode 100644 index 0000000..031c1d4 --- /dev/null +++ b/FinalSolution/make-release-package.ps1 @@ -0,0 +1,29 @@ +# This script is used to create a release package. +# Usage: +# $env:VERSION= ; .\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" +} diff --git a/FinalSolution/packages.config b/FinalSolution/packages.config index 3e88bf0..bb71efd 100644 --- a/FinalSolution/packages.config +++ b/FinalSolution/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/packages/MouseKeyHook.5.6.0/.signature.p7s b/packages/MouseKeyHook.5.6.0/.signature.p7s deleted file mode 100644 index b478a94..0000000 Binary files a/packages/MouseKeyHook.5.6.0/.signature.p7s and /dev/null differ diff --git a/packages/MouseKeyHook.5.6.0/MouseKeyHook.5.6.0.nupkg b/packages/MouseKeyHook.5.6.0/MouseKeyHook.5.6.0.nupkg deleted file mode 100644 index 62e6a2b..0000000 Binary files a/packages/MouseKeyHook.5.6.0/MouseKeyHook.5.6.0.nupkg and /dev/null differ diff --git a/packages/MouseKeyHook.5.6.0/lib/net40/Gma.System.MouseKeyHook.dll b/packages/MouseKeyHook.5.6.0/lib/net40/Gma.System.MouseKeyHook.dll deleted file mode 100644 index bf0ea0b..0000000 Binary files a/packages/MouseKeyHook.5.6.0/lib/net40/Gma.System.MouseKeyHook.dll and /dev/null differ diff --git a/packages/MouseKeyHook.5.7.1/.signature.p7s b/packages/MouseKeyHook.5.7.1/.signature.p7s new file mode 100644 index 0000000..57cf2ee Binary files /dev/null and b/packages/MouseKeyHook.5.7.1/.signature.p7s differ diff --git a/packages/MouseKeyHook.5.7.1/MouseKeyHook.5.7.1.nupkg b/packages/MouseKeyHook.5.7.1/MouseKeyHook.5.7.1.nupkg new file mode 100644 index 0000000..d37f524 Binary files /dev/null and b/packages/MouseKeyHook.5.7.1/MouseKeyHook.5.7.1.nupkg differ diff --git a/packages/MouseKeyHook.5.7.1/lib/net472/Gma.System.MouseKeyHook.dll b/packages/MouseKeyHook.5.7.1/lib/net472/Gma.System.MouseKeyHook.dll new file mode 100644 index 0000000..0c66467 Binary files /dev/null and b/packages/MouseKeyHook.5.7.1/lib/net472/Gma.System.MouseKeyHook.dll differ diff --git a/packages/MouseKeyHook.5.7.1/lib/net48/Gma.System.MouseKeyHook.dll b/packages/MouseKeyHook.5.7.1/lib/net48/Gma.System.MouseKeyHook.dll new file mode 100644 index 0000000..eb509d3 Binary files /dev/null and b/packages/MouseKeyHook.5.7.1/lib/net48/Gma.System.MouseKeyHook.dll differ diff --git a/packages/MouseKeyHook.5.7.1/lib/net6.0-windows7.0/Gma.System.MouseKeyHook.dll b/packages/MouseKeyHook.5.7.1/lib/net6.0-windows7.0/Gma.System.MouseKeyHook.dll new file mode 100644 index 0000000..e16766c Binary files /dev/null and b/packages/MouseKeyHook.5.7.1/lib/net6.0-windows7.0/Gma.System.MouseKeyHook.dll differ diff --git a/packages/MouseKeyHook.5.7.1/lib/net7.0-windows7.0/Gma.System.MouseKeyHook.dll b/packages/MouseKeyHook.5.7.1/lib/net7.0-windows7.0/Gma.System.MouseKeyHook.dll new file mode 100644 index 0000000..8fdfa5f Binary files /dev/null and b/packages/MouseKeyHook.5.7.1/lib/net7.0-windows7.0/Gma.System.MouseKeyHook.dll differ diff --git a/packages/MouseKeyHook.5.7.1/mouse-keyboard-hook-logo64x64.png b/packages/MouseKeyHook.5.7.1/mouse-keyboard-hook-logo64x64.png new file mode 100644 index 0000000..88b1cd7 Binary files /dev/null and b/packages/MouseKeyHook.5.7.1/mouse-keyboard-hook-logo64x64.png differ