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/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/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/ShortcutForm.Designer.cs b/DisplayMagician/UIForms/ShortcutForm.Designer.cs index c2e9d7b..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; @@ -691,9 +696,11 @@ 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 // + 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); @@ -727,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; @@ -779,9 +786,11 @@ 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 // + 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); @@ -815,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; @@ -867,9 +876,11 @@ 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 // + 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); @@ -903,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; @@ -955,6 +966,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 // @@ -1513,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; @@ -1691,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 95a7ab2..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; } } @@ -1997,5 +2013,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 c3b47ac..a6c06a0 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) @@ -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) @@ -160,7 +167,7 @@ namespace DisplayMagician.UIForms } dialog_save.FileName = string.Empty; - DialogResult = DialogResult.OK; + //DialogResult = DialogResult.OK; } } catch (Exception ex) @@ -312,18 +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); + 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; + // Get the MainForm so we can access the NotifyIcon on it. + MainForm mainForm = (MainForm)this.Owner; + // Run the shortcut + ShortcutRepository.RunShortcut(_selectedShortcut, mainForm.notifyIcon); - // Run the shortcut - ShortcutRepository.RunShortcut(_selectedShortcut, mainForm.notifyIcon); - - maskedForm.Close(); + maskedForm.Close(); + } + else + { + // Run the shortcut + ShortcutRepository.RunShortcut(_selectedShortcut, Program.AppMainForm.notifyIcon); + } } private void ilv_saved_shortcuts_ItemHover(object sender, ItemHoverEventArgs e) 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/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 @@ - + + 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/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") 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 734032d..410d5dd 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, @@ -8,7 +8,7 @@ "mode": 0 }, "checksum": { - "value": "01F596F7D096285E32C48EC2B71019360732DF56D6A0CA784D4653F75A9B2CCF", + "value": "78067AE8F7F28101CB530110CFBF2AD9C47B809DC5D7365D4BD413D63D314FAC", "hashingAlgorithm": "SHA256" } }