Skip to content

Commit d26be95

Browse files
committed
improvements to integrity message box
1 parent 5ab7970 commit d26be95

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/UniGetUI/CrashHandler.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace UniGetUI;
77
public static class CrashHandler
88
{
99
private const uint MB_ICONSTOP = 0x00000010;
10+
private const uint MB_OKCANCEL = 0x00000001;
11+
private const int IDCANCEL = 2;
1012

1113
[System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
1214
private static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, uint uType);
@@ -17,12 +19,11 @@ private static bool _reportMissingFiles()
1719
{
1820
var errorMessage = "UniGetUI has detected that some required files are missing."
1921
+ "\n\nThis might be caused by an incomplete installation or corrupted files. Please reinstall UniGetUI."
20-
+ "\n\nRun UniGetUI with the parameter '--no-corrupt-dialog' to get more details about the crash.";
22+
+ "\n\nPress CANCEL to get more details about the crash.";
2123

2224
var title = "UniGetUI - Missing Files";
2325

24-
MessageBox(IntPtr.Zero, errorMessage, title, MB_ICONSTOP);
25-
return true;
26+
return MessageBox(IntPtr.Zero, errorMessage, title, MB_ICONSTOP | MB_OKCANCEL) is not IDCANCEL;
2627
}
2728
catch
2829
{
@@ -41,7 +42,7 @@ public static void ReportFatalException(Exception e)
4142
while (fileEx is not null)
4243
{
4344
if (fileEx.ToString().Contains("Could not load file or assembly")
44-
|| (uint)fileEx.HResult is 0x80070002)
45+
|| (uint)fileEx.HResult is 0x80070002 or 0x80004005)
4546
{
4647
if (_reportMissingFiles())
4748
{

0 commit comments

Comments
 (0)