mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-2593 New installer flow
This commit is contained in:
@@ -5,9 +5,6 @@ namespace Symphony
|
||||
{
|
||||
public partial class CloseDialog : WixSharp.UI.Forms.ManagedForm, IManagedDialog
|
||||
{
|
||||
const int WelcomeDlgIndex = 0;
|
||||
const int InstallDirIndex = 1;
|
||||
|
||||
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,17 +29,12 @@ 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)
|
||||
|
||||
@@ -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;
|
||||
@@ -159,6 +144,7 @@ namespace Symphony
|
||||
//
|
||||
// CloseDialog
|
||||
//
|
||||
this.ControlBox = false;
|
||||
this.ClientSize = new System.Drawing.Size(494, 361);
|
||||
this.Controls.Add(this.backgroundPanel);
|
||||
this.Controls.Add(this.bottomPanel);
|
||||
@@ -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;
|
||||
|
||||
@@ -1,295 +0,0 @@
|
||||
using WixSharp;
|
||||
using WixSharp.UI.Forms;
|
||||
|
||||
namespace Symphony
|
||||
{
|
||||
partial class InstallDirDialog
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.middlePanel = new System.Windows.Forms.Panel();
|
||||
this.change = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.installDir = new System.Windows.Forms.TextBox();
|
||||
this.topBorder = new System.Windows.Forms.Panel();
|
||||
this.topPanel = new System.Windows.Forms.Panel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = 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.back = new System.Windows.Forms.Button();
|
||||
this.next = new System.Windows.Forms.Button();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.border1 = new System.Windows.Forms.Panel();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.middlePanel.SuspendLayout();
|
||||
this.topPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.banner)).BeginInit();
|
||||
this.bottomPanel.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.copyToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(103, 26);
|
||||
//
|
||||
// copyToolStripMenuItem
|
||||
//
|
||||
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
|
||||
this.copyToolStripMenuItem.Size = new System.Drawing.Size(102, 22);
|
||||
this.copyToolStripMenuItem.Text = "Copy";
|
||||
//
|
||||
// middlePanel
|
||||
//
|
||||
this.middlePanel.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.middlePanel.Controls.Add(this.change);
|
||||
this.middlePanel.Controls.Add(this.label3);
|
||||
this.middlePanel.Controls.Add(this.installDir);
|
||||
this.middlePanel.Location = new System.Drawing.Point(22, 75);
|
||||
this.middlePanel.Name = "middlePanel";
|
||||
this.middlePanel.Size = new System.Drawing.Size(449, 139);
|
||||
this.middlePanel.TabIndex = 16;
|
||||
//
|
||||
// change
|
||||
//
|
||||
this.change.AutoSize = true;
|
||||
this.change.Location = new System.Drawing.Point(3, 88);
|
||||
this.change.Name = "change";
|
||||
this.change.Size = new System.Drawing.Size(119, 23);
|
||||
this.change.TabIndex = 12;
|
||||
this.change.Text = "[InstallDirDlgChange]";
|
||||
this.change.UseVisualStyleBackColor = true;
|
||||
this.change.Click += new System.EventHandler(this.change_Click);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label3.Location = new System.Drawing.Point(0, 3);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(124, 13);
|
||||
this.label3.TabIndex = 11;
|
||||
this.label3.Text = "[InstallDirDlgFolderLabel]";
|
||||
//
|
||||
// installDir
|
||||
//
|
||||
this.installDir.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.installDir.Location = new System.Drawing.Point(3, 56);
|
||||
this.installDir.Name = "installDir";
|
||||
this.installDir.Size = new System.Drawing.Size(443, 20);
|
||||
this.installDir.TabIndex = 13;
|
||||
//
|
||||
// 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 = 15;
|
||||
//
|
||||
// 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.label2);
|
||||
this.topPanel.Controls.Add(this.label1);
|
||||
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 = 10;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label2.Location = new System.Drawing.Point(18, 31);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(122, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "[InstallDirDlgDescription]";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(11, 8);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(109, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "[InstallDirDlgTitle]";
|
||||
//
|
||||
// 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.border1);
|
||||
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 = 9;
|
||||
//
|
||||
// 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.back, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.next, 2, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.cancel, 4, 0);
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 5);
|
||||
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(493, 43);
|
||||
this.tableLayoutPanel1.TabIndex = 8;
|
||||
//
|
||||
// back
|
||||
//
|
||||
this.back.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.back.AutoSize = true;
|
||||
this.back.Location = new System.Drawing.Point(224, 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;
|
||||
this.next.AutoSize = true;
|
||||
this.next.Location = new System.Drawing.Point(307, 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(404, 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);
|
||||
//
|
||||
// border1
|
||||
//
|
||||
this.border1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.border1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.border1.Location = new System.Drawing.Point(0, 0);
|
||||
this.border1.Name = "border1";
|
||||
this.border1.Size = new System.Drawing.Size(494, 1);
|
||||
this.border1.TabIndex = 14;
|
||||
//
|
||||
// InstallDirDialog
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(494, 361);
|
||||
this.Controls.Add(this.middlePanel);
|
||||
this.Controls.Add(this.topBorder);
|
||||
this.Controls.Add(this.topPanel);
|
||||
this.Controls.Add(this.bottomPanel);
|
||||
this.Name = "InstallDirDialog";
|
||||
this.Text = "[InstallDirDlg_Title]";
|
||||
this.Load += new System.EventHandler(this.InstallDirDialog_Load);
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
this.middlePanel.ResumeLayout(false);
|
||||
this.middlePanel.PerformLayout();
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox banner;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
|
||||
private System.Windows.Forms.Panel topPanel;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Panel bottomPanel;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button change;
|
||||
private System.Windows.Forms.TextBox installDir;
|
||||
private System.Windows.Forms.Panel border1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button back;
|
||||
private System.Windows.Forms.Button next;
|
||||
private System.Windows.Forms.Button cancel;
|
||||
private System.Windows.Forms.Panel topBorder;
|
||||
private System.Windows.Forms.Panel middlePanel;
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using WixSharp;
|
||||
using WixSharp.UI.Forms;
|
||||
|
||||
namespace Symphony
|
||||
{
|
||||
/// <summary>
|
||||
/// The standard InstallDir dialog
|
||||
/// </summary>
|
||||
public partial class InstallDirDialog : ManagedForm, IManagedDialog // change ManagedForm->Form if you want to show it in designer
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InstallDirDialog"/> class.
|
||||
/// </summary>
|
||||
public InstallDirDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
label1.MakeTransparentOn(banner);
|
||||
label2.MakeTransparentOn(banner);
|
||||
}
|
||||
|
||||
string installDirProperty;
|
||||
|
||||
void InstallDirDialog_Load(object sender, EventArgs e)
|
||||
{
|
||||
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner");
|
||||
|
||||
installDirProperty = Runtime.Session.Property("WixSharp_UI_INSTALLDIR");
|
||||
|
||||
string installDirPropertyValue = Runtime.Session.Property(installDirProperty);
|
||||
|
||||
if (installDirPropertyValue.IsEmpty())
|
||||
{
|
||||
//We are executed before any of the MSI actions are invoked so the INSTALLDIR (if set to absolute path)
|
||||
//is not resolved yet. So we need to do it manually
|
||||
installDir.Text = Runtime.Session.GetDirectoryPath(installDirProperty);
|
||||
|
||||
if (installDir.Text == "ABSOLUTEPATH")
|
||||
installDir.Text = Runtime.Session.Property("INSTALLDIR_ABSOLUTEPATH");
|
||||
}
|
||||
else
|
||||
{
|
||||
//INSTALLDIR set either from the command line or by one of the early setup events (e.g. UILoaded)
|
||||
installDir.Text = installDirPropertyValue;
|
||||
}
|
||||
|
||||
ResetLayout();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
middlePanel.Top = topBorder.Bottom + 10;
|
||||
|
||||
var upShift = (int)(next.Height * 2.3) - bottomPanel.Height;
|
||||
bottomPanel.Top -= upShift;
|
||||
bottomPanel.Height += upShift;
|
||||
}
|
||||
|
||||
void back_Click(object sender, EventArgs e)
|
||||
{
|
||||
Shell.GoPrev();
|
||||
}
|
||||
|
||||
void next_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!installDirProperty.IsEmpty())
|
||||
Runtime.Session[installDirProperty] = installDir.Text;
|
||||
Shell.GoNext();
|
||||
}
|
||||
|
||||
void cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
void change_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var dialog = new FolderBrowserDialog { SelectedPath = installDir.Text })
|
||||
{
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
installDir.Text = dialog.SelectedPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using WixSharp;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Symphony
|
||||
{
|
||||
@@ -10,24 +9,21 @@ namespace Symphony
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void dialog_Load(object sender, System.EventArgs e)
|
||||
private void MaintenanceDialog_Shown(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)
|
||||
{
|
||||
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 )
|
||||
// Detect if Symphony is running
|
||||
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
|
||||
if (isRunning)
|
||||
{
|
||||
Shell.Cancel();
|
||||
// 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>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -29,129 +29,13 @@ namespace Symphony
|
||||
/// </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";
|
||||
//
|
||||
// MaintenanceDialog
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(494, 361);
|
||||
this.Controls.Add(this.backgroundPanel);
|
||||
this.Controls.Add(this.bottomPanel);
|
||||
this.Name = "MaintenanceDialog";
|
||||
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);
|
||||
|
||||
}
|
||||
this.Shown += new System.EventHandler(this.MaintenanceDialog_Shown);
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
@@ -1,337 +0,0 @@
|
||||
using WixSharp;
|
||||
using WixSharp.UI.Forms;
|
||||
|
||||
namespace Symphony
|
||||
{
|
||||
partial class MaintenanceTypeDialog
|
||||
{
|
||||
/// <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.label5 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.remove = new System.Windows.Forms.Button();
|
||||
this.repair = new System.Windows.Forms.Button();
|
||||
this.topPanel = new System.Windows.Forms.Panel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = 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.back = new System.Windows.Forms.Button();
|
||||
this.next = new System.Windows.Forms.Button();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.border1 = new System.Windows.Forms.Panel();
|
||||
this.middlePanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.topPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.banner)).BeginInit();
|
||||
this.bottomPanel.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.middlePanel.SuspendLayout();
|
||||
this.panel4.SuspendLayout();
|
||||
this.panel5.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 = 18;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label5.AutoEllipsis = true;
|
||||
this.label5.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label5.Location = new System.Drawing.Point(28, 40);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(442, 38);
|
||||
this.label5.TabIndex = 1;
|
||||
this.label5.Text = "[MaintenanceTypeDlgRemoveText]";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label4.AutoEllipsis = true;
|
||||
this.label4.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label4.Location = new System.Drawing.Point(28, 40);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(440, 34);
|
||||
this.label4.TabIndex = 1;
|
||||
this.label4.Text = "[MaintenanceTypeDlgRepairText]";
|
||||
//
|
||||
// remove
|
||||
//
|
||||
this.remove.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.remove.AutoSize = true;
|
||||
this.remove.Location = new System.Drawing.Point(0, 5);
|
||||
this.remove.MaximumSize = new System.Drawing.Size(113, 0);
|
||||
this.remove.MinimumSize = new System.Drawing.Size(113, 0);
|
||||
this.remove.Name = "remove";
|
||||
this.remove.Size = new System.Drawing.Size(113, 23);
|
||||
this.remove.TabIndex = 16;
|
||||
this.remove.Text = "[MaintenanceTypeDlgRemoveButton]";
|
||||
this.remove.UseVisualStyleBackColor = true;
|
||||
this.remove.Click += new System.EventHandler(this.remove_Click);
|
||||
//
|
||||
// repair
|
||||
//
|
||||
this.repair.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.repair.AutoSize = true;
|
||||
this.repair.Location = new System.Drawing.Point(0, 5);
|
||||
this.repair.MaximumSize = new System.Drawing.Size(113, 0);
|
||||
this.repair.MinimumSize = new System.Drawing.Size(113, 0);
|
||||
this.repair.Name = "repair";
|
||||
this.repair.Size = new System.Drawing.Size(113, 23);
|
||||
this.repair.TabIndex = 15;
|
||||
this.repair.Text = "[MaintenanceTypeDlgRepairButton]";
|
||||
this.repair.UseVisualStyleBackColor = true;
|
||||
this.repair.Click += new System.EventHandler(this.repair_Click);
|
||||
//
|
||||
// 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.label2);
|
||||
this.topPanel.Controls.Add(this.label1);
|
||||
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 = 13;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label2.Location = new System.Drawing.Point(19, 31);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(168, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "[MaintenanceTypeDlgDescription]";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(11, 8);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(160, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "[MaintenanceTypeDlgTitle]";
|
||||
//
|
||||
// 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.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.bottomPanel.Controls.Add(this.tableLayoutPanel1);
|
||||
this.bottomPanel.Controls.Add(this.border1);
|
||||
this.bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
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 = 12;
|
||||
//
|
||||
// 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.back, 1, 0);
|
||||
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;
|
||||
//
|
||||
// back
|
||||
//
|
||||
this.back.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.back.AutoSize = true;
|
||||
this.back.Enabled = false;
|
||||
this.back.Location = new System.Drawing.Point(222, 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;
|
||||
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;
|
||||
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);
|
||||
//
|
||||
// border1
|
||||
//
|
||||
this.border1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.border1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.border1.Location = new System.Drawing.Point(0, 0);
|
||||
this.border1.Name = "border1";
|
||||
this.border1.Size = new System.Drawing.Size(494, 1);
|
||||
this.border1.TabIndex = 17;
|
||||
//
|
||||
// middlePanel
|
||||
//
|
||||
this.middlePanel.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.middlePanel.ColumnCount = 1;
|
||||
this.middlePanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.middlePanel.Controls.Add(this.panel4, 0, 0);
|
||||
this.middlePanel.Controls.Add(this.panel5, 0, 1);
|
||||
this.middlePanel.Location = new System.Drawing.Point(15, 61);
|
||||
this.middlePanel.Name = "middlePanel";
|
||||
this.middlePanel.RowCount = 3;
|
||||
this.middlePanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.middlePanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.middlePanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.middlePanel.Size = new System.Drawing.Size(479, 248);
|
||||
this.middlePanel.TabIndex = 20;
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.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.panel4.Controls.Add(this.repair);
|
||||
this.panel4.Controls.Add(this.label4);
|
||||
this.panel4.Location = new System.Drawing.Point(3, 85);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(473, 76);
|
||||
this.panel4.TabIndex = 1;
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.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.panel5.Controls.Add(this.remove);
|
||||
this.panel5.Controls.Add(this.label5);
|
||||
this.panel5.Location = new System.Drawing.Point(3, 167);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Size = new System.Drawing.Size(473, 78);
|
||||
this.panel5.TabIndex = 2;
|
||||
//
|
||||
// MaintenanceTypeDialog
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(494, 361);
|
||||
this.Controls.Add(this.middlePanel);
|
||||
this.Controls.Add(this.topBorder);
|
||||
this.Controls.Add(this.topPanel);
|
||||
this.Controls.Add(this.bottomPanel);
|
||||
this.Name = "MaintenanceTypeDialog";
|
||||
this.Text = "[MaintenanceTypeDlg_Title]";
|
||||
this.Load += new System.EventHandler(this.MaintenanceTypeDialog_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.middlePanel.ResumeLayout(false);
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.panel4.PerformLayout();
|
||||
this.panel5.ResumeLayout(false);
|
||||
this.panel5.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox banner;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Panel topPanel;
|
||||
private System.Windows.Forms.Panel bottomPanel;
|
||||
private System.Windows.Forms.Button repair;
|
||||
private System.Windows.Forms.Button remove;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Panel border1;
|
||||
private System.Windows.Forms.Panel topBorder;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button back;
|
||||
private System.Windows.Forms.Button next;
|
||||
private System.Windows.Forms.Button cancel;
|
||||
private System.Windows.Forms.TableLayoutPanel middlePanel;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
private System.Windows.Forms.Panel panel5;
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
using WixSharp;
|
||||
using WixSharp.UI.Forms;
|
||||
|
||||
namespace Symphony
|
||||
{
|
||||
/// <summary>
|
||||
/// The standard Maintenance Type dialog
|
||||
/// </summary>
|
||||
public partial class MaintenanceTypeDialog : ManagedForm, IManagedDialog // change ManagedForm->Form if you want to show it in designer
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MaintenanceTypeDialog"/> class.
|
||||
/// </summary>
|
||||
public MaintenanceTypeDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
label1.MakeTransparentOn(banner);
|
||||
label2.MakeTransparentOn(banner);
|
||||
}
|
||||
|
||||
Type ProgressDialog
|
||||
{
|
||||
get
|
||||
{
|
||||
return Shell.Dialogs
|
||||
.Where(d => d.GetInterfaces().Contains(typeof(IProgressDialog)))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
void repair_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
Runtime.Session["MODIFY_ACTION"] = "Repair";
|
||||
int index = Shell.Dialogs.IndexOf(ProgressDialog);
|
||||
if (index != -1)
|
||||
Shell.GoTo(index);
|
||||
else
|
||||
Shell.GoNext();
|
||||
}
|
||||
|
||||
void remove_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
Runtime.Session["REMOVE"] = "ALL";
|
||||
Runtime.Session["MODIFY_ACTION"] = "Remove";
|
||||
|
||||
int index = Shell.Dialogs.IndexOf(ProgressDialog);
|
||||
if (index != -1)
|
||||
Shell.GoTo(index);
|
||||
else
|
||||
Shell.GoNext();
|
||||
}
|
||||
|
||||
void back_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
Shell.GoPrev();
|
||||
}
|
||||
|
||||
void next_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
Shell.GoNext();
|
||||
}
|
||||
|
||||
void cancel_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
void MaintenanceTypeDialog_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
banner.Image = Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner");
|
||||
|
||||
ResetLayout();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
middlePanel.Top = topBorder.Bottom + 5;
|
||||
middlePanel.Height = (bottomPanel.Top - 5) - middlePanel.Top;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,6 @@ namespace Symphony
|
||||
this.banner = new System.Windows.Forms.PictureBox();
|
||||
this.bottomPanel = new System.Windows.Forms.Panel();
|
||||
this.tableLayoutPanel1 = 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.bottomBorder = new System.Windows.Forms.Panel();
|
||||
@@ -137,7 +136,6 @@ namespace Symphony
|
||||
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.back, 1, 0);
|
||||
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);
|
||||
@@ -147,19 +145,6 @@ namespace Symphony
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(491, 43);
|
||||
this.tableLayoutPanel1.TabIndex = 7;
|
||||
//
|
||||
// back
|
||||
//
|
||||
this.back.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.back.AutoSize = true;
|
||||
this.back.Enabled = false;
|
||||
this.back.Location = new System.Drawing.Point(222, 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;
|
||||
//
|
||||
// next
|
||||
//
|
||||
this.next.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
@@ -243,7 +228,7 @@ namespace Symphony
|
||||
this.Controls.Add(this.description);
|
||||
this.Controls.Add(this.currentActionLabel);
|
||||
this.Name = "ProgressDialog";
|
||||
this.Text = "[ProgressDlg_Title]";
|
||||
this.Text = "Symphony Setup";
|
||||
this.Load += new System.EventHandler(this.ProgressDialog_Load);
|
||||
this.topPanel.ResumeLayout(false);
|
||||
this.topPanel.PerformLayout();
|
||||
@@ -269,7 +254,6 @@ namespace Symphony
|
||||
private System.Windows.Forms.Panel bottomBorder;
|
||||
private System.Windows.Forms.Panel topBorder;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button back;
|
||||
private System.Windows.Forms.Button next;
|
||||
private System.Windows.Forms.Button cancel;
|
||||
private System.Windows.Forms.Label waitPrompt;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Symphony
|
||||
|
||||
var fontSize = waitPrompt.Font.Size;
|
||||
float scaling = 1;
|
||||
waitPrompt.Font = new Font(waitPrompt.Font.Name, fontSize * scaling, FontStyle.Italic);
|
||||
waitPrompt.Font = new Font(waitPrompt.Font.Name, fontSize * scaling, FontStyle.Regular);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,20 +70,17 @@ namespace Symphony
|
||||
{
|
||||
if (Runtime.Session.IsUninstalling())
|
||||
{
|
||||
dialogText.Text =
|
||||
Text = "[ProgressDlgTitleRemoving]";
|
||||
dialogText.Text = "[ProgressDlgTitleRemoving]";
|
||||
description.Text = "[ProgressDlgTextRemoving]";
|
||||
}
|
||||
else if (Runtime.Session.IsRepairing())
|
||||
{
|
||||
dialogText.Text =
|
||||
Text = "[ProgressDlgTextRepairing]";
|
||||
dialogText.Text = "[ProgressDlgTextRepairing]";
|
||||
description.Text = "[ProgressDlgTitleRepairing]";
|
||||
}
|
||||
else if (Runtime.Session.IsInstalling())
|
||||
{
|
||||
dialogText.Text =
|
||||
Text = "[ProgressDlgTitleInstalling]";
|
||||
dialogText.Text = "[ProgressDlgTitleInstalling]";
|
||||
description.Text = "[ProgressDlgTextInstalling]";
|
||||
}
|
||||
|
||||
|
||||
@@ -7,16 +7,12 @@
|
||||
//css_imp WelcomeDialog.designer.cs;
|
||||
//css_imp CloseDialog.cs;
|
||||
//css_imp CloseDialog.designer.cs;
|
||||
//css_imp InstallDirDialog.cs
|
||||
//css_imp InstallDirDialog.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;
|
||||
//css_imp ProgressDialog.cs
|
||||
//css_imp ProgressDialog.Designer.cs
|
||||
//css_imp MaintenanceTypeDialog.cs;
|
||||
//css_imp MaintenanceTypeDialog.designer.cs;
|
||||
|
||||
using WixSharp;
|
||||
using WixSharp.Forms;
|
||||
@@ -134,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.
|
||||
@@ -176,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"
|
||||
@@ -187,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"
|
||||
@@ -198,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
|
||||
@@ -211,20 +214,19 @@ 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.WelcomeDialog>()
|
||||
.Add<Symphony.InstallDirDialog>()
|
||||
.Add<Symphony.CloseDialog>()
|
||||
.Add<Symphony.ProgressDialog>()
|
||||
.Add<Symphony.ExitDialog>()
|
||||
.Add<Symphony.CloseDialog>();
|
||||
.Add<Symphony.ExitDialog>();
|
||||
project.ManagedUI.ModifyDialogs.Add<Symphony.MaintenanceDialog>()
|
||||
.Add<Symphony.MaintenanceTypeDialog>()
|
||||
.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;
|
||||
|
||||
@@ -262,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 && e.Session["REMOVE"] == "ALL")
|
||||
{
|
||||
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
|
||||
|
||||
@@ -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,16 +63,16 @@ 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.CloseDialog>();
|
||||
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>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@ namespace Symphony
|
||||
//
|
||||
// WelcomeDialog
|
||||
//
|
||||
this.ControlBox = false;
|
||||
this.ClientSize = new System.Drawing.Size(494, 361);
|
||||
this.Controls.Add(this.backgroundPanel);
|
||||
this.Controls.Add(this.bottomPanel);
|
||||
|
||||
Reference in New Issue
Block a user