2020-09-22 11:01:56 -05:00
|
|
|
using WixSharp;
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
namespace Symphony
|
|
|
|
{
|
|
|
|
public partial class CloseDlg : WixSharp.UI.Forms.ManagedForm, IManagedDialog
|
|
|
|
{
|
2020-10-16 06:22:30 -05:00
|
|
|
const int WelcomeDlgIndex = 0;
|
|
|
|
const int InstallDirIndex = 1;
|
2020-09-22 11:01:56 -05:00
|
|
|
|
|
|
|
public CloseDlg()
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
|
|
|
|
void dialog_Load(object sender, System.EventArgs e)
|
|
|
|
{
|
|
|
|
// Detect if Symphony is running
|
|
|
|
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 0;
|
|
|
|
if (isRunning)
|
|
|
|
{
|
|
|
|
// If it is running, disable the "next" button
|
|
|
|
this.next.Enabled = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Populate the dynamic UI elements that can't be set at compile time (background image and
|
|
|
|
// the enabled/disabled state of the `Close Symphony` button)
|
|
|
|
this.backgroundPanel.BackgroundImage = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Dialog");
|
|
|
|
}
|
|
|
|
|
|
|
|
void closeButton_Click(object sender, System.EventArgs e)
|
|
|
|
{
|
|
|
|
// The "Close Symphony" button is just to get users consent to close the app.
|
|
|
|
// Actually closing the app will be done later in the flow.
|
2020-10-16 06:22:30 -05:00
|
|
|
Shell.GoTo(InstallDirIndex);
|
2020-09-22 11:01:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void back_Click(object sender, System.EventArgs e)
|
|
|
|
{
|
2020-10-16 06:22:30 -05:00
|
|
|
Shell.GoTo(WelcomeDlgIndex);
|
2020-09-22 11:01:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void next_Click(object sender, System.EventArgs e)
|
|
|
|
{
|
2020-10-16 06:22:30 -05:00
|
|
|
Shell.GoTo(InstallDirIndex);
|
2020-09-22 11:01:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void cancel_Click(object sender, System.EventArgs e)
|
|
|
|
{
|
2020-10-26 02:46:07 -05:00
|
|
|
if( System.Windows.Forms.MessageBox.Show("Are you sure you want to cancel Symphony installation?",
|
|
|
|
"Symphony Setup", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes )
|
|
|
|
{
|
|
|
|
Shell.Cancel();
|
|
|
|
}
|
2020-09-22 11:01:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|