Merge pull request #1102 from mattias-symphony/SDA-2593

feat: SDA-2593: new design for a simplified installer flow
This commit is contained in:
mattias-symphony 2020-11-02 14:10:47 +01:00 committed by GitHub
commit a30df2d969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 640 additions and 290 deletions

View File

@ -3,12 +3,9 @@ using System.Drawing;
namespace Symphony
{
public partial class CloseDlg : WixSharp.UI.Forms.ManagedForm, IManagedDialog
public partial class CloseDialog : WixSharp.UI.Forms.ManagedForm, IManagedDialog
{
const int WelcomeDlgIndex = 0;
const int InstallDirIndex = 1;
public CloseDlg()
public CloseDialog()
{
InitializeComponent();
}
@ -16,7 +13,7 @@ namespace Symphony
void dialog_Load(object sender, System.EventArgs e)
{
// Detect if Symphony is running
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 0;
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
if (isRunning)
{
// If it is running, disable the "next" button
@ -32,22 +29,22 @@ namespace Symphony
{
// 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.
Shell.GoTo(InstallDirIndex);
}
void back_Click(object sender, System.EventArgs e)
{
Shell.GoTo(WelcomeDlgIndex);
Shell.GoNext();
}
void next_Click(object sender, System.EventArgs e)
{
Shell.GoTo(InstallDirIndex);
Shell.GoNext();
}
void cancel_Click(object sender, System.EventArgs e)
{
Shell.Cancel();
// TODO: Localization
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();
}
}
}

View File

@ -1,7 +1,7 @@
// This file is created and modified from the visual form designer in Visual Studio, so shouldn't need to be modified by hand
namespace Symphony
{
partial class CloseDlg
partial class CloseDialog
{
/// <summary>
/// Required designer variable.
@ -31,7 +31,6 @@ namespace Symphony
{
this.bottomPanel = new System.Windows.Forms.Panel();
this.tableLayoutbackgroundPanel = new System.Windows.Forms.TableLayoutPanel();
this.back = new System.Windows.Forms.Button();
this.next = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button();
this.backgroundPanel = new System.Windows.Forms.Panel();
@ -64,7 +63,6 @@ namespace Symphony
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 14F));
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutbackgroundPanel.Controls.Add(this.back, 1, 0);
this.tableLayoutbackgroundPanel.Controls.Add(this.next, 2, 0);
this.tableLayoutbackgroundPanel.Controls.Add(this.cancel, 4, 0);
this.tableLayoutbackgroundPanel.Location = new System.Drawing.Point(0, 3);
@ -74,19 +72,6 @@ namespace Symphony
this.tableLayoutbackgroundPanel.Size = new System.Drawing.Size(491, 43);
this.tableLayoutbackgroundPanel.TabIndex = 7;
//
// back
//
this.back.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.back.AutoSize = true;
this.back.Location = new System.Drawing.Point(208, 10);
this.back.MinimumSize = new System.Drawing.Size(75, 0);
this.back.Name = "back";
this.back.Size = new System.Drawing.Size(77, 23);
this.back.TabIndex = 0;
this.back.Text = "[WixUIBack]";
this.back.UseVisualStyleBackColor = true;
this.back.Click += new System.EventHandler(this.back_Click);
//
// next
//
this.next.Anchor = System.Windows.Forms.AnchorStyles.Right;
@ -157,12 +142,13 @@ namespace Symphony
this.closeButton.UseVisualStyleBackColor = true;
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
//
// CloseDlg
// CloseDialog
//
this.ControlBox = false;
this.ClientSize = new System.Drawing.Size(494, 361);
this.Controls.Add(this.backgroundPanel);
this.Controls.Add(this.bottomPanel);
this.Name = "CloseDlg";
this.Name = "CloseDialog";
this.Text = "Symphony Setup";
this.Load += new System.EventHandler(this.dialog_Load);
this.bottomPanel.ResumeLayout(false);
@ -177,7 +163,6 @@ namespace Symphony
#endregion
private System.Windows.Forms.Panel bottomPanel;
private System.Windows.Forms.TableLayoutPanel tableLayoutbackgroundPanel;
private System.Windows.Forms.Button back;
private System.Windows.Forms.Button next;
private System.Windows.Forms.Button cancel;
private System.Windows.Forms.Panel backgroundPanel;

View File

@ -2,14 +2,14 @@ using WixSharp;
namespace Symphony
{
public partial class ExitDlg : WixSharp.UI.Forms.ManagedForm, IManagedDialog
public partial class ExitDialog : WixSharp.UI.Forms.ManagedForm, IManagedDialog
{
public ExitDlg()
public ExitDialog()
{
InitializeComponent();
}
private void ExitDlg_Load(object sender, System.EventArgs e)
private void ExitDialog_Load(object sender, System.EventArgs e)
{
// Exit installation on completion (don't wait for user to confirm)
// After installation exits, the app will be auto launched, but that is specified in Symphony.cs

View File

@ -1,7 +1,7 @@
// This file is created and modified from the visual form designer in Visual Studio, so shouldn't need to be modified by hand
namespace Symphony
{
partial class ExitDlg
partial class ExitDialog
{
/// <summary>
/// Required designer variable.
@ -30,10 +30,10 @@ namespace Symphony
private void InitializeComponent()
{
//
// ExitDlg
// ExitDialog
//
this.Name = "ExitDlg";
this.Load += new System.EventHandler(this.ExitDlg_Load);
this.Name = "ExitDialog";
this.Load += new System.EventHandler(this.ExitDialog_Load);
}

View File

@ -0,0 +1,29 @@
using WixSharp;
namespace Symphony
{
public partial class MaintenanceDialog : WixSharp.UI.Forms.ManagedForm, IManagedDialog
{
public MaintenanceDialog()
{
InitializeComponent();
}
private void MaintenanceDialog_Shown(object sender, System.EventArgs e)
{
// Detect if Symphony is running
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
if (isRunning)
{
// If it is running, continue to the "Close Symphony" screen
Shell.GoNext();
}
else
{
// If it is not running, proceed to progress dialog
Shell.GoTo<Symphony.ProgressDialog>();
}
}
}
}

View File

@ -0,0 +1,41 @@
// This file is created and modified from the visual form designer in Visual Studio, so shouldn't need to be modified by hand
namespace Symphony
{
partial class MaintenanceDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// MaintenanceDialog
//
this.Name = "MaintenanceDialog";
this.Shown += new System.EventHandler(this.MaintenanceDialog_Shown);
}
#endregion
}
}

View File

@ -1,29 +0,0 @@
using WixSharp;
using System.Drawing;
namespace Symphony
{
public partial class MaintenanceDlg : WixSharp.UI.Forms.ManagedForm, IManagedDialog
{
public MaintenanceDlg()
{
InitializeComponent();
}
void dialog_Load(object sender, System.EventArgs e)
{
// Populate the dynamic UI elements that can't be set at compile time (background image)
this.backgroundPanel.BackgroundImage = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Dialog");
}
void next_Click(object sender, System.EventArgs e)
{
Shell.GoNext();
}
void cancel_Click(object sender, System.EventArgs e)
{
Shell.Cancel();
}
}
}

View File

@ -1,157 +0,0 @@
// This file is created and modified from the visual form designer in Visual Studio, so shouldn't need to be modified by hand
namespace Symphony
{
partial class MaintenanceDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.bottomPanel = new System.Windows.Forms.Panel();
this.tableLayoutbackgroundPanel = new System.Windows.Forms.TableLayoutPanel();
this.next = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button();
this.backgroundPanel = new System.Windows.Forms.Panel();
this.labelBody = new System.Windows.Forms.Label();
this.labelHeader = new System.Windows.Forms.Label();
this.bottomPanel.SuspendLayout();
this.tableLayoutbackgroundPanel.SuspendLayout();
this.backgroundPanel.SuspendLayout();
this.SuspendLayout();
//
// bottomPanel
//
this.bottomPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.bottomPanel.BackColor = System.Drawing.SystemColors.Control;
this.bottomPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.bottomPanel.Controls.Add(this.tableLayoutbackgroundPanel);
this.bottomPanel.Location = new System.Drawing.Point(-3, 308);
this.bottomPanel.Name = "bottomPanel";
this.bottomPanel.Size = new System.Drawing.Size(503, 57);
this.bottomPanel.TabIndex = 9;
//
// tableLayoutbackgroundPanel
//
this.tableLayoutbackgroundPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutbackgroundPanel.ColumnCount = 5;
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 14F));
this.tableLayoutbackgroundPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutbackgroundPanel.Controls.Add(this.next, 2, 0);
this.tableLayoutbackgroundPanel.Controls.Add(this.cancel, 4, 0);
this.tableLayoutbackgroundPanel.Location = new System.Drawing.Point(0, 3);
this.tableLayoutbackgroundPanel.Name = "tableLayoutbackgroundPanel";
this.tableLayoutbackgroundPanel.RowCount = 1;
this.tableLayoutbackgroundPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutbackgroundPanel.Size = new System.Drawing.Size(491, 43);
this.tableLayoutbackgroundPanel.TabIndex = 7;
//
// next
//
this.next.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.next.AutoSize = true;
this.next.Location = new System.Drawing.Point(305, 10);
this.next.MinimumSize = new System.Drawing.Size(75, 0);
this.next.Name = "next";
this.next.Size = new System.Drawing.Size(77, 23);
this.next.TabIndex = 0;
this.next.Text = "[WixUINext]";
this.next.UseVisualStyleBackColor = true;
this.next.Click += new System.EventHandler(this.next_Click);
//
// cancel
//
this.cancel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.cancel.AutoSize = true;
this.cancel.Location = new System.Drawing.Point(402, 10);
this.cancel.MinimumSize = new System.Drawing.Size(75, 0);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(86, 23);
this.cancel.TabIndex = 0;
this.cancel.Text = "[WixUICancel]";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// backgroundPanel
//
this.backgroundPanel.BackColor = System.Drawing.Color.White;
this.backgroundPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.backgroundPanel.Controls.Add(this.labelBody);
this.backgroundPanel.Controls.Add(this.labelHeader);
this.backgroundPanel.Location = new System.Drawing.Point(-3, -1);
this.backgroundPanel.Name = "backgroundPanel";
this.backgroundPanel.Size = new System.Drawing.Size(502, 309);
this.backgroundPanel.TabIndex = 10;
//
// labelBody
//
this.labelBody.AutoSize = true;
this.labelBody.Location = new System.Drawing.Point(188, 71);
this.labelBody.Name = "labelBody";
this.labelBody.Size = new System.Drawing.Size(232, 52);
this.labelBody.TabIndex = 1;
this.labelBody.Text = "The Setup Wizard will allow you to change the way\r\nSymphony features are installed on your computer or even\r\nto remove Symphony from your computer. Click \"Next\" to\r\ncontinue or \"Cancel\" to exit the Setup Wizard.";
//
// labelHeader
//
this.labelHeader.AutoSize = true;
this.labelHeader.Font = new System.Drawing.Font("Verdana", 12.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelHeader.Location = new System.Drawing.Point(187, 20);
this.labelHeader.MaximumSize = new System.Drawing.Size(500, 0);
this.labelHeader.Name = "labelHeader";
this.labelHeader.Size = new System.Drawing.Size(246, 40);
this.labelHeader.TabIndex = 0;
this.labelHeader.Text = "Welcome to the Symphony\r\nSetup Wizard";
//
// MaintenanceDlg
//
this.ClientSize = new System.Drawing.Size(494, 361);
this.Controls.Add(this.backgroundPanel);
this.Controls.Add(this.bottomPanel);
this.Name = "MaintenanceDlg";
this.Text = "Symphony Setup";
this.Load += new System.EventHandler(this.dialog_Load);
this.bottomPanel.ResumeLayout(false);
this.tableLayoutbackgroundPanel.ResumeLayout(false);
this.tableLayoutbackgroundPanel.PerformLayout();
this.backgroundPanel.ResumeLayout(false);
this.backgroundPanel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel bottomPanel;
private System.Windows.Forms.TableLayoutPanel tableLayoutbackgroundPanel;
private System.Windows.Forms.Button next;
private System.Windows.Forms.Button cancel;
private System.Windows.Forms.Panel backgroundPanel;
private System.Windows.Forms.Label labelHeader;
private System.Windows.Forms.Label labelBody;
}
}

View File

@ -0,0 +1,261 @@
using WixSharp;
using WixSharp.UI.Forms;
namespace Symphony
{
partial class ProgressDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.topBorder = new System.Windows.Forms.Panel();
this.progress = new System.Windows.Forms.ProgressBar();
this.currentAction = new System.Windows.Forms.Label();
this.topPanel = new System.Windows.Forms.Panel();
this.dialogText = new System.Windows.Forms.Label();
this.banner = new System.Windows.Forms.PictureBox();
this.bottomPanel = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.next = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button();
this.bottomBorder = new System.Windows.Forms.Panel();
this.description = new System.Windows.Forms.Label();
this.currentActionLabel = new System.Windows.Forms.Label();
this.waitPrompt = new System.Windows.Forms.Label();
this.topPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.banner)).BeginInit();
this.bottomPanel.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// topBorder
//
this.topBorder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.topBorder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.topBorder.Location = new System.Drawing.Point(0, 58);
this.topBorder.Name = "topBorder";
this.topBorder.Size = new System.Drawing.Size(494, 1);
this.topBorder.TabIndex = 22;
//
// progress
//
this.progress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progress.Location = new System.Drawing.Point(32, 165);
this.progress.Name = "progress";
this.progress.Size = new System.Drawing.Size(434, 13);
this.progress.Step = 1;
this.progress.TabIndex = 20;
//
// currentAction
//
this.currentAction.AutoSize = true;
this.currentAction.Location = new System.Drawing.Point(34, 144);
this.currentAction.Name = "currentAction";
this.currentAction.Size = new System.Drawing.Size(0, 13);
this.currentAction.TabIndex = 19;
//
// topPanel
//
this.topPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.topPanel.BackColor = System.Drawing.SystemColors.Control;
this.topPanel.Controls.Add(this.dialogText);
this.topPanel.Controls.Add(this.banner);
this.topPanel.Location = new System.Drawing.Point(0, 0);
this.topPanel.Name = "topPanel";
this.topPanel.Size = new System.Drawing.Size(494, 58);
this.topPanel.TabIndex = 15;
//
// dialogText
//
this.dialogText.AutoSize = true;
this.dialogText.BackColor = System.Drawing.Color.Transparent;
this.dialogText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dialogText.Location = new System.Drawing.Point(11, 22);
this.dialogText.Name = "dialogText";
this.dialogText.Size = new System.Drawing.Size(159, 13);
this.dialogText.TabIndex = 1;
this.dialogText.Text = "[ProgressDlgTitleInstalling]";
//
// banner
//
this.banner.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.banner.BackColor = System.Drawing.Color.White;
this.banner.Location = new System.Drawing.Point(0, 0);
this.banner.Name = "banner";
this.banner.Size = new System.Drawing.Size(494, 58);
this.banner.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.banner.TabIndex = 0;
this.banner.TabStop = false;
//
// bottomPanel
//
this.bottomPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.bottomPanel.BackColor = System.Drawing.SystemColors.Control;
this.bottomPanel.Controls.Add(this.tableLayoutPanel1);
this.bottomPanel.Controls.Add(this.bottomBorder);
this.bottomPanel.Location = new System.Drawing.Point(0, 312);
this.bottomPanel.Name = "bottomPanel";
this.bottomPanel.Size = new System.Drawing.Size(494, 49);
this.bottomPanel.TabIndex = 14;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 5;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 14F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Controls.Add(this.next, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.cancel, 4, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(491, 43);
this.tableLayoutPanel1.TabIndex = 7;
//
// next
//
this.next.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.next.AutoSize = true;
this.next.Enabled = false;
this.next.Location = new System.Drawing.Point(305, 10);
this.next.MinimumSize = new System.Drawing.Size(75, 0);
this.next.Name = "next";
this.next.Size = new System.Drawing.Size(77, 23);
this.next.TabIndex = 0;
this.next.Text = "[WixUINext]";
this.next.UseVisualStyleBackColor = true;
//
// cancel
//
this.cancel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.cancel.AutoSize = true;
this.cancel.Location = new System.Drawing.Point(402, 10);
this.cancel.MinimumSize = new System.Drawing.Size(75, 0);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(86, 23);
this.cancel.TabIndex = 0;
this.cancel.Text = "[WixUICancel]";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// bottomBorder
//
this.bottomBorder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.bottomBorder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.bottomBorder.Location = new System.Drawing.Point(0, 0);
this.bottomBorder.Name = "bottomBorder";
this.bottomBorder.Size = new System.Drawing.Size(494, 1);
this.bottomBorder.TabIndex = 21;
//
// description
//
this.description.AutoSize = true;
this.description.BackColor = System.Drawing.Color.Transparent;
this.description.Location = new System.Drawing.Point(29, 95);
this.description.Name = "description";
this.description.Size = new System.Drawing.Size(132, 13);
this.description.TabIndex = 16;
this.description.Text = "[ProgressDlgTextInstalling]";
//
// currentActionLabel
//
this.currentActionLabel.BackColor = System.Drawing.Color.Transparent;
this.currentActionLabel.Location = new System.Drawing.Point(29, 144);
this.currentActionLabel.Name = "currentActionLabel";
this.currentActionLabel.Size = new System.Drawing.Size(132, 13);
this.currentActionLabel.TabIndex = 19;
this.currentActionLabel.Text = "[ProgressDlgStatusLabel]";
this.currentActionLabel.Visible = false;
//
// waitPrompt
//
this.waitPrompt.AutoSize = true;
this.waitPrompt.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.waitPrompt.ForeColor = System.Drawing.Color.Blue;
this.waitPrompt.Location = new System.Drawing.Point(85, 209);
this.waitPrompt.Name = "waitPrompt";
this.waitPrompt.Size = new System.Drawing.Size(265, 39);
this.waitPrompt.TabIndex = 23;
this.waitPrompt.TabStop = true;
this.waitPrompt.Text = "Please wait for UAC prompt to appear.\r\n\r\nIf it appears minimized then activate it" +
" from the taskbar.";
this.waitPrompt.Visible = false;
//
// ProgressDialog
//
this.ClientSize = new System.Drawing.Size(494, 361);
this.ControlBox = false;
this.Controls.Add(this.waitPrompt);
this.Controls.Add(this.topBorder);
this.Controls.Add(this.progress);
this.Controls.Add(this.currentAction);
this.Controls.Add(this.topPanel);
this.Controls.Add(this.bottomPanel);
this.Controls.Add(this.description);
this.Controls.Add(this.currentActionLabel);
this.Name = "ProgressDialog";
this.Text = "Symphony Setup";
this.Load += new System.EventHandler(this.ProgressDialog_Load);
this.topPanel.ResumeLayout(false);
this.topPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.banner)).EndInit();
this.bottomPanel.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox banner;
private System.Windows.Forms.Panel topPanel;
private System.Windows.Forms.Label dialogText;
private System.Windows.Forms.Panel bottomPanel;
private System.Windows.Forms.Label description;
private System.Windows.Forms.ProgressBar progress;
private System.Windows.Forms.Label currentAction;
private System.Windows.Forms.Label currentActionLabel;
private System.Windows.Forms.Panel bottomBorder;
private System.Windows.Forms.Panel topBorder;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button next;
private System.Windows.Forms.Button cancel;
private System.Windows.Forms.Label waitPrompt;
}
}

View File

@ -0,0 +1,219 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Security.Principal;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Deployment.WindowsInstaller;
using WixSharp.CommonTasks;
using WixSharp;
using WixSharp.UI.Forms;
namespace Symphony
{
/// <summary>
/// The standard Installation Progress dialog
/// </summary>
public partial class ProgressDialog : ManagedForm, IManagedDialog, IProgressDialog // change ManagedForm->Form if you want to show it in designer
{
private bool showingCancelConfirmation = false;
private bool complete = false;
/// <summary>
/// Initializes a new instance of the <see cref="ProgressDialog"/> class.
/// </summary>
public ProgressDialog()
{
InitializeComponent();
dialogText.MakeTransparentOn(banner);
}
void ProgressDialog_Load(object sender, EventArgs e)
{
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner");
if (!WindowsIdentity.GetCurrent().IsAdmin() && Uac.IsEnabled())
{
this.waitPrompt.Text = Runtime.Session.Property("UAC_WARNING");
this.waitPrompt.Visible = true;
}
ResetLayout();
Shell.StartExecute();
}
void ResetLayout()
{
// The form controls are properly anchored and will be correctly resized on parent form
// resizing. However the initial sizing by WinForm runtime doesn't a do good job with DPI
// other than 96. Thus manual resizing is the only reliable option apart from going WPF.
float ratio = (float)banner.Image.Width / (float)banner.Image.Height;
topPanel.Height = (int)(banner.Width / ratio);
topBorder.Top = topPanel.Height + 1;
var upShift = (int)(next.Height * 2.3) - bottomPanel.Height;
bottomPanel.Top -= upShift;
bottomPanel.Height += upShift;
var fontSize = waitPrompt.Font.Size;
float scaling = 1;
waitPrompt.Font = new Font(waitPrompt.Font.Name, fontSize * scaling, FontStyle.Regular);
}
/// <summary>
/// Called when Shell is changed. It is a good place to initialize the dialog to reflect the MSI session
/// (e.g. localize the view).
/// </summary>
protected override void OnShellChanged()
{
if (Runtime.Session.IsUninstalling())
{
dialogText.Text = "[ProgressDlgTitleRemoving]";
description.Text = "[ProgressDlgTextRemoving]";
}
else if (Runtime.Session.IsRepairing())
{
dialogText.Text = "[ProgressDlgTextRepairing]";
description.Text = "[ProgressDlgTitleRepairing]";
}
else if (Runtime.Session.IsInstalling())
{
dialogText.Text = "[ProgressDlgTitleInstalling]";
description.Text = "[ProgressDlgTextInstalling]";
}
this.Localize();
}
/// <summary>
/// Processes the message.
/// </summary>
/// <param name="messageType">Type of the message.</param>
/// <param name="messageRecord">The message record.</param>
/// <param name="buttons">The buttons.</param>
/// <param name="icon">The icon.</param>
/// <param name="defaultButton">The default button.</param>
/// <returns></returns>
public override MessageResult ProcessMessage(InstallMessage messageType, Record messageRecord, MessageButtons buttons, MessageIcon icon, MessageDefaultButton defaultButton)
{
switch (messageType)
{
case InstallMessage.InstallStart:
case InstallMessage.InstallEnd:
{
waitPrompt.Visible = false;
}
break;
case InstallMessage.ActionStart:
{
try
{
//messageRecord[0] - is reserved for FormatString value
string message = null;
bool simple = true;
if (simple)
{
/*
messageRecord[2] unconditionally contains the string to display
Examples:
messageRecord[0] "Action 23:14:50: [1]. [2]"
messageRecord[1] "InstallFiles"
messageRecord[2] "Copying new files"
messageRecord[3] "File: [1], Directory: [9], Size: [6]"
messageRecord[0] "Action 23:15:21: [1]. [2]"
messageRecord[1] "RegisterUser"
messageRecord[2] "Registering user"
messageRecord[3] "[1]"
*/
if (messageRecord.FieldCount >= 3)
{
message = messageRecord[2].ToString();
}
}
else
{
message = messageRecord.FormatString;
if (message.IsNotEmpty())
{
for (int i = 1; i < messageRecord.FieldCount; i++)
{
message = message.Replace("[" + i + "]", messageRecord[i].ToString());
}
}
else
{
message = messageRecord[messageRecord.FieldCount - 1].ToString();
}
}
if (message.IsNotEmpty())
currentAction.Text = currentActionLabel.Text + " " + message;
}
catch { }
}
break;
}
return MessageResult.OK;
}
/// <summary>
/// Called when MSI execution progress is changed.
/// </summary>
/// <param name="progressPercentage">The progress percentage.</param>
public override void OnProgress(int progressPercentage)
{
progress.Value = progressPercentage;
if (progressPercentage > 0)
{
waitPrompt.Visible = false;
}
}
/// <summary>
/// Called when MSI execution is complete.
/// </summary>
public override void OnExecuteComplete()
{
currentAction.Text = null;
if (showingCancelConfirmation)
{
complete = true;
}
else
{
Shell.GoNext();
}
}
/// <summary>
/// Handles the Click event of the cancel control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
void cancel_Click(object sender, EventArgs e)
{
showingCancelConfirmation = true;
// TODO: Localization
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();
}
else if (complete)
{
Shell.GoNext();
}
showingCancelConfirmation = false;
}
}
}

View File

@ -3,14 +3,16 @@
//css_ref System.Windows.Forms.dll;
//css_ref Wix_bin\SDK\Microsoft.Deployment.WindowsInstaller.dll;
//css_ref WixSharp.UI.dll;
//css_imp WelcomeDlg.cs;
//css_imp WelcomeDlg.designer.cs;
//css_imp CloseDlg.cs;
//css_imp CloseDlg.designer.cs;
//css_imp ExitDlg.cs;
//css_imp ExitDlg.designer.cs;
//css_imp MaintenanceDlg.cs;
//css_imp MaintenanceDlg.designer.cs;
//css_imp WelcomeDialog.cs;
//css_imp WelcomeDialog.designer.cs;
//css_imp CloseDialog.cs;
//css_imp CloseDialog.designer.cs;
//css_imp ProgressDialog.cs
//css_imp ProgressDialog.Designer.cs
//css_imp ExitDialog.cs;
//css_imp ExitDialog.designer.cs;
//css_imp MaintenanceDialog.cs;
//css_imp MaintenanceDialog.designer.cs;
using WixSharp;
using WixSharp.Forms;
@ -128,14 +130,21 @@ class Script
// side-by-side with the previous version, we would generate a new UpgradeCode for the new version onwards.
// More details can be found in this stackoverflow post:
// https://stackoverflow.com/a/26344742
project.GUID = System.Guid.NewGuid();
project.UpgradeCode = new System.Guid("{a9b448c9-f065-41a4-87c3-da527c6a389b}");
// Don't allow installation of earlier versions, but do allow installing the same version as is already installed.
project.MajorUpgrade = new MajorUpgrade();
project.MajorUpgrade.AllowDowngrades = false;
project.MajorUpgrade.AllowSameVersionUpgrades = true;
project.MajorUpgrade.DowngradeErrorMessage = "A more recent version of Symphony is already installed on this computer.";
project.GUID = new System.Guid("{4042AD1C-90E1-4032-B6B9-2BF6A4214096}");
project.ProductId = System.Guid.NewGuid();
project.UpgradeCode = new System.Guid("{36402281-8141-4797-8A90-07CFA75EFA55}");
// Allow any versions to be upgraded/downgraded freely
project.MajorUpgradeStrategy = MajorUpgradeStrategy.Default;
project.MajorUpgradeStrategy.RemoveExistingProductAfter = Step.InstallInitialize;
project.MajorUpgradeStrategy.UpgradeVersions.Minimum = "0.0.0";
project.MajorUpgradeStrategy.UpgradeVersions.Maximum = null; // No max version limit
project.MajorUpgradeStrategy.UpgradeVersions.IncludeMaximum = true;
project.MajorUpgradeStrategy.UpgradeVersions.IncludeMinimum = true;
project.MajorUpgradeStrategy.PreventDowngradingVersions.Minimum = "0.0.0";
project.MajorUpgradeStrategy.PreventDowngradingVersions.Maximum = "0.0.0";
project.MajorUpgradeStrategy.PreventDowngradingVersions.IncludeMaximum = true;
project.MajorUpgradeStrategy.PreventDowngradingVersions.IncludeMinimum = true;
// Declare all the custom properties we want to use, and assign them default values. It is possible to override
// these when running the installer, but if not specified, the defaults will be used.
@ -170,7 +179,7 @@ class Script
// whether it is a new version or the same version, but we don't want to display it if no reinstallation
// have been done. To detect this, we always write a new GUID to the fill InstallVariant.info on every
// installation.
new ElevatedManagedAction(CustomActions.InstallVariant, Return.check, When.After, Step.InstallFiles, Condition.NOT_Installed )
new ElevatedManagedAction(CustomActions.InstallVariant, Return.check, When.After, Step.InstallFiles, Condition.NOT_BeingRemoved )
{
// INSTALLDIR is a built-in property, and we need it to know which path to write the InstallVariant to
UsesProperties = "INSTALLDIR"
@ -181,7 +190,7 @@ class Script
// After installation, the Symphony.config file needs to be updated with values from the install properties,
// either their default values as specified above, or with the overridden value if an override was specified
// on the command line when the installer was started.
new ElevatedManagedAction(CustomActions.UpdateConfig, Return.check, When.After, Step.InstallFiles, Condition.NOT_Installed )
new ElevatedManagedAction(CustomActions.UpdateConfig, Return.check, When.After, Step.InstallFiles, Condition.NOT_BeingRemoved )
{
// The UpdateConfig action needs the built-in property INSTALLDIR as well as most of the custom properties
UsesProperties = "INSTALLDIR,POD_URL,MINIMIZE_ON_CLOSE,ALWAYS_ON_TOP,AUTO_START,BRING_TO_FRONT,MEDIA,LOCATION,NOTIFICATIONS,MIDI_SYSEX,POINTER_LOCK,FULL_SCREEN,OPEN_EXTERNAL,CUSTOM_TITLE_BAR,DEV_TOOLS_ENABLED,AUTO_LAUNCH_PATH"
@ -192,10 +201,10 @@ class Script
// We have some registry keys which are added by the SDA application when it is first launched. This custom
// action will clean up those keys on uninstall. The name/location of keys have changed between different
// versions of SDA, so we clean up all known variations, and ignore any missing ones.
new ElevatedManagedAction(CustomActions.CleanRegistry, Return.ignore, When.After, Step.RemoveFiles, Condition.Installed ),
new ElevatedManagedAction(CustomActions.CleanRegistry, Return.ignore, When.After, Step.RemoveFiles, Condition.BeingUninstalled ),
// Start Symphony after installation is complete
new InstalledFileAction("symphony_exe", "", Return.asyncNoWait, When.After, Step.InstallFinalize, Condition.NOT_Installed)
new InstalledFileAction(new Id("symphony_exe"), "", Return.asyncNoWait, When.After, Step.InstallFinalize, Condition.NOT_BeingRemoved)
};
// Use our own Symphony branded bitmap for installation dialogs
@ -204,18 +213,20 @@ class Script
// Define our own installation flow, using a mix of custom dialogs (defined in their own files) and built-in dialogs
project.ManagedUI = new ManagedUI();
project.ManagedUI.InstallDialogs.Add<Symphony.WelcomeDlg>()
.Add(Dialogs.InstallDir)
.Add(Dialogs.Progress)
.Add<Symphony.ExitDlg>()
.Add<Symphony.CloseDlg>();
project.ManagedUI.ModifyDialogs.Add<Symphony.MaintenanceDlg>()
.Add(Dialogs.MaintenanceType)
.Add(Dialogs.Progress)
.Add<Symphony.ExitDlg>();
project.ManagedUI.InstallDialogs.Add<Symphony.WelcomeDialog>()
.Add<Symphony.CloseDialog>()
.Add<Symphony.ProgressDialog>()
.Add<Symphony.ExitDialog>();
project.ManagedUI.ModifyDialogs.Add<Symphony.MaintenanceDialog>()
.Add<Symphony.CloseDialog>()
.Add<Symphony.ProgressDialog>()
.Add<Symphony.ExitDialog>();
project.Load += project_Load;
project.BeforeInstall += project_BeforeInstall;
project.ControlPanelInfo.NoRepair = true;
project.ControlPanelInfo.NoModify = true;
project.ControlPanelInfo.ProductIcon = @"..\..\..\images\icon.ico";
project.Platform = Platform.x64;
@ -253,27 +264,6 @@ class Script
e.Session.Log("Error trying to close all Symphony instances: " + ex.ToString() );
}
}
// Display a confirmation dialog when uninstalling Symphony, and cancel uninstall unless user confirms.
static void project_BeforeInstall(SetupEventArgs e)
{
try
{
if (e.IsUninstalling)
{
var result = System.Windows.Forms.MessageBox.Show("Are you sure you want to uninstall this product?",
"Windows Installer", System.Windows.Forms.MessageBoxButtons.YesNo);
if (result != System.Windows.Forms.DialogResult.Yes)
{
e.Result = ActionResult.UserExit; // Signal to installer to exit
}
}
}
catch (System.Exception ex)
{
e.Session.Log("Error displaying uninstall confirmation dialog: " + ex.ToString() );
}
}
}
public class CustomActions

View File

@ -3,7 +3,7 @@ using System.Drawing;
namespace Symphony
{
public partial class WelcomeDlg : WixSharp.UI.Forms.ManagedForm, IManagedDialog
public partial class WelcomeDialog : WixSharp.UI.Forms.ManagedForm, IManagedDialog
{
// Helper function to retrive the user name of the current user. The user name returned from
// windows can be on the form DOMAIN\USER or USER@DOMAIN. This function strips away the domain
@ -15,7 +15,7 @@ namespace Symphony
return slashIndex > -1 ? name.Substring(slashIndex + 1) : name.Substring(0, name.IndexOf("@"));
}
public WelcomeDlg()
public WelcomeDialog()
{
InitializeComponent();
}
@ -28,11 +28,19 @@ namespace Symphony
this.radioButtonCurrentUser.Text = "Only for me (" + getUserName() + ")";
if( Runtime.Session["ALLUSERS"] != "" )
{
this.radioButtonAllUsers.Checked = true;
this.radioButtonAllUsers.Checked = true;
}
else
{
this.radioButtonCurrentUser.Checked = true;
this.radioButtonCurrentUser.Checked = true;
}
// Detect if Symphony is running
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
if (!isRunning)
{
// If it is not running, change the label of the "Next" button to "Install" as the CloseDialog will be skipped
this.next.Text = "Install";
}
}
@ -46,7 +54,7 @@ namespace Symphony
{
// Install for current user
Runtime.Session["MSIINSTALLPERUSER"] = "1"; // per-user
Runtime.Session["INSTALLDIR"] = System.Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Apps\Symphony\" + Runtime.ProductName);
Runtime.Session["INSTALLDIR"] = System.Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Programs\Symphony\" + Runtime.ProductName);
} else if (radioButtonAllUsers.Checked)
{
// Install for all users
@ -55,22 +63,27 @@ namespace Symphony
}
// Detect if Symphony is running
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 0;
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
if (isRunning)
{
// If it is running, continue to the "Close Symphony" screen
Shell.GoTo<Symphony.CloseDlg>();
Shell.GoNext();
}
else
{
// If it is not running, proceed to InstallDir dialog
Shell.GoNext();
// If it is not running, proceed to progress dialog
Shell.GoTo<Symphony.ProgressDialog>();
}
}
void cancel_Click(object sender, System.EventArgs e)
{
Shell.Cancel();
// TODO: Localization
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();
}
}
}
}

View File

@ -1,7 +1,7 @@
// This file is created and modified from the visual form designer in Visual Studio, so shouldn't need to be modified by hand
namespace Symphony
{
partial class WelcomeDlg
partial class WelcomeDialog
{
/// <summary>
/// Required designer variable.
@ -177,12 +177,13 @@ namespace Symphony
this.labelHeader.TabIndex = 0;
this.labelHeader.Text = "Thanks for downloading \r\nSymphony";
//
// WelcomeDlg
// WelcomeDialog
//
this.ControlBox = false;
this.ClientSize = new System.Drawing.Size(494, 361);
this.Controls.Add(this.backgroundPanel);
this.Controls.Add(this.bottomPanel);
this.Name = "WelcomeDlg";
this.Name = "WelcomeDialog";
this.Text = "Symphony Setup";
this.Load += new System.EventHandler(this.dialog_Load);
this.bottomPanel.ResumeLayout(false);