CurrentMedia |
-RABWAEQALQA1AAEARQB4AHAAcgBlAHMAcwA=
+ CurrentMedia |
+QwBEAF8AUgBPAE0AAQBFAHgAcAByAGUAcwBzAA==
|
DefaultProductConfiguration | Express |
EnableSwidtag | 0 |
@@ -4003,7 +4008,7 @@ RABWAEQALQA1AAEARQB4AHAAcgBlAHMAcwA=
ISTheme | InstallShield Blue.theme |
ISUSLock | {6514ECB8-B8DB-4268-AB81-00F88F64F54B} |
ISUSSignature | {6E03227C-024D-4572-92B1-9486B0022884} |
- ISVisitedViews | viewAssistant,viewProject,viewISToday,viewLearnMore,viewRelease,viewSystemSearch,viewUI,viewServices,viewAppFiles,viewObjects,viewShortcuts,viewTextMessages,viewUpgradePaths |
+ ISVisitedViews | viewAssistant,viewProject,viewISToday,viewLearnMore,viewRelease,viewSystemSearch,viewUI,viewServices,viewAppFiles,viewObjects,viewShortcuts,viewTextMessages,viewUpgradePaths,viewUpdateService,viewIniFiles,viewFileExtensions,viewEnvironmentVariables,viewRegistry,viewCustomActions |
Limited | 1 |
LockPermissionMode | 1 |
MsiExecCmdLineOptions | |
@@ -4062,7 +4067,6 @@ RABWAEQALQA1AAEARQB4AHAAcgBlAHMAcwA=
Condition
Description
- (Not Version9X) And (Not ((VersionNT>=400 And VersionNT<=600) Or (VersionNT>=601 And VersionNT<=603 And MsiNTProductType>1))) | ##IDPROP_EXPRESS_LAUNCH_CONDITION_OS## |
DOTNETVERSION45FULL>="#1" | ##IDPROP_EXPRESS_LAUNCH_CONDITION_DOTNETVERSION45FULL## |
@@ -4383,7 +4387,7 @@ RABWAEQALQA1AAEARQB4AHAAcgBlAHMAcwA=
PROGRAMFILETOLAUNCHATEND | [INSTALLDIR]Mods.Primary output | |
ProductCode | {4D6A4347-3372-4B79-9AD6-B7A0632892B9} | |
ProductName | Mods Packager | |
- ProductVersion | 7.01.0000 | |
+ ProductVersion | 7.02.0000 | |
ProgressType0 | install | |
ProgressType1 | Installing | |
ProgressType2 | installed | |
diff --git a/Installer/Installer/Express/SingleImage/DiskImages/DISK1/setup.exe b/Installer/Installer/Express/SingleImage/DiskImages/DISK1/setup.exe
deleted file mode 100644
index b580c39..0000000
Binary files a/Installer/Installer/Express/SingleImage/DiskImages/DISK1/setup.exe and /dev/null differ
diff --git a/Installer/Installer/Express/SingleImage/LogFiles/11-10-2018 07-10-22.txt b/Installer/Installer/Express/SingleImage/LogFiles/11-10-2018 07-10-22.txt
deleted file mode 100644
index 4925bd0..0000000
Binary files a/Installer/Installer/Express/SingleImage/LogFiles/11-10-2018 07-10-22.txt and /dev/null differ
diff --git a/Installer/Installer/Express/SingleImage/Reports/11-10-2018 07-10-29.htm b/Installer/Installer/Express/SingleImage/Reports/11-10-2018 07-10-29.htm
deleted file mode 100644
index cb14333..0000000
--- a/Installer/Installer/Express/SingleImage/Reports/11-10-2018 07-10-29.htm
+++ /dev/null
@@ -1,727 +0,0 @@
-Build Report
-
-
-Build Report
-
-
-Summary
-
-
-
-
-
-
-
-Number of features:
- |
-
-
-
-1
- |
-
-
-
-
-
-
-
-Number of merge modules:
- |
-
-
-
-0
- |
-
-
-
-
-
-
-
-Number of dynamic links:
- |
-
-
-
-0
- |
-
-
-
-
-
-
-
-Media:
- |
-
-
-
-SingleImage
- |
-
-
-
-
-
-
-
-Number of files:
- |
-
-
-
-16
- |
-
-
-
-
-
-
-
-Uncompressed files total size:
- |
-
-
-
-0.00 MB
- |
-
-
-
-
-
-
-
-Compressed files total size:
- |
-
-
-
-0.00 MB
- |
-
-
-
-
-
-
-Features
-
-
-
-
-
-
-
-AlwaysInstall
- |
-
-
-
-
-
-
-Merge Modules
-
-
-
-
-Dynamic links
-
-
-
-
-Files
-
-
-
-
-
-
-
-File
- |
-
-
-
-Destination
- |
-
-
-
-Feature
- |
-
-
-
-Last Modified
- |
-
-
-
-Size (bytes)
- |
-
-
-
-Version
- |
-
-
-
-
-
-
-
-HelpSynoWizard.csv
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-20-04-17 20:43:14
- |
-
-
-
-9216
- |
-
-
-
-
- |
-
-
-
-
-
-
-
-Pack.cmd
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-04-01-18 21:17:53
- |
-
-
-
-516
- |
-
-
-
-
- |
-
-
-
-
-
-
-
-Package.zip
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-31-12-17 11:44:23
- |
-
-
-
-65882
- |
-
-
-
-
- |
-
-
-
-
-
-
-
-Unpack.cmd
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-02-05-17 01:04:42
- |
-
-
-
-419
- |
-
-
-
-
- |
-
-
-
-
-
-
-
-synology_models.yaml
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-18-11-17 22:26:02
- |
-
-
-
-3513
- |
-
-
-
-
- |
-
-
-
-
-
-
-
-synology_services.yaml
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-31-12-17 19:07:39
- |
-
-
-
-375
- |
-
-
-
-
- |
-
-
-
-
-
-
-
-7z.dll
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-20-04-17 20:43:14
- |
-
-
-
-1606656
- |
-
-
-
-16.2.0.0
- |
-
-
-
-
-
-
-
-7z.exe
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager\Resources
- |
-
-
-
-Always Install
- |
-
-
-
-20-04-17 20:43:14
- |
-
-
-
-448000
- |
-
-
-
-16.2.0.0
- |
-
-
-
-
-
-
-
-Mods.exe
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-10-11-18 19:10:22
- |
-
-
-
-1527808
- |
-
-
-
-7.1.0.0
- |
-
-
-
-
-
-
-
-Mods.exe.config
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-10-11-18 17:03:04
- |
-
-
-
-5450
- |
-
-
-
-
- |
-
-
-
-
-
-
-
-BouncyCastle.Crypto.dll
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-25-01-16 07:17:06
- |
-
-
-
-2236416
- |
-
-
-
-1.8.15362.1
- |
-
-
-
-
-
-
-
-Magick.NET-Q16-AnyCPU.dll
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-05-12-17 21:46:44
- |
-
-
-
-12818488
- |
-
-
-
-7.2.1.0
- |
-
-
-
-
-
-
-
-Newtonsoft.Json.dll
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-18-06-17 12:57:10
- |
-
-
-
-653824
- |
-
-
-
-10.0.3.21018
- |
-
-
-
-
-
-
-
-ScintillaNET.dll
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-18-02-17 17:02:08
- |
-
-
-
-1368064
- |
-
-
-
-3.6.3.0
- |
-
-
-
-
-
-
-
-YamlDotNet.dll
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-18-12-17 03:19:12
- |
-
-
-
-185344
- |
-
-
-
-4.2.3.0
- |
-
-
-
-
-
-
-
-ZTn.Json.Editor.dll
- |
-
-
-
-[ProgramFilesFolder]BeatificaBytes\Mods Packager
- |
-
-
-
-Always Install
- |
-
-
-
-10-11-18 19:10:21
- |
-
-
-
-202240
- |
-
-
-
-1.3.3.0
- |
-
-
-
-
-
-
-
diff --git a/Json Editor/Forms/JsonEditorMainForm.cs b/Json Editor/Forms/JsonEditorMainForm.cs
index 98c19e5..b13f387 100644
--- a/Json Editor/Forms/JsonEditorMainForm.cs
+++ b/Json Editor/Forms/JsonEditorMainForm.cs
@@ -36,6 +36,8 @@ public sealed partial class JsonEditorMainForm : Form
private bool validJSon = true;
+ private string originalJson = string.Empty;
+
#endregion
#region >> Properties
@@ -51,6 +53,9 @@ public void OpenFile(string path)
if (string.IsNullOrEmpty(json))
{
CreateEmptyJson(path);
+ } else
+ {
+ originalJson = json;
}
OpenJson(path);
}
@@ -93,7 +98,7 @@ private void ExpandWizardNodes(TreeNode node)
private void CreateEmptyJson(string path)
{
var jsonEditorItem = new JTokenRoot("[]");
- File.WriteAllText(path, jsonEditorItem.JTokenValue.ToString());
+ Helper.WriteAnsiFile(path, jsonEditorItem.JTokenValue.ToString());
}
///
@@ -463,6 +468,7 @@ private void buttonOk_Click(object sender, EventArgs e)
{
if (OpenedFileName == null)
{
+ DialogResult = DialogResult.Cancel;
return;
}
@@ -478,6 +484,14 @@ private void buttonOk_Click(object sender, EventArgs e)
{
JsonEditorItem.Save(stream);
}
+
+ SetActionStatus(@"Wizard successfully saved.", false);
+
+ string json = File.ReadAllText(OpenedFileName);
+ if (json != originalJson)
+ DialogResult = DialogResult.OK;
+ else
+ DialogResult = DialogResult.Cancel;
}
catch
{
@@ -486,19 +500,18 @@ private void buttonOk_Click(object sender, EventArgs e)
OpenedFileName = null;
SetActionStatus(@"Wizard NOT saved.", true);
- return;
+ DialogResult = DialogResult.Cancel;
}
-
- SetActionStatus(@"Wizard successfully saved.", false);
- this.DialogResult = DialogResult.OK;
- this.Close();
+ } else
+ {
+ DialogResult = DialogResult.Cancel;
}
}
private void buttonCancel_Click(object sender, EventArgs e)
{
- this.DialogResult = DialogResult.Cancel;
- this.Close();
+ DialogResult = DialogResult.Cancel;
+ //this.Close();
}
private void wizardDevGuideToolStripMenuItem_Click(object sender, EventArgs e)
@@ -975,8 +988,6 @@ private void buttonNext_Click(object sender, EventArgs e)
private void JsonEditorMainForm_FormClosing(object sender, FormClosingEventArgs e)
{
- if (this.DialogResult != DialogResult.Cancel)
- buttonCancel_Click(sender, e);
}
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
@@ -985,7 +996,7 @@ private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
File.Delete(OpenedFileName);
this.DialogResult = DialogResult.OK;
- this.Close();
+ //this.Close();
}
}
}
diff --git a/Json Editor/Helper.cs b/Json Editor/Helper.cs
index 9981201..962607a 100644
--- a/Json Editor/Helper.cs
+++ b/Json Editor/Helper.cs
@@ -71,5 +71,18 @@ internal static string GetSubItemType(string type)
}
return subitemType;
}
+
+ public static void WriteAnsiFile(string path, string content)
+ {
+ if (string.IsNullOrEmpty(content))
+ content = string.Empty;
+ else
+ content = content.Replace("\r\n", "\n");
+
+ using (TextWriter text = new StreamWriter(path, false, Encoding.GetEncoding(1252)))
+ {
+ text.Write(content);
+ }
+ }
}
}
diff --git a/Json Editor/JTokenRoot.cs b/Json Editor/JTokenRoot.cs
index 070f697..43d08c9 100644
--- a/Json Editor/JTokenRoot.cs
+++ b/Json Editor/JTokenRoot.cs
@@ -2,6 +2,7 @@
using Newtonsoft.Json.Linq;
using System.IO;
using System.Windows.Forms;
+using System.Text;
namespace ZTn.Json.Editor
{
@@ -102,14 +103,14 @@ public void Save(Stream jsonStream)
return;
}
- var json = jTokenValue.ToString();
+ var json = jTokenValue.ToString().Replace("\r\n","\n");
DialogResult response = DialogResult.Yes;
if (string.IsNullOrEmpty(json) || json == "[]")
response = MessageBox.Show(Application.OpenForms[0], "This wizard is empty, incomplete or incorrect. Do you really want to save it ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
if (response == DialogResult.Yes)
{
- using (var streamWriter = new StreamWriter(jsonStream))
+ using (var streamWriter = new StreamWriter(jsonStream, Encoding.GetEncoding(1252)))
{
streamWriter.Write(json);
}
diff --git a/Mods/Data/ScriptInfo.cs b/Mods/Data/ScriptInfo.cs
index 7728815..410b3e6 100644
--- a/Mods/Data/ScriptInfo.cs
+++ b/Mods/Data/ScriptInfo.cs
@@ -24,7 +24,7 @@ public string Code
{
get
{
- if (code != null) code = code.Replace("\r\n", "\n");
+ //if (!string.IsNullOrEmpty(code)) code = code.Replace("\r\n", "\n");
return code;
}
diff --git a/Mods/Forms/MainForm.Designer.cs b/Mods/Forms/MainForm.Designer.cs
index 542efa8..f061640 100644
--- a/Mods/Forms/MainForm.Designer.cs
+++ b/Mods/Forms/MainForm.Designer.cs
@@ -147,13 +147,13 @@ private void InitializeComponent()
this.menuMovePackage = new System.Windows.Forms.ToolStripMenuItem();
this.menuDeletePackage = new System.Windows.Forms.ToolStripMenuItem();
this.menuAddWizard = new System.Windows.Forms.ToolStripMenuItem();
- this.menuChangeLog = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuBuildPackage = new System.Windows.Forms.ToolStripMenuItem();
this.menuPublish = new System.Windows.Forms.ToolStripMenuItem();
this.menuOpenPackageFolder = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.menuManageScreenshots = new System.Windows.Forms.ToolStripMenuItem();
+ this.menuChangeLog = new System.Windows.Forms.ToolStripMenuItem();
this.menuReviewPendingChanges = new System.Windows.Forms.ToolStripMenuItem();
this.menuEdit = new System.Windows.Forms.ToolStripMenuItem();
this.menuRouterConfig = new System.Windows.Forms.ToolStripMenuItem();
@@ -1685,14 +1685,6 @@ private void InitializeComponent()
this.menuAddWizard.ToolTipText = "Add installation/upgrade/uninstallation wizards to the currently opened Package.";
this.menuAddWizard.Click += new System.EventHandler(this.menuAddWizard_Click);
//
- // menuChangeLog
- //
- this.menuChangeLog.Name = "menuChangeLog";
- this.menuChangeLog.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.L)));
- this.menuChangeLog.Size = new System.Drawing.Size(205, 22);
- this.menuChangeLog.Text = "Edit Change&Log";
- this.menuChangeLog.Click += new System.EventHandler(this.toolStripMenuItemChangeLog_Click);
- //
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
@@ -1720,7 +1712,7 @@ private void InitializeComponent()
this.menuOpenPackageFolder.Name = "menuOpenPackageFolder";
this.menuOpenPackageFolder.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.menuOpenPackageFolder.Size = new System.Drawing.Size(205, 22);
- this.menuOpenPackageFolder.Text = "&Open Folder";
+ this.menuOpenPackageFolder.Text = "&Explore Folder";
this.menuOpenPackageFolder.ToolTipText = "Opened the folder of the currently opened Package within Windows Explorer.";
this.menuOpenPackageFolder.Click += new System.EventHandler(this.menuOpenFolder_Click);
//
@@ -1738,6 +1730,14 @@ private void InitializeComponent()
this.menuManageScreenshots.Text = "Edit &Screenshots";
this.menuManageScreenshots.Click += new System.EventHandler(this.menuManageScreenshots_Click);
//
+ // menuChangeLog
+ //
+ this.menuChangeLog.Name = "menuChangeLog";
+ this.menuChangeLog.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.L)));
+ this.menuChangeLog.Size = new System.Drawing.Size(205, 22);
+ this.menuChangeLog.Text = "Edit Change&Log";
+ this.menuChangeLog.Click += new System.EventHandler(this.toolStripMenuItemChangeLog_Click);
+ //
// menuReviewPendingChanges
//
this.menuReviewPendingChanges.Name = "menuReviewPendingChanges";
@@ -1772,7 +1772,7 @@ private void InitializeComponent()
// menuRouterConfig
//
this.menuRouterConfig.Name = "menuRouterConfig";
- this.menuRouterConfig.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F2)));
+ this.menuRouterConfig.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1)));
this.menuRouterConfig.Size = new System.Drawing.Size(200, 22);
this.menuRouterConfig.Tag = "package\\{0}\\dsm.cgi.conf";
this.menuRouterConfig.Text = "Router Config";
@@ -1781,7 +1781,7 @@ private void InitializeComponent()
// menuRouterScript
//
this.menuRouterScript.Name = "menuRouterScript";
- this.menuRouterScript.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F3)));
+ this.menuRouterScript.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F2)));
this.menuRouterScript.Size = new System.Drawing.Size(200, 22);
this.menuRouterScript.Tag = "package\\{0}\\router.cgi";
this.menuRouterScript.Text = "Router Script";
diff --git a/Mods/Forms/MainForm.cs b/Mods/Forms/MainForm.cs
index 7d8f0af..6836596 100644
--- a/Mods/Forms/MainForm.cs
+++ b/Mods/Forms/MainForm.cs
@@ -404,7 +404,8 @@ private void SaveResourceConfig(string path)
if (this.resource.Count > 0)
{
var json = JsonConvert.SerializeObject(this.resource, Formatting.Indented);
- File.WriteAllText(resourceFile, json);
+
+ Helper.WriteAnsiFile(resourceFile, json);
}
}
catch (Exception ex)
@@ -959,7 +960,7 @@ private void SavePackageInfo(string path)
Helper.DeleteFile(infoName);
// Write the new INFO file
- using (StreamWriter outputFile = new StreamWriter(infoName))
+ using (StreamWriter outputFile = new StreamWriter(infoName, false, Encoding.GetEncoding(1252)))
{
foreach (var element in info)
{
@@ -1865,14 +1866,8 @@ private bool CreateScript(KeyValuePair current, string script,
Directory.CreateDirectory(target);
// Create sh script (ANSI) to be executed by the php runner script
- using (TextWriter text = new StreamWriter(targetScript, true, Encoding.GetEncoding(1252)))
- {
- text.Write(script);
- }
- using (TextWriter text = new StreamWriter(targetRunner, true, Encoding.GetEncoding(1252)))
- {
- text.Write(runner);
- }
+ Helper.WriteAnsiFile(targetScript, script);
+ Helper.WriteAnsiFile(targetRunner, runner);
}
}
@@ -1908,7 +1903,8 @@ private void SaveItemsConfig()
var config = Path.Combine(CurrentPackageFolder, string.Format(CONFIGFILE, info["dsmuidir"]));
if (Directory.Exists(Path.GetDirectoryName(config)))
{
- File.WriteAllText(config, json);
+ // Save Config as Ansi
+ Helper.WriteAnsiFile(config, json);
}
else
{
@@ -3892,7 +3888,7 @@ private bool EditInstallationScript(string scriptName, string title)
DialogResult result = Helper.ScriptEditor(script, null, GetAllWizardVariables());
if (result == DialogResult.OK)
{
- File.WriteAllText(scriptPath, script.Code);
+ Helper.WriteAnsiFile(scriptPath, script.Code);
done = true;
}
}
@@ -3903,6 +3899,7 @@ private bool EditInstallationScript(string scriptName, string title)
private void menuExit_Click(object sender, EventArgs e)
{
// Trigger the Close event on the Main Form. (See MainForm_FormClosing)
+ //DialogResult = DialogResult.Abort;
this.Close();
}
@@ -3963,8 +3960,7 @@ private void menuWizard_Click(object sender, EventArgs e)
jsonPath = Path.Combine(CurrentPackageFolder, "WIZARD_UIFILES", json);
if (jsonPath != null)
- using (File.CreateText(jsonPath))
- { }
+ Helper.WriteAnsiFile(jsonPath, string.Empty);
}
if (jsonPath != null)
@@ -3978,7 +3974,7 @@ private void menuWizard_Click(object sender, EventArgs e)
result = Helper.ScriptEditor(wizard, null, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(jsonPath, wizard.Code);
+ Helper.WriteAnsiFile(jsonPath, wizard.Code);
menu.Image = new Bitmap(Properties.Resources.EditedScript);
}
}
@@ -4095,8 +4091,8 @@ private void buttonAdvanced_Click(object sender, EventArgs e)
DialogResult result = Helper.ScriptEditor(script, config, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(infoName, script.Code);
- if (configName != null) File.WriteAllText(configName, config.Code);
+ Helper.WriteAnsiFile(infoName, script.Code);
+ if (configName != null) Helper.WriteAnsiFile(configName, config.Code);
LoadPackageInfo(CurrentPackageFolder);
LoadResourceConfig(CurrentPackageFolder);
BindData(list, null);
@@ -5041,7 +5037,7 @@ private void menuLicense_Click(object sender, EventArgs e)
}
else
{
- File.WriteAllText(scriptPath, script.Code);
+ Helper.WriteAnsiFile(scriptPath, script.Code);
menu.Image = new Bitmap(Properties.Resources.EditedScript);
}
}
@@ -5104,7 +5100,7 @@ private void menuDefaultRunner_Click(object sender, EventArgs e)
DialogResult result = Helper.ScriptEditor(null, runner, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(file, runner.Code);
+ Helper.WriteAnsiFile(file, runner.Code);
menuDefaultRunner.Image = new Bitmap(Properties.Resources.EditedScript);
}
}
@@ -5118,7 +5114,7 @@ private void menuDefaultRouterConfig_Click(object sender, EventArgs e)
DialogResult result = Helper.ScriptEditor(null, routerConfig, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(file, routerConfig.Code);
+ Helper.WriteAnsiFile(file, routerConfig.Code);
menuDefaultRouterConfig.Image = new Bitmap(Properties.Resources.EditedScript);
}
}
@@ -5132,7 +5128,7 @@ private void menuDefaultRouterScript_Click(object sender, EventArgs e)
DialogResult result = Helper.ScriptEditor(null, routercgi, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(file, routercgi.Code);
+ Helper.WriteAnsiFile(file, routercgi.Code);
menuDefaultRouterScript.Image = new Bitmap(Properties.Resources.EditedScript);
}
}
@@ -5154,7 +5150,7 @@ private void menuRouterConfig_Click(object sender, EventArgs e)
DialogResult result = Helper.ScriptEditor(null, routerConfig, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(file, routerConfig.Code);
+ Helper.WriteAnsiFile(file, routerConfig.Code);
menuRouterConfig.Image = new Bitmap(Properties.Resources.EditedScript);
}
}
@@ -5179,7 +5175,7 @@ private void menuRouterScript_Click(object sender, EventArgs e)
DialogResult result = Helper.ScriptEditor(null, routercgi, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(file, routercgi.Code);
+ Helper.WriteAnsiFile(file, routercgi.Code);
menuRouterScript.Image = new Bitmap(Properties.Resources.EditedScript);
}
}
@@ -5253,8 +5249,10 @@ private void portConfigToolStripMenuItem_Click(object sender, EventArgs e)
}
//Save the INI protocol file
- var fileParser = new FileIniDataParser(parser);
- fileParser.WriteFile(protocolFile, portConfigData);
+ Helper.WriteAnsiFile(protocolFile, portConfigData.ToString());
+ //var fileParser = new FileIniDataParser(parser);
+ //fileParser.WriteFile(protocolFile, portConfigData, Encoding.GetEncoding(1252));
+
//Update the Resource file
if (resource == null) resource = JsonConvert.DeserializeObject("{}");
@@ -5455,8 +5453,9 @@ private void EditPackageConfig(string pkgType, string doc)
}
//Save the INI protocol file
- var fileParser = new FileIniDataParser(parser);
- fileParser.WriteFile(pkgConfigFile, pkgConfig);
+ //var fileParser = new FileIniDataParser(parser);
+ //fileParser.WriteFile(pkgConfigFile, pkgConfig);
+ Helper.WriteAnsiFile(pkgConfigFile, pkgConfig.ToString());
}
else
{
diff --git a/Mods/Forms/Parameters.cs b/Mods/Forms/Parameters.cs
index 3c99bfd..65f7c53 100644
--- a/Mods/Forms/Parameters.cs
+++ b/Mods/Forms/Parameters.cs
@@ -274,7 +274,7 @@ private void buttonEditDSMReleases_Click(object sender, EventArgs e)
DialogResult result = Helper.ScriptEditor(null, dsmRelease, null);
if (result == DialogResult.OK)
{
- File.WriteAllText(dsmReleases, dsmRelease.Code);
+ Helper.WriteAnsiFile(dsmReleases, dsmRelease.Code);
}
}
}
diff --git a/Mods/Helpers/Helper.cs b/Mods/Helpers/Helper.cs
index d4562b2..189d4f9 100644
--- a/Mods/Helpers/Helper.cs
+++ b/Mods/Helpers/Helper.cs
@@ -1130,6 +1130,19 @@ public static void ValidateFirmware(TextBox sender, CancelEventArgs e, ErrorProv
}
}
+ public static void WriteAnsiFile(string path, string content)
+ {
+ if (string.IsNullOrEmpty(content))
+ content = string.Empty;
+ else
+ content = content.Replace("\r\n", "\n");
+
+ using (TextWriter text = new StreamWriter(path, false, Encoding.GetEncoding(1252)))
+ {
+ text.Write(content);
+ }
+ }
+
public static string Unquote(string text)
{
if (text != null)
diff --git a/Mods/Program.cs b/Mods/Program.cs
index c3abbd6..7b011bd 100644
--- a/Mods/Program.cs
+++ b/Mods/Program.cs
@@ -41,6 +41,10 @@ static void Main(string[] args)
else
{
string open = null;
+
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+
var edit = args.SingleOrDefault(arg => arg.StartsWith("edit:"));
if (!string.IsNullOrEmpty(edit))
{
@@ -56,22 +60,22 @@ static void Main(string[] args)
// Load the default runner script or create one if it does not exist
var defaultRunnerPath = Path.Combine(Helper.ResourcesDirectory, "default.runner");
if (!File.Exists(defaultRunnerPath))
- File.WriteAllText(defaultRunnerPath, Properties.Settings.Default.Ps_Exec);
+ Helper.WriteAnsiFile(defaultRunnerPath, Properties.Settings.Default.Ps_Exec);
// Load the Router Config or create one if it does not exist
var defaultRouterConfigPath = Path.Combine(Helper.ResourcesDirectory, "dsm.cgi.conf");
if (!File.Exists(defaultRouterConfigPath))
- File.WriteAllText(defaultRouterConfigPath, Properties.Settings.Default.dsm_cgi);
+ Helper.WriteAnsiFile(defaultRouterConfigPath, Properties.Settings.Default.dsm_cgi);
// Load the Router Script or create one if it does not exist
var defaultRouterScriptPath = Path.Combine(Helper.ResourcesDirectory, "router.cgi");
if (!File.Exists(defaultRouterScriptPath))
- File.WriteAllText(defaultRouterScriptPath, Properties.Settings.Default.router_cgi);
+ Helper.WriteAnsiFile(defaultRouterScriptPath, Properties.Settings.Default.router_cgi);
// Load the default DSM release list or create one if it does not exist
var defaultDSMReleases = Path.Combine(Helper.ResourcesDirectory, "dsm_releases");
if (!File.Exists(defaultDSMReleases))
- File.WriteAllText(defaultDSMReleases, Properties.Settings.Default.dsm_releases);
+ Helper.WriteAnsiFile(defaultDSMReleases, Properties.Settings.Default.dsm_releases);
// Extract the WizardUI background image if it does not exist
var backWizard = Path.Combine(Helper.ResourcesDirectory, "backwizard.png");
@@ -81,8 +85,6 @@ static void Main(string[] args)
backWizardPng.Save(backWizard);
}
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm(open));
}
}
diff --git a/Mods/Resources/Pack.cmd b/Mods/Resources/Pack.cmd
index 1cf2135..984662a 100644
--- a/Mods/Resources/Pack.cmd
+++ b/Mods/Resources/Pack.cmd
@@ -12,7 +12,7 @@ if errorlevel 1 (
move package.tgz ..\
cd ..
Mods.exe hash:.
-7z.exe a -ttar mods.spk package.tgz scripts WIZARD_UIFILES CHANGELOG INFO LICENSE PACKAGE_ICON*.PNG screen_*.png
+7z.exe a -ttar mods.spk package.tgz conf scripts WIZARD_UIFILES CHANGELOG INFO LICENSE PACKAGE_ICON*.PNG screen_*.png
if errorlevel 1 (
cd ..
echo Error while creating package.
|