diff --git a/MyOwnDSMShortcuts/.vs/Mods/v14/.suo b/MyOwnDSMShortcuts/.vs/Mods/v14/.suo index 75788a7..b1b2263 100644 Binary files a/MyOwnDSMShortcuts/.vs/Mods/v14/.suo and b/MyOwnDSMShortcuts/.vs/Mods/v14/.suo differ diff --git a/MyOwnDSMShortcuts/MainForm.Designer.cs b/MyOwnDSMShortcuts/MainForm.Designer.cs index 902d2b4..0d6cfce 100644 --- a/MyOwnDSMShortcuts/MainForm.Designer.cs +++ b/MyOwnDSMShortcuts/MainForm.Designer.cs @@ -92,6 +92,9 @@ private void InitializeComponent() this.checkBoxAdvanceGrantPrivilege = new System.Windows.Forms.CheckBox(); this.ComboBoxGrantPrivilege = new System.Windows.Forms.ComboBox(); this.checkBoxLegacy = new System.Windows.Forms.CheckBox(); + this.checkBoxSupportCenter = new System.Windows.Forms.CheckBox(); + this.checkBoxRemovable = new System.Windows.Forms.CheckBox(); + this.textBoxLatestFirmware = new System.Windows.Forms.TextBox(); this.openFileDialog4Mods = new System.Windows.Forms.OpenFileDialog(); this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); this.labelDescription = new System.Windows.Forms.Label(); @@ -103,6 +106,7 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.labelDSMAppName = new System.Windows.Forms.Label(); this.groupBoxPackage = new System.Windows.Forms.GroupBox(); + this.labelLatestFirmware = new System.Windows.Forms.Label(); this.labelModel = new System.Windows.Forms.Label(); this.labelExcludeArch = new System.Windows.Forms.Label(); this.labelSupportUrl = new System.Windows.Forms.Label(); @@ -158,10 +162,6 @@ private void InitializeComponent() this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBoxTip = new System.Windows.Forms.GroupBox(); this.labelToolTip = new System.Windows.Forms.Label(); - this.checkBoxSupportCenter = new System.Windows.Forms.CheckBox(); - this.checkBoxRemovable = new System.Windows.Forms.CheckBox(); - this.labelLatestFirmware = new System.Windows.Forms.Label(); - this.textBoxLatestFirmware = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox_256)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox_128)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox_96)).BeginInit(); @@ -914,7 +914,7 @@ private void InitializeComponent() this.checkBoxStartable.Name = "checkBoxStartable"; this.checkBoxStartable.Size = new System.Drawing.Size(68, 17); this.checkBoxStartable.TabIndex = 19; - this.checkBoxStartable.Tag = "PKGstartable;PKGctl_stop"; + this.checkBoxStartable.Tag = "PKGstartable;PKGctl_stop;DEFyes"; this.checkBoxStartable.Text = "Startable"; this.toolTip4Mods.SetToolTip(this.checkBoxStartable, "If this option is not selected, the end-user cannot start or stop the package in " + "Package Center.\r\nNote: If not selected, start-stop-status script which runs in b" + @@ -993,6 +993,48 @@ private void InitializeComponent() this.checkBoxLegacy.UseVisualStyleBackColor = true; this.checkBoxLegacy.CheckedChanged += new System.EventHandler(this.checkBoxLegacy_CheckedChanged); // + // checkBoxSupportCenter + // + this.checkBoxSupportCenter.AutoSize = true; + this.checkBoxSupportCenter.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.checkBoxSupportCenter.Location = new System.Drawing.Point(19, 233); + this.checkBoxSupportCenter.Name = "checkBoxSupportCenter"; + this.checkBoxSupportCenter.Size = new System.Drawing.Size(97, 17); + this.checkBoxSupportCenter.TabIndex = 11; + this.checkBoxSupportCenter.Tag = "PKGSupport_center"; + this.checkBoxSupportCenter.Text = "Support Center"; + this.toolTip4Mods.SetToolTip(this.checkBoxSupportCenter, resources.GetString("checkBoxSupportCenter.ToolTip")); + this.checkBoxSupportCenter.UseVisualStyleBackColor = true; + this.checkBoxSupportCenter.CheckedChanged += new System.EventHandler(this.checkBoxSupportCenter_CheckedChanged); + // + // checkBoxRemovable + // + this.checkBoxRemovable.AutoSize = true; + this.checkBoxRemovable.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.checkBoxRemovable.Checked = true; + this.checkBoxRemovable.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxRemovable.Location = new System.Drawing.Point(729, 48); + this.checkBoxRemovable.Name = "checkBoxRemovable"; + this.checkBoxRemovable.Size = new System.Drawing.Size(80, 17); + this.checkBoxRemovable.TabIndex = 20; + this.checkBoxRemovable.Tag = "PKGctl_uninstall;DEFyes"; + this.checkBoxRemovable.Text = "Removable"; + this.toolTip4Mods.SetToolTip(this.checkBoxRemovable, "If this option is deselected, the end-user cannot uninstall the package in Packag" + + "e Center."); + this.checkBoxRemovable.UseVisualStyleBackColor = true; + // + // textBoxLatestFirmware + // + this.textBoxLatestFirmware.Location = new System.Drawing.Point(738, 231); + this.textBoxLatestFirmware.Name = "textBoxLatestFirmware"; + this.textBoxLatestFirmware.Size = new System.Drawing.Size(73, 20); + this.textBoxLatestFirmware.TabIndex = 27; + this.textBoxLatestFirmware.Tag = "PKGos_max_ver"; + this.toolTip4Mods.SetToolTip(this.textBoxLatestFirmware, "Latest version of DSM firmware that is able to run the package.\r\n Value: X.Y-Z DS" + + "M major number, DSM minor number, DSM build number"); + this.textBoxLatestFirmware.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxLatestFirmware_Validating); + this.textBoxLatestFirmware.Validated += new System.EventHandler(this.textBoxLatestFirmware_Validated); + // // openFileDialog4Mods // this.openFileDialog4Mods.Filter = "Png|*.png"; @@ -1138,6 +1180,15 @@ private void InitializeComponent() this.groupBoxPackage.TabStop = false; this.groupBoxPackage.Text = "PACKAGE INFORMATION"; // + // labelLatestFirmware + // + this.labelLatestFirmware.AutoSize = true; + this.labelLatestFirmware.Location = new System.Drawing.Point(646, 235); + this.labelLatestFirmware.Name = "labelLatestFirmware"; + this.labelLatestFirmware.Size = new System.Drawing.Size(84, 13); + this.labelLatestFirmware.TabIndex = 74; + this.labelLatestFirmware.Text = "Latest Firmware:"; + // // labelModel // this.labelModel.AutoSize = true; @@ -1678,57 +1729,6 @@ private void InitializeComponent() this.labelToolTip.TabIndex = 24; this.labelToolTip.UseMnemonic = false; // - // checkBoxSupportCenter - // - this.checkBoxSupportCenter.AutoSize = true; - this.checkBoxSupportCenter.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; - this.checkBoxSupportCenter.Location = new System.Drawing.Point(19, 233); - this.checkBoxSupportCenter.Name = "checkBoxSupportCenter"; - this.checkBoxSupportCenter.Size = new System.Drawing.Size(97, 17); - this.checkBoxSupportCenter.TabIndex = 11; - this.checkBoxSupportCenter.Tag = "PKGSupport_center"; - this.checkBoxSupportCenter.Text = "Support Center"; - this.toolTip4Mods.SetToolTip(this.checkBoxSupportCenter, resources.GetString("checkBoxSupportCenter.ToolTip")); - this.checkBoxSupportCenter.UseVisualStyleBackColor = true; - this.checkBoxSupportCenter.CheckedChanged += new System.EventHandler(this.checkBoxSupportCenter_CheckedChanged); - // - // checkBoxRemovable - // - this.checkBoxRemovable.AutoSize = true; - this.checkBoxRemovable.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; - this.checkBoxRemovable.Checked = true; - this.checkBoxRemovable.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxRemovable.Location = new System.Drawing.Point(729, 48); - this.checkBoxRemovable.Name = "checkBoxRemovable"; - this.checkBoxRemovable.Size = new System.Drawing.Size(80, 17); - this.checkBoxRemovable.TabIndex = 20; - this.checkBoxRemovable.Tag = "PKGctl_uninstall"; - this.checkBoxRemovable.Text = "Removable"; - this.toolTip4Mods.SetToolTip(this.checkBoxRemovable, "If this option is deselected, the end-user cannot uninstall the package in Packag" + - "e Center."); - this.checkBoxRemovable.UseVisualStyleBackColor = true; - // - // labelLatestFirmware - // - this.labelLatestFirmware.AutoSize = true; - this.labelLatestFirmware.Location = new System.Drawing.Point(646, 235); - this.labelLatestFirmware.Name = "labelLatestFirmware"; - this.labelLatestFirmware.Size = new System.Drawing.Size(84, 13); - this.labelLatestFirmware.TabIndex = 74; - this.labelLatestFirmware.Text = "Latest Firmware:"; - // - // textBoxLatestFirmware - // - this.textBoxLatestFirmware.Location = new System.Drawing.Point(738, 231); - this.textBoxLatestFirmware.Name = "textBoxLatestFirmware"; - this.textBoxLatestFirmware.Size = new System.Drawing.Size(73, 20); - this.textBoxLatestFirmware.TabIndex = 27; - this.textBoxLatestFirmware.Tag = "PKGos_max_ver"; - this.toolTip4Mods.SetToolTip(this.textBoxLatestFirmware, "Latest version of DSM firmware that is able to run the package.\r\n Value: X.Y-Z DS" + - "M major number, DSM minor number, DSM build number"); - this.textBoxLatestFirmware.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxLatestFirmware_Validating); - this.textBoxLatestFirmware.Validated += new System.EventHandler(this.textBoxLatestFirmware_Validated); - // // MainForm // this.AllowDrop = true; diff --git a/MyOwnDSMShortcuts/MainForm.cs b/MyOwnDSMShortcuts/MainForm.cs index a05e40b..c414e65 100644 --- a/MyOwnDSMShortcuts/MainForm.cs +++ b/MyOwnDSMShortcuts/MainForm.cs @@ -515,6 +515,7 @@ private void FillInfoScreen(string path) { if (info != null) { + string subkey; var unused = new List(info.Keys); foreach (var control in groupBoxPackage.Controls) { @@ -525,12 +526,15 @@ private void FillInfoScreen(string path) textBox.Text = ""; foreach (var key in keys) { - var subkey = key.Substring(3); - if (info.Keys.Contains(subkey)) + if (key.StartsWith("PKG")) { - if (string.IsNullOrEmpty(textBox.Text)) - textBox.Text = info[subkey]; - unused.Remove(subkey); + subkey = key.Substring(3); + if (info.Keys.Contains(subkey)) + { + if (string.IsNullOrEmpty(textBox.Text)) + textBox.Text = info[subkey]; + unused.Remove(subkey); + } } } } @@ -541,14 +545,20 @@ private void FillInfoScreen(string path) var keys = checkBox.Tag.ToString().Split(';'); foreach (var key in keys) { - var val = key.Substring(3); - if (info.Keys.Contains(val)) + subkey = key.Substring(3); + if (key.StartsWith("PKG")) + { + if (info.Keys.Contains(subkey)) + { + unused.Remove(subkey); + tick = (info[subkey] == "yes"); + } + } + if (key.StartsWith("DEF")) { - unused.Remove(val); - tick = info[val] == "yes"; + tick = (subkey == "yes"); } } - checkBox.Checked = tick; } } @@ -568,9 +578,7 @@ private void FillInfoScreen(string path) unused.Remove("dsmuidir"); unused.Remove("checksum"); unused.Remove("adminport");//Not yet supported but ignored - //unused.Remove("arch"); unused.Remove("reloadui");//Not yet supported but ignored - unused.Remove("startable");//Not yet supported but ignored unused.Remove("thirdparty");//Not yet supported but ignored unused.Remove("startstop_restart_services");//Not yet supported but ignored @@ -684,11 +692,14 @@ private void SavePackageInfo(string path) var keys = textBox.Tag.ToString().Split(';'); foreach (var key in keys) { - var keyId = key.Substring(3); - if (info.Keys.Contains(keyId)) - info[keyId] = textBox.Text.Trim(); - else - info.Add(keyId, textBox.Text.Trim()); + if (key.StartsWith("PKG")) + { + var keyId = key.Substring(3); + if (info.Keys.Contains(keyId)) + info[keyId] = textBox.Text.Trim(); + else + info.Add(keyId, textBox.Text.Trim()); + } } } var checkBox = control as CheckBox; @@ -697,12 +708,15 @@ private void SavePackageInfo(string path) var keys = checkBox.Tag.ToString().Split(';'); foreach (var key in keys) { - var keyId = key.Substring(3); - var value = checkBox.Checked ? "yes" : "no"; - if (info.Keys.Contains(keyId)) - info[keyId] = value; - else - info.Add(keyId, value); + if (key.StartsWith("PKG")) + { + var keyId = key.Substring(3); + var value = checkBox.Checked ? "yes" : "no"; + if (info.Keys.Contains(keyId)) + info[keyId] = value; + else + info.Add(keyId, value); + } } } } @@ -717,7 +731,10 @@ private void SavePackageInfo(string path) { foreach (var element in info) { - outputFile.WriteLine("{0}=\"{1}\"", element.Key, element.Value); + if (!string.IsNullOrEmpty(element.Value)) + { + outputFile.WriteLine("{0}=\"{1}\"", element.Key, element.Value); + } } } @@ -2340,7 +2357,7 @@ private void textBoxDsmAppName_Validating(object sender, CancelEventArgs e) { if (!CheckEmpty(textBoxDsmAppName, ref e)) { - var name = textBoxDsmAppName.Text.Replace(".", "_").Replace("__","_"); + var name = textBoxDsmAppName.Text.Replace(".", "_").Replace("__", "_"); var cleaned = Helper.CleanUpText(textBoxDsmAppName.Text); if (name != cleaned) { @@ -2640,12 +2657,26 @@ private bool CheckChanges() if (textBox != null && textBox.Tag != null && textBox.Tag.ToString().StartsWith("PKG")) { var keys = textBox.Tag.ToString().Split(';'); - var key = keys[0].Substring(3); + var key = keys[0].Substring(3); if (info.ContainsKey(key)) { dirty = textBox.Text != info[key]; + if (dirty) + break; + } + } + var checkBox = control as CheckBox; + if (checkBox != null && checkBox.Tag != null && checkBox.Tag.ToString().StartsWith("PKG")) + { + var keys = checkBox.Tag.ToString().Split(';'); + var key = keys[0].Substring(3); + + if (info.ContainsKey(key)) + { + dirty = checkBox.Checked != (info[key] == "yes"); + if (dirty) break; } diff --git a/MyOwnDSMShortcuts/MainForm.resx b/MyOwnDSMShortcuts/MainForm.resx index 5836f6e..359eaf5 100644 --- a/MyOwnDSMShortcuts/MainForm.resx +++ b/MyOwnDSMShortcuts/MainForm.resx @@ -158,16 +158,16 @@ All: this app can be selected for all users. When you select this option, urls will be opened in a DSM window instead of being opened in a new tab. However, this only works if you have disabled DSM's security option 'Improve security with HTTP Content Security Policy (CSP) header' + + Check this option to let Package Center displays a link to make the end user launch Synology Support Center Application when your package is installed. +The report_url link won’t show in Package Center. + 297, 17 468, 17 - - Check this option to let Package Center displays a link to make the end user launch Synology Support Center Application when your package is installed. -The report_url link won’t show in Package Center. - 17, 17 diff --git a/MyOwnDSMShortcuts/bin/Debug/Mods.exe b/MyOwnDSMShortcuts/bin/Debug/Mods.exe index 4150314..f794000 100644 Binary files a/MyOwnDSMShortcuts/bin/Debug/Mods.exe and b/MyOwnDSMShortcuts/bin/Debug/Mods.exe differ diff --git a/MyOwnDSMShortcuts/bin/Debug/Mods.pdb b/MyOwnDSMShortcuts/bin/Debug/Mods.pdb index d939991..2ff5bd0 100644 Binary files a/MyOwnDSMShortcuts/bin/Debug/Mods.pdb and b/MyOwnDSMShortcuts/bin/Debug/Mods.pdb differ diff --git a/MyOwnDSMShortcuts/bin/Release.zip b/MyOwnDSMShortcuts/bin/Release.zip index 8f7749b..f12322d 100644 Binary files a/MyOwnDSMShortcuts/bin/Release.zip and b/MyOwnDSMShortcuts/bin/Release.zip differ diff --git a/MyOwnDSMShortcuts/obj/Debug/Mods.csproj.GenerateResource.Cache b/MyOwnDSMShortcuts/obj/Debug/Mods.csproj.GenerateResource.Cache index 84eb55a..e28b60f 100644 Binary files a/MyOwnDSMShortcuts/obj/Debug/Mods.csproj.GenerateResource.Cache and b/MyOwnDSMShortcuts/obj/Debug/Mods.csproj.GenerateResource.Cache differ diff --git a/MyOwnDSMShortcuts/obj/Debug/Mods.exe b/MyOwnDSMShortcuts/obj/Debug/Mods.exe index 4150314..f794000 100644 Binary files a/MyOwnDSMShortcuts/obj/Debug/Mods.exe and b/MyOwnDSMShortcuts/obj/Debug/Mods.exe differ diff --git a/MyOwnDSMShortcuts/obj/Debug/Mods.pdb b/MyOwnDSMShortcuts/obj/Debug/Mods.pdb index d939991..2ff5bd0 100644 Binary files a/MyOwnDSMShortcuts/obj/Debug/Mods.pdb and b/MyOwnDSMShortcuts/obj/Debug/Mods.pdb differ