fix: bootstrapper dry run fix
This commit is contained in:
parent
c82a34f9a4
commit
fe816fd2b6
|
|
@ -31,9 +31,17 @@ public class MainWindow : Form
|
||||||
Buttons = { CloseButton }
|
Buttons = { CloseButton }
|
||||||
};
|
};
|
||||||
|
|
||||||
Page.Created += (s, e) =>
|
Page.Created += (_, _) =>
|
||||||
{
|
{
|
||||||
Bootstrapper.Run();
|
if (Bootstrapper.Initialize())
|
||||||
|
Bootstrapper.Run();
|
||||||
|
};
|
||||||
|
|
||||||
|
// This is a small hack to ensure that the underlying Form that MainWindow has
|
||||||
|
// doesn't open when the TaskDialogPage is destroyed.
|
||||||
|
Page.Destroyed += (_, _) =>
|
||||||
|
{
|
||||||
|
Environment.Exit(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
ShowTaskDialog();
|
ShowTaskDialog();
|
||||||
|
|
@ -75,8 +83,8 @@ public class MainWindow : Form
|
||||||
|
|
||||||
private void Bootstrapper_Errored(object? sender, string[] texts)
|
private void Bootstrapper_Errored(object? sender, string[] texts)
|
||||||
{
|
{
|
||||||
Page.Icon = TaskDialogIcon.Error;
|
|
||||||
Page.Heading = texts[0];
|
Page.Heading = texts[0];
|
||||||
Page.Text = texts[1];
|
Page.Text = texts[1];
|
||||||
|
Page.ProgressBar!.State = TaskDialogProgressBarState.Error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,18 +1,15 @@
|
||||||
using System.Runtime.InteropServices;
|
namespace Kiseki.Launcher.Windows;
|
||||||
|
|
||||||
namespace Kiseki.Launcher.Windows
|
public static class Win32
|
||||||
{
|
{
|
||||||
public static class Win32
|
// Ref: https://learn.microsoft.com/en-us/windows/win32/msi/error-codes
|
||||||
|
// Ref: https://i-logic.com/serial/errorcodes.htm
|
||||||
|
public enum ErrorCode
|
||||||
{
|
{
|
||||||
// Ref: https://learn.microsoft.com/en-us/windows/win32/msi/error-codes
|
ERROR_SUCCESS = 0,
|
||||||
// Ref: https://i-logic.com/serial/errorcodes.htm
|
ERROR_INSTALL_USEREXIT = 1602,
|
||||||
public enum ErrorCode
|
ERROR_INSTALL_FAILURE = 1603,
|
||||||
{
|
ERROR_CANCELLED = 1223,
|
||||||
ERROR_SUCCESS = 0,
|
ERROR_INTERNAL_ERROR = 1359
|
||||||
ERROR_INSTALL_USEREXIT = 1602,
|
|
||||||
ERROR_INSTALL_FAILURE = 1603,
|
|
||||||
ERROR_CANCELLED = 1223,
|
|
||||||
ERROR_INTERNAL_ERROR = 1359
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue