From 795f006e2d9435aa5e94dc27ae79d87d35339213 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 20:13:06 +1300 Subject: [PATCH 1/8] Updating versions to 1.0.1 --- DisplayMagician/Properties/AssemblyInfo.cs | 4 ++-- DisplayMagicianLogReporter/Properties/AssemblyInfo.cs | 4 ++-- DisplayMagicianSetup/Includes/DisplayMagicianVariables.wxi | 4 ++-- DisplayMagicianShared/Properties/AssemblyInfo.cs | 4 ++-- DisplayMagicianShellExtension/Properties/AssemblyInfo.cs | 4 ++-- docs/update/index.json | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/DisplayMagician/Properties/AssemblyInfo.cs b/DisplayMagician/Properties/AssemblyInfo.cs index 9bc23f5..35e7821 100644 --- a/DisplayMagician/Properties/AssemblyInfo.cs +++ b/DisplayMagician/Properties/AssemblyInfo.cs @@ -37,8 +37,8 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.*")] +[assembly: AssemblyFileVersion("1.0.1.0")] [assembly: NeutralResourcesLanguage("en")] [assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/DisplayMagicianLogReporter/Properties/AssemblyInfo.cs b/DisplayMagicianLogReporter/Properties/AssemblyInfo.cs index 443b351..c9d6558 100644 --- a/DisplayMagicianLogReporter/Properties/AssemblyInfo.cs +++ b/DisplayMagicianLogReporter/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] \ No newline at end of file diff --git a/DisplayMagicianSetup/Includes/DisplayMagicianVariables.wxi b/DisplayMagicianSetup/Includes/DisplayMagicianVariables.wxi index 37ad727..31e556a 100644 --- a/DisplayMagicianSetup/Includes/DisplayMagicianVariables.wxi +++ b/DisplayMagicianSetup/Includes/DisplayMagicianVariables.wxi @@ -4,8 +4,8 @@ Versioning. These have to be changed for upgrades. It's not enough to just include newer files. --> - - + + diff --git a/DisplayMagicianShared/Properties/AssemblyInfo.cs b/DisplayMagicianShared/Properties/AssemblyInfo.cs index 4b214d8..6a0ba9f 100644 --- a/DisplayMagicianShared/Properties/AssemblyInfo.cs +++ b/DisplayMagicianShared/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.1.*")] +[assembly: AssemblyFileVersion("1.0.1.0")] \ No newline at end of file diff --git a/DisplayMagicianShellExtension/Properties/AssemblyInfo.cs b/DisplayMagicianShellExtension/Properties/AssemblyInfo.cs index 423bbbc..de46835 100644 --- a/DisplayMagicianShellExtension/Properties/AssemblyInfo.cs +++ b/DisplayMagicianShellExtension/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.1.*")] +[assembly: AssemblyFileVersion("1.0.1.0")] \ No newline at end of file diff --git a/docs/update/index.json b/docs/update/index.json index 22d13d3..7f1c57a 100644 --- a/docs/update/index.json +++ b/docs/update/index.json @@ -1,6 +1,6 @@ { - "version": "1.0.0.0", - "url": "https://github.com/terrymacdonald/DisplayMagician/releases/download/v1.0.0/DisplayMagicianSetup-v1.0.0.msi", + "version": "1.0.1.0", + "url": "https://github.com/terrymacdonald/DisplayMagician/releases/download/v1.0.1/DisplayMagicianSetup-v1.0.1.msi", "changelog": "https://github.com/terrymacdonald/DisplayMagician/releases", "mandatory": { "value": false, From f9de79399850194bf4823b86262becc08fbdf62b Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 20:25:34 +1300 Subject: [PATCH 2/8] Stop desktop save from closing window Stop 'save to desktop' button closing the shortcut window (and the profile window too!) --- DisplayMagician/UIForms/DisplayProfileForm.cs | 4 ++-- DisplayMagician/UIForms/ShortcutLibraryForm.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DisplayMagician/UIForms/DisplayProfileForm.cs b/DisplayMagician/UIForms/DisplayProfileForm.cs index eb8e443..05bff8c 100644 --- a/DisplayMagician/UIForms/DisplayProfileForm.cs +++ b/DisplayMagician/UIForms/DisplayProfileForm.cs @@ -112,7 +112,7 @@ namespace DisplayMagician.UIForms private void Save_Click(object sender, EventArgs e) { - DialogResult = DialogResult.None; + //DialogResult = DialogResult.None; // Only do something if there is a shortcut selected if (_selectedProfile != null) @@ -155,7 +155,7 @@ namespace DisplayMagician.UIForms } dialog_save.FileName = string.Empty; - DialogResult = DialogResult.OK; + //DialogResult = DialogResult.OK; } } catch (Exception ex) diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.cs b/DisplayMagician/UIForms/ShortcutLibraryForm.cs index c3b47ac..e5e5e23 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.cs +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.cs @@ -102,7 +102,7 @@ namespace DisplayMagician.UIForms private void btn_save_Click(object sender, EventArgs e) { - DialogResult = DialogResult.None; + //DialogResult = DialogResult.None; // Only do something if there is a shortcut selected if (_selectedShortcut != null) @@ -160,7 +160,7 @@ namespace DisplayMagician.UIForms } dialog_save.FileName = string.Empty; - DialogResult = DialogResult.OK; + //DialogResult = DialogResult.OK; } } catch (Exception ex) From 77110db1140308e01846271b060f16158fc1d565 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 20:44:59 +1300 Subject: [PATCH 3/8] Stop DM closing after running a shortcut Also allow people to click on the startprograms checkbox labels to have them change the checkboxes themselves. --- .../UIForms/ShortcutForm.Designer.cs | 4 +++ DisplayMagician/UIForms/ShortcutForm.cs | 31 +++++++++++++++++++ .../UIForms/ShortcutLibraryForm.cs | 5 +-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/DisplayMagician/UIForms/ShortcutForm.Designer.cs b/DisplayMagician/UIForms/ShortcutForm.Designer.cs index c2e9d7b..204bf35 100644 --- a/DisplayMagician/UIForms/ShortcutForm.Designer.cs +++ b/DisplayMagician/UIForms/ShortcutForm.Designer.cs @@ -691,6 +691,7 @@ namespace DisplayMagician.UIForms this.lbl_start_program4.Size = new System.Drawing.Size(244, 20); this.lbl_start_program4.TabIndex = 0; this.lbl_start_program4.Text = "Choose a program to start fourth:"; + this.lbl_start_program4.Click += new System.EventHandler(this.lbl_start_program4_Click); // // pnl_start_program3 // @@ -779,6 +780,7 @@ namespace DisplayMagician.UIForms this.lbl_start_program3.Size = new System.Drawing.Size(233, 20); this.lbl_start_program3.TabIndex = 0; this.lbl_start_program3.Text = "Choose a program to start third:"; + this.lbl_start_program3.Click += new System.EventHandler(this.lbl_start_program3_Click); // // pnl_start_program2 // @@ -867,6 +869,7 @@ namespace DisplayMagician.UIForms this.lbl_start_program2.Size = new System.Drawing.Size(254, 20); this.lbl_start_program2.TabIndex = 0; this.lbl_start_program2.Text = "Choose a program to start second:"; + this.lbl_start_program2.Click += new System.EventHandler(this.lbl_start_program2_Click); // // pnl_start_program1 // @@ -955,6 +958,7 @@ namespace DisplayMagician.UIForms this.lbl_start_program1.Size = new System.Drawing.Size(228, 20); this.lbl_start_program1.TabIndex = 0; this.lbl_start_program1.Text = "Choose a program to start first:"; + this.lbl_start_program1.Click += new System.EventHandler(this.lbl_start_program1_Click); // // tabp_game // diff --git a/DisplayMagician/UIForms/ShortcutForm.cs b/DisplayMagician/UIForms/ShortcutForm.cs index 95a7ab2..d985e4c 100644 --- a/DisplayMagician/UIForms/ShortcutForm.cs +++ b/DisplayMagician/UIForms/ShortcutForm.cs @@ -1997,5 +1997,36 @@ namespace DisplayMagician.UIForms _captureVolume = Convert.ToDecimal(nud_capture_volume.Value); } + private void lbl_start_program1_Click(object sender, EventArgs e) + { + if (!cb_start_program1.Checked) + cb_start_program1.CheckState = CheckState.Checked; + else + cb_start_program1.CheckState = CheckState.Unchecked; + } + + private void lbl_start_program2_Click(object sender, EventArgs e) + { + if (!cb_start_program2.Checked) + cb_start_program2.CheckState = CheckState.Checked; + else + cb_start_program2.CheckState = CheckState.Unchecked; + } + + private void lbl_start_program3_Click(object sender, EventArgs e) + { + if (!cb_start_program3.Checked) + cb_start_program3.CheckState = CheckState.Checked; + else + cb_start_program3.CheckState = CheckState.Unchecked; + } + + private void lbl_start_program4_Click(object sender, EventArgs e) + { + if (!cb_start_program4.Checked) + cb_start_program4.CheckState = CheckState.Checked; + else + cb_start_program4.CheckState = CheckState.Unchecked; + } } } \ No newline at end of file diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.cs b/DisplayMagician/UIForms/ShortcutLibraryForm.cs index e5e5e23..1b32df9 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.cs +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.cs @@ -319,11 +319,12 @@ namespace DisplayMagician.UIForms // Get the MainForm so we can access the NotifyIcon on it. MainForm mainForm = (MainForm)this.Owner; - // Run the shortcut ShortcutRepository.RunShortcut(_selectedShortcut, mainForm.notifyIcon); - maskedForm.Close(); + // Only do this if we are NOT minimised + if (!Program.AppProgramSettings.MinimiseOnStart) + maskedForm.Close(); } private void ilv_saved_shortcuts_ItemHover(object sender, ItemHoverEventArgs e) From baa275b8a6d17736badb670699c896bf8d03a4fb Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 21:25:42 +1300 Subject: [PATCH 4/8] Option to start pgm only if needed Added the ability for user to only start a program if it hasn't been started yet. This is for things like SimHub that should already be started by Windows when the PC first boots. Also corrects a bug that ignored the autoname property so that it overwrote the suggested filename when saving a shortcut. --- DisplayMagician/ShortcutItem.cs | 8 +- DisplayMagician/ShortcutRepository.cs | 13 +++ .../UIForms/ShortcutForm.Designer.cs | 88 ++++++++++++++++--- DisplayMagician/UIForms/ShortcutForm.cs | 24 ++++- .../UIForms/ShortcutLibraryForm.cs | 25 ++++-- 5 files changed, 127 insertions(+), 31 deletions(-) diff --git a/DisplayMagician/ShortcutItem.cs b/DisplayMagician/ShortcutItem.cs index a9affbd..fb1f789 100644 --- a/DisplayMagician/ShortcutItem.cs +++ b/DisplayMagician/ShortcutItem.cs @@ -47,6 +47,7 @@ namespace DisplayMagician public string Arguments; public bool ExecutableArgumentsRequired; public bool CloseOnFinish; + public bool DontStartIfAlreadyRunning; } public struct Executable @@ -2237,12 +2238,7 @@ namespace DisplayMagician if (System.IO.File.Exists(shortcutFileName)) { System.IO.File.Delete(shortcutFileName); - } - - // Actually create the shortcut! - //var wshShellType = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); - //dynamic wshShell = Activator.CreateInstance(wshShellType); - + } WshShell shell = new WshShell(); IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutFileName); diff --git a/DisplayMagician/ShortcutRepository.cs b/DisplayMagician/ShortcutRepository.cs index 7e61779..720cda2 100644 --- a/DisplayMagician/ShortcutRepository.cs +++ b/DisplayMagician/ShortcutRepository.cs @@ -708,6 +708,19 @@ namespace DisplayMagician logger.Info($"ShortcutRepository/RunShortcut: Starting {startProgramsToStart.Count} programs before the main game or executable"); foreach (StartProgram processToStart in startProgramsToStart) { + // If required, check whether a process is started already + if (processToStart.DontStartIfAlreadyRunning) + { + logger.Info($"ShortcutRepository/RunShortcut: Checking if process {processToStart.Executable} is already running"); + Process[] alreadyRunningProcesses = System.Diagnostics.Process.GetProcessesByName(Path.GetFileNameWithoutExtension(processToStart.Executable)); + if (alreadyRunningProcesses.Length > 0) + { + logger.Info($"ShortcutRepository/RunShortcut: Process {processToStart.Executable} is already running, so we won't start another one"); + break; + } + + } + // Start the executable logger.Info($"ShortcutRepository/RunShortcut: Starting process {processToStart.Executable}"); Process process = null; diff --git a/DisplayMagician/UIForms/ShortcutForm.Designer.cs b/DisplayMagician/UIForms/ShortcutForm.Designer.cs index 204bf35..f352d99 100644 --- a/DisplayMagician/UIForms/ShortcutForm.Designer.cs +++ b/DisplayMagician/UIForms/ShortcutForm.Designer.cs @@ -142,6 +142,10 @@ namespace DisplayMagician.UIForms this.lbl_title = new System.Windows.Forms.Label(); this.lbl_shortcut_name = new System.Windows.Forms.Label(); this.cb_autosuggest = new System.Windows.Forms.CheckBox(); + this.cb_dont_start_if_running1 = new System.Windows.Forms.CheckBox(); + this.cb_dont_start_if_running2 = new System.Windows.Forms.CheckBox(); + this.cb_dont_start_if_running3 = new System.Windows.Forms.CheckBox(); + this.cb_dont_start_if_running4 = new System.Windows.Forms.CheckBox(); this.tabc_shortcut.SuspendLayout(); this.tabp_display.SuspendLayout(); this.tabp_audio.SuspendLayout(); @@ -606,6 +610,7 @@ namespace DisplayMagician.UIForms // // pnl_start_program4 // + this.pnl_start_program4.Controls.Add(this.cb_dont_start_if_running4); this.pnl_start_program4.Controls.Add(this.cb_start_program4); this.pnl_start_program4.Controls.Add(this.txt_start_program4); this.pnl_start_program4.Controls.Add(this.cb_start_program_close4); @@ -639,11 +644,11 @@ namespace DisplayMagician.UIForms // this.cb_start_program_close4.AutoSize = true; this.cb_start_program_close4.ForeColor = System.Drawing.Color.White; - this.cb_start_program_close4.Location = new System.Drawing.Point(167, 87); + this.cb_start_program_close4.Location = new System.Drawing.Point(547, 82); this.cb_start_program_close4.Name = "cb_start_program_close4"; - this.cb_start_program_close4.Size = new System.Drawing.Size(344, 24); + this.cb_start_program_close4.Size = new System.Drawing.Size(398, 24); this.cb_start_program_close4.TabIndex = 16; - this.cb_start_program_close4.Text = "Close program when you finish playing Game"; + this.cb_start_program_close4.Text = "Close started program when you finish playing Game"; this.cb_start_program_close4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.cb_start_program_close4.UseVisualStyleBackColor = true; this.cb_start_program_close4.Visible = false; @@ -695,6 +700,7 @@ namespace DisplayMagician.UIForms // // pnl_start_program3 // + this.pnl_start_program3.Controls.Add(this.cb_dont_start_if_running3); this.pnl_start_program3.Controls.Add(this.cb_start_program3); this.pnl_start_program3.Controls.Add(this.txt_start_program3); this.pnl_start_program3.Controls.Add(this.cb_start_program_close3); @@ -728,11 +734,11 @@ namespace DisplayMagician.UIForms // this.cb_start_program_close3.AutoSize = true; this.cb_start_program_close3.ForeColor = System.Drawing.Color.White; - this.cb_start_program_close3.Location = new System.Drawing.Point(167, 87); + this.cb_start_program_close3.Location = new System.Drawing.Point(547, 82); this.cb_start_program_close3.Name = "cb_start_program_close3"; - this.cb_start_program_close3.Size = new System.Drawing.Size(344, 24); + this.cb_start_program_close3.Size = new System.Drawing.Size(398, 24); this.cb_start_program_close3.TabIndex = 16; - this.cb_start_program_close3.Text = "Close program when you finish playing Game"; + this.cb_start_program_close3.Text = "Close started program when you finish playing Game"; this.cb_start_program_close3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.cb_start_program_close3.UseVisualStyleBackColor = true; this.cb_start_program_close3.Visible = false; @@ -784,6 +790,7 @@ namespace DisplayMagician.UIForms // // pnl_start_program2 // + this.pnl_start_program2.Controls.Add(this.cb_dont_start_if_running2); this.pnl_start_program2.Controls.Add(this.cb_start_program2); this.pnl_start_program2.Controls.Add(this.txt_start_program2); this.pnl_start_program2.Controls.Add(this.cb_start_program_close2); @@ -817,11 +824,11 @@ namespace DisplayMagician.UIForms // this.cb_start_program_close2.AutoSize = true; this.cb_start_program_close2.ForeColor = System.Drawing.Color.White; - this.cb_start_program_close2.Location = new System.Drawing.Point(167, 87); + this.cb_start_program_close2.Location = new System.Drawing.Point(547, 82); this.cb_start_program_close2.Name = "cb_start_program_close2"; - this.cb_start_program_close2.Size = new System.Drawing.Size(344, 24); + this.cb_start_program_close2.Size = new System.Drawing.Size(398, 24); this.cb_start_program_close2.TabIndex = 16; - this.cb_start_program_close2.Text = "Close program when you finish playing Game"; + this.cb_start_program_close2.Text = "Close started program when you finish playing Game"; this.cb_start_program_close2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.cb_start_program_close2.UseVisualStyleBackColor = true; this.cb_start_program_close2.Visible = false; @@ -873,6 +880,7 @@ namespace DisplayMagician.UIForms // // pnl_start_program1 // + this.pnl_start_program1.Controls.Add(this.cb_dont_start_if_running1); this.pnl_start_program1.Controls.Add(this.cb_start_program1); this.pnl_start_program1.Controls.Add(this.txt_start_program1); this.pnl_start_program1.Controls.Add(this.cb_start_program_close1); @@ -906,11 +914,11 @@ namespace DisplayMagician.UIForms // this.cb_start_program_close1.AutoSize = true; this.cb_start_program_close1.ForeColor = System.Drawing.Color.White; - this.cb_start_program_close1.Location = new System.Drawing.Point(167, 87); + this.cb_start_program_close1.Location = new System.Drawing.Point(547, 82); this.cb_start_program_close1.Name = "cb_start_program_close1"; - this.cb_start_program_close1.Size = new System.Drawing.Size(344, 24); + this.cb_start_program_close1.Size = new System.Drawing.Size(398, 24); this.cb_start_program_close1.TabIndex = 16; - this.cb_start_program_close1.Text = "Close program when you finish playing Game"; + this.cb_start_program_close1.Text = "Close started program when you finish playing Game"; this.cb_start_program_close1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.cb_start_program_close1.UseVisualStyleBackColor = true; this.cb_start_program_close1.Visible = false; @@ -1517,6 +1525,58 @@ namespace DisplayMagician.UIForms this.cb_autosuggest.UseVisualStyleBackColor = true; this.cb_autosuggest.CheckedChanged += new System.EventHandler(this.cb_autosuggest_CheckedChanged); // + // cb_dont_start_if_running1 + // + this.cb_dont_start_if_running1.AutoSize = true; + this.cb_dont_start_if_running1.ForeColor = System.Drawing.Color.White; + this.cb_dont_start_if_running1.Location = new System.Drawing.Point(167, 82); + this.cb_dont_start_if_running1.Name = "cb_dont_start_if_running1"; + this.cb_dont_start_if_running1.Size = new System.Drawing.Size(289, 24); + this.cb_dont_start_if_running1.TabIndex = 18; + this.cb_dont_start_if_running1.Text = "Don\'t start if program already running"; + this.cb_dont_start_if_running1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cb_dont_start_if_running1.UseVisualStyleBackColor = true; + this.cb_dont_start_if_running1.Visible = false; + // + // cb_dont_start_if_running2 + // + this.cb_dont_start_if_running2.AutoSize = true; + this.cb_dont_start_if_running2.ForeColor = System.Drawing.Color.White; + this.cb_dont_start_if_running2.Location = new System.Drawing.Point(167, 82); + this.cb_dont_start_if_running2.Name = "cb_dont_start_if_running2"; + this.cb_dont_start_if_running2.Size = new System.Drawing.Size(289, 24); + this.cb_dont_start_if_running2.TabIndex = 19; + this.cb_dont_start_if_running2.Text = "Don\'t start if program already running"; + this.cb_dont_start_if_running2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cb_dont_start_if_running2.UseVisualStyleBackColor = true; + this.cb_dont_start_if_running2.Visible = false; + // + // cb_dont_start_if_running3 + // + this.cb_dont_start_if_running3.AutoSize = true; + this.cb_dont_start_if_running3.ForeColor = System.Drawing.Color.White; + this.cb_dont_start_if_running3.Location = new System.Drawing.Point(167, 82); + this.cb_dont_start_if_running3.Name = "cb_dont_start_if_running3"; + this.cb_dont_start_if_running3.Size = new System.Drawing.Size(289, 24); + this.cb_dont_start_if_running3.TabIndex = 20; + this.cb_dont_start_if_running3.Text = "Don\'t start if program already running"; + this.cb_dont_start_if_running3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cb_dont_start_if_running3.UseVisualStyleBackColor = true; + this.cb_dont_start_if_running3.Visible = false; + // + // cb_dont_start_if_running4 + // + this.cb_dont_start_if_running4.AutoSize = true; + this.cb_dont_start_if_running4.ForeColor = System.Drawing.Color.White; + this.cb_dont_start_if_running4.Location = new System.Drawing.Point(167, 82); + this.cb_dont_start_if_running4.Name = "cb_dont_start_if_running4"; + this.cb_dont_start_if_running4.Size = new System.Drawing.Size(289, 24); + this.cb_dont_start_if_running4.TabIndex = 20; + this.cb_dont_start_if_running4.Text = "Don\'t start if program already running"; + this.cb_dont_start_if_running4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cb_dont_start_if_running4.UseVisualStyleBackColor = true; + this.cb_dont_start_if_running4.Visible = false; + // // ShortcutForm // this.AcceptButton = this.btn_save; @@ -1695,5 +1755,9 @@ namespace DisplayMagician.UIForms private System.Windows.Forms.RadioButton rb_switch_capture_permanent; private System.Windows.Forms.RadioButton rb_switch_capture_temp; private System.Windows.Forms.Label lbl_no_game_libraries; + private System.Windows.Forms.CheckBox cb_dont_start_if_running4; + private System.Windows.Forms.CheckBox cb_dont_start_if_running3; + private System.Windows.Forms.CheckBox cb_dont_start_if_running2; + private System.Windows.Forms.CheckBox cb_dont_start_if_running1; } } \ No newline at end of file diff --git a/DisplayMagician/UIForms/ShortcutForm.cs b/DisplayMagician/UIForms/ShortcutForm.cs index d985e4c..2bf6690 100644 --- a/DisplayMagician/UIForms/ShortcutForm.cs +++ b/DisplayMagician/UIForms/ShortcutForm.cs @@ -361,7 +361,8 @@ namespace DisplayMagician.UIForms Executable = txt_start_program1.Text, ExecutableArgumentsRequired = cb_start_program_pass_args1.Checked, Arguments = txt_start_program_args1.Text, - CloseOnFinish = cb_start_program_close1.Checked + CloseOnFinish = cb_start_program_close1.Checked, + DontStartIfAlreadyRunning = cb_dont_start_if_running1.Checked }; _startPrograms.Add(myStartProgram); @@ -372,7 +373,8 @@ namespace DisplayMagician.UIForms Enabled = cb_start_program2.Checked, ExecutableArgumentsRequired = cb_start_program_pass_args2.Checked, Arguments = txt_start_program_args2.Text, - CloseOnFinish = cb_start_program_close2.Checked + CloseOnFinish = cb_start_program_close2.Checked, + DontStartIfAlreadyRunning = cb_dont_start_if_running2.Checked }; _startPrograms.Add(myStartProgram); @@ -383,7 +385,8 @@ namespace DisplayMagician.UIForms Enabled = cb_start_program3.Checked, ExecutableArgumentsRequired = cb_start_program_pass_args3.Checked, Arguments = txt_start_program_args3.Text, - CloseOnFinish = cb_start_program_close3.Checked + CloseOnFinish = cb_start_program_close3.Checked, + DontStartIfAlreadyRunning = cb_dont_start_if_running3.Checked }; _startPrograms.Add(myStartProgram); @@ -394,7 +397,8 @@ namespace DisplayMagician.UIForms Enabled = cb_start_program4.Checked, ExecutableArgumentsRequired = cb_start_program_pass_args4.Checked, Arguments = txt_start_program_args4.Text, - CloseOnFinish = cb_start_program_close4.Checked + CloseOnFinish = cb_start_program_close4.Checked, + DontStartIfAlreadyRunning = cb_dont_start_if_running4.Checked }; _startPrograms.Add(myStartProgram); @@ -1007,6 +1011,7 @@ namespace DisplayMagician.UIForms cb_start_program_pass_args1.Checked = myStartProgram.ExecutableArgumentsRequired; txt_start_program_args1.Text = myStartProgram.Arguments; cb_start_program_close1.Checked = myStartProgram.CloseOnFinish; + cb_dont_start_if_running1.Checked = myStartProgram.DontStartIfAlreadyRunning; break; case 2: txt_start_program2.Text = myStartProgram.Executable; @@ -1014,6 +1019,7 @@ namespace DisplayMagician.UIForms cb_start_program_pass_args2.Checked = myStartProgram.ExecutableArgumentsRequired; txt_start_program_args2.Text = myStartProgram.Arguments; cb_start_program_close2.Checked = myStartProgram.CloseOnFinish; + cb_dont_start_if_running2.Checked = myStartProgram.DontStartIfAlreadyRunning; break; case 3: txt_start_program3.Text = myStartProgram.Executable; @@ -1021,6 +1027,7 @@ namespace DisplayMagician.UIForms cb_start_program_pass_args3.Checked = myStartProgram.ExecutableArgumentsRequired; txt_start_program_args3.Text = myStartProgram.Arguments; cb_start_program_close3.Checked = myStartProgram.CloseOnFinish; + cb_dont_start_if_running3.Checked = myStartProgram.DontStartIfAlreadyRunning; break; case 4: txt_start_program4.Text = myStartProgram.Executable; @@ -1028,6 +1035,7 @@ namespace DisplayMagician.UIForms cb_start_program_pass_args4.Checked = myStartProgram.ExecutableArgumentsRequired; txt_start_program_args4.Text = myStartProgram.Arguments; cb_start_program_close4.Checked = myStartProgram.CloseOnFinish; + cb_dont_start_if_running4.Checked = myStartProgram.DontStartIfAlreadyRunning; break; } @@ -1479,6 +1487,7 @@ namespace DisplayMagician.UIForms btn_start_program1.Visible = true; cb_start_program_pass_args1.Visible = true; cb_start_program_close1.Visible = true; + cb_dont_start_if_running1.Visible = true; } else { @@ -1487,6 +1496,7 @@ namespace DisplayMagician.UIForms btn_start_program1.Visible = false; cb_start_program_pass_args1.Visible = false; cb_start_program_close1.Visible = false; + cb_dont_start_if_running1.Visible = false; } } @@ -1502,6 +1512,7 @@ namespace DisplayMagician.UIForms btn_start_program2.Visible = true; cb_start_program_pass_args2.Visible = true; cb_start_program_close2.Visible = true; + cb_dont_start_if_running2.Visible = true; } else { @@ -1510,6 +1521,7 @@ namespace DisplayMagician.UIForms btn_start_program2.Visible = false; cb_start_program_pass_args2.Visible = false; cb_start_program_close2.Visible = false; + cb_dont_start_if_running2.Visible = false; } } @@ -1525,6 +1537,7 @@ namespace DisplayMagician.UIForms btn_start_program3.Visible = true; cb_start_program_pass_args3.Visible = true; cb_start_program_close3.Visible = true; + cb_dont_start_if_running3.Visible = true; } else { @@ -1533,6 +1546,7 @@ namespace DisplayMagician.UIForms btn_start_program3.Visible = false; cb_start_program_pass_args3.Visible = false; cb_start_program_close3.Visible = false; + cb_dont_start_if_running3.Visible = false; } } @@ -1548,6 +1562,7 @@ namespace DisplayMagician.UIForms btn_start_program4.Visible = true; cb_start_program_pass_args4.Visible = true; cb_start_program_close4.Visible = true; + cb_dont_start_if_running4.Visible = true; } else { @@ -1556,6 +1571,7 @@ namespace DisplayMagician.UIForms btn_start_program4.Visible = false; cb_start_program_pass_args4.Visible = false; cb_start_program_close4.Visible = false; + cb_dont_start_if_running4.Visible = false; } } diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.cs b/DisplayMagician/UIForms/ShortcutLibraryForm.cs index 1b32df9..e9f8969 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.cs +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.cs @@ -122,22 +122,29 @@ namespace DisplayMagician.UIForms // Set the Shortcut save folder to the Desktop as that's where people will want it most likely dialog_save.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); // Try to set up some sensible suggestions for the Shortcut name - if (_selectedShortcut.DisplayPermanence == ShortcutPermanence.Permanent) + if (_selectedShortcut.AutoName) { - - dialog_save.FileName = _selectedShortcut.Name; - } - else - { - if (_selectedShortcut.Category == ShortcutCategory.Application) + if (_selectedShortcut.DisplayPermanence == ShortcutPermanence.Permanent) { - dialog_save.FileName = String.Concat(Path.GetFileNameWithoutExtension(_selectedShortcut.ExecutableNameAndPath), @" (", _selectedShortcut.Name.ToLower(CultureInfo.InvariantCulture), @")"); + + dialog_save.FileName = _selectedShortcut.Name; } else { - dialog_save.FileName = _selectedShortcut.Name; + if (_selectedShortcut.Category == ShortcutCategory.Application) + { + dialog_save.FileName = String.Concat(Path.GetFileNameWithoutExtension(_selectedShortcut.ExecutableNameAndPath), @" (", _selectedShortcut.Name.ToLower(CultureInfo.InvariantCulture), @")"); + } + else + { + dialog_save.FileName = _selectedShortcut.Name; + } } } + else + { + dialog_save.FileName = _selectedShortcut.Name; + } // Show the Save Shortcut window if (dialog_save.ShowDialog(this) == DialogResult.OK) From 5e9c02aa68f7e8e0f638e212ee68578603dae2df Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 21:38:16 +1300 Subject: [PATCH 5/8] Fixed the notify icon when minimised When the notifyicon was minimised we had problems as it would close the main window when trying to update the icon text. This is fixed now. --- .../UIForms/ShortcutLibraryForm.cs | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.cs b/DisplayMagician/UIForms/ShortcutLibraryForm.cs index e9f8969..a6c06a0 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.cs +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.cs @@ -319,19 +319,25 @@ namespace DisplayMagician.UIForms else if (_selectedShortcut.Category.Equals(ShortcutCategory.Game)) message = $"Running the {_selectedShortcut.GameName} game and waiting until you close it."; - // Create a MaskForm that will cover the ShortcutLibrary Window to lock - // the controls and inform the user that the game is running.... - MaskedForm maskedForm = MaskedForm.Show(this, message); - - // Get the MainForm so we can access the NotifyIcon on it. - MainForm mainForm = (MainForm)this.Owner; - - // Run the shortcut - ShortcutRepository.RunShortcut(_selectedShortcut, mainForm.notifyIcon); - - // Only do this if we are NOT minimised if (!Program.AppProgramSettings.MinimiseOnStart) + { + // Create a MaskForm that will cover the ShortcutLibrary Window to lock + // the controls and inform the user that the game is running.... + MaskedForm maskedForm = MaskedForm.Show(this, message); + + // Get the MainForm so we can access the NotifyIcon on it. + MainForm mainForm = (MainForm)this.Owner; + + // Run the shortcut + ShortcutRepository.RunShortcut(_selectedShortcut, mainForm.notifyIcon); + maskedForm.Close(); + } + else + { + // Run the shortcut + ShortcutRepository.RunShortcut(_selectedShortcut, Program.AppMainForm.notifyIcon); + } } private void ilv_saved_shortcuts_ItemHover(object sender, ItemHoverEventArgs e) From 4a1a73a30fea7650694f9a3735169793c359927b Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 22:28:18 +1300 Subject: [PATCH 6/8] Update Setup so upgrades Setup should now automatically uninstall any earlier versions of DisplayMagician --- DisplayMagicianSetup/Product.wxs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/DisplayMagicianSetup/Product.wxs b/DisplayMagicianSetup/Product.wxs index e7ea3f0..71ea4b9 100644 --- a/DisplayMagicianSetup/Product.wxs +++ b/DisplayMagicianSetup/Product.wxs @@ -14,11 +14,14 @@ - - + + + + NOT NEWER_VERSION_FOUND + + 1 1 - LicenseAcceptedOverwritten = "1" AND NOT OLDER_VERSION_FOUND + + LicenseAcceptedOverwritten = "1" 1 @@ -131,6 +135,7 @@ + NOT Installed (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") From 4424f2620780deefaf31e0fcb2e0a7736d0703ab Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 22:34:22 +1300 Subject: [PATCH 7/8] Added iWSH Shell Interop This allows DisplayMagician to write a shortcut to desktop. It was missing in the setup installer. --- .../Fragments/DisplayMagicianFilesFragment.wxs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DisplayMagicianSetup/Fragments/DisplayMagicianFilesFragment.wxs b/DisplayMagicianSetup/Fragments/DisplayMagicianFilesFragment.wxs index ce1c523..bbfc0f3 100644 --- a/DisplayMagicianSetup/Fragments/DisplayMagicianFilesFragment.wxs +++ b/DisplayMagicianSetup/Fragments/DisplayMagicianFilesFragment.wxs @@ -56,7 +56,10 @@ - + + + + @@ -231,7 +234,8 @@ - + + From 6e53970f4eed12492691ae7cfd502fffddcfbae8 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Wed, 17 Mar 2021 22:36:33 +1300 Subject: [PATCH 8/8] Updated the installer hash --- docs/update/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/update/index.json b/docs/update/index.json index 7f1c57a..ffcb19f 100644 --- a/docs/update/index.json +++ b/docs/update/index.json @@ -8,7 +8,7 @@ "mode": 0 }, "checksum": { - "value": "01F596F7D096285E32C48EC2B71019360732DF56D6A0CA784D4653F75A9B2CCF", + "value": "78067AE8F7F28101CB530110CFBF2AD9C47B809DC5D7365D4BD413D63D314FAC", "hashingAlgorithm": "SHA256" } } \ No newline at end of file