Imported MicronSync v.1.3.0.2
This commit is contained in:
@@ -24,8 +24,8 @@ namespace MicronSync
|
||||
file.DefaultExt = ".7z";
|
||||
break;
|
||||
case FileType.ini:
|
||||
file.Filter = "Config File|*.ini";
|
||||
file.DefaultExt = ".ini";
|
||||
file.Filter = "Config Files (*.mini;*.ini)|*.mini;*.ini";
|
||||
file.DefaultExt = "*.mini";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -53,8 +53,7 @@ namespace MicronSync
|
||||
file.DefaultExt = ".7z";
|
||||
break;
|
||||
case FileType.ini:
|
||||
file.Filter = "Config File|*.ini";
|
||||
file.DefaultExt = ".ini";
|
||||
file.Filter = "Config Files (*.mini;*.ini)|*.mini;*.ini";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -152,7 +151,7 @@ namespace MicronSync
|
||||
string result = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(fullPath))
|
||||
foreach (var item in MSConfig.SysVars)
|
||||
foreach (var item in UserConfig.SysVars)
|
||||
if (fullPath.StartsWith(item.Value))
|
||||
{
|
||||
result = item.Key;
|
||||
@@ -167,7 +166,7 @@ namespace MicronSync
|
||||
string result = variable;
|
||||
|
||||
if (!string.IsNullOrEmpty(variable))
|
||||
foreach (var item in MSConfig.SysVars)
|
||||
foreach (var item in UserConfig.SysVars)
|
||||
if (variable.StartsWith(item.Key))
|
||||
{
|
||||
result = item.Value;
|
||||
@@ -187,6 +186,7 @@ namespace MicronSync
|
||||
CopyEntireDirectory_Error,
|
||||
Default,
|
||||
RenameEntireDirectory_Error,
|
||||
WriteToDirectory_Error,
|
||||
}
|
||||
|
||||
public endResult ClearEntireDirectory(string dir)
|
||||
@@ -271,6 +271,28 @@ namespace MicronSync
|
||||
return _endResult;
|
||||
}
|
||||
|
||||
public endResult WriteToDirectory(string file)
|
||||
{
|
||||
endResult _endResult = endResult.Default;
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamWriter w = new StreamWriter(file))
|
||||
{
|
||||
w.WriteLine("Write access is functional");
|
||||
w.Close();
|
||||
}
|
||||
if (File.Exists(file))
|
||||
File.Delete(file);
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
_endResult = endResult.WriteToDirectory_Error;
|
||||
}
|
||||
|
||||
return _endResult;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Conversion
|
||||
|
||||
+89
-104
@@ -28,25 +28,97 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox));
|
||||
this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.labelRegistered = new System.Windows.Forms.Label();
|
||||
this.logoPictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.labelProductName = new System.Windows.Forms.Label();
|
||||
this.labelVersion = new System.Windows.Forms.Label();
|
||||
this.labelCopyright = new System.Windows.Forms.Label();
|
||||
this.labelCompanyName = new System.Windows.Forms.Label();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.textBoxDescription = new System.Windows.Forms.TextBox();
|
||||
this.tableLayoutPanel.SuspendLayout();
|
||||
this.labelCompanyName = new System.Windows.Forms.Label();
|
||||
this.labelCopyright = new System.Windows.Forms.Label();
|
||||
this.labelVersion = new System.Windows.Forms.Label();
|
||||
this.labelProductName = new System.Windows.Forms.Label();
|
||||
this.logoPictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
|
||||
this.tableLayoutPanel.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textBoxDescription
|
||||
//
|
||||
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textBoxDescription.Location = new System.Drawing.Point(153, 133);
|
||||
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
|
||||
this.textBoxDescription.Multiline = true;
|
||||
this.textBoxDescription.Name = "textBoxDescription";
|
||||
this.textBoxDescription.ReadOnly = true;
|
||||
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.textBoxDescription.Size = new System.Drawing.Size(261, 100);
|
||||
this.textBoxDescription.TabIndex = 23;
|
||||
this.textBoxDescription.TabStop = false;
|
||||
this.textBoxDescription.Text = "Description";
|
||||
//
|
||||
// labelCompanyName
|
||||
//
|
||||
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCompanyName.Location = new System.Drawing.Point(153, 78);
|
||||
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCompanyName.Name = "labelCompanyName";
|
||||
this.labelCompanyName.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelCompanyName.TabIndex = 22;
|
||||
this.labelCompanyName.Text = "Company Name";
|
||||
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelCopyright
|
||||
//
|
||||
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCopyright.Location = new System.Drawing.Point(153, 52);
|
||||
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCopyright.Name = "labelCopyright";
|
||||
this.labelCopyright.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelCopyright.TabIndex = 21;
|
||||
this.labelCopyright.Text = "Copyright";
|
||||
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelVersion
|
||||
//
|
||||
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelVersion.Location = new System.Drawing.Point(153, 26);
|
||||
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelVersion.Name = "labelVersion";
|
||||
this.labelVersion.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelVersion.TabIndex = 0;
|
||||
this.labelVersion.Text = "Version";
|
||||
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelProductName
|
||||
//
|
||||
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelProductName.Location = new System.Drawing.Point(153, 0);
|
||||
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelProductName.Name = "labelProductName";
|
||||
this.labelProductName.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelProductName.TabIndex = 19;
|
||||
this.labelProductName.Text = "Product Name";
|
||||
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// logoPictureBox
|
||||
//
|
||||
this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image")));
|
||||
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.logoPictureBox.Name = "logoPictureBox";
|
||||
this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
|
||||
this.logoPictureBox.Size = new System.Drawing.Size(141, 230);
|
||||
this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.logoPictureBox.TabIndex = 12;
|
||||
this.logoPictureBox.TabStop = false;
|
||||
//
|
||||
// tableLayoutPanel
|
||||
//
|
||||
this.tableLayoutPanel.ColumnCount = 2;
|
||||
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.48387F));
|
||||
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 64.51613F));
|
||||
this.tableLayoutPanel.Controls.Add(this.labelRegistered, 1, 4);
|
||||
this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0);
|
||||
this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0);
|
||||
this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1);
|
||||
@@ -68,78 +140,6 @@
|
||||
this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265);
|
||||
this.tableLayoutPanel.TabIndex = 0;
|
||||
//
|
||||
// labelRegistered
|
||||
//
|
||||
this.labelRegistered.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelRegistered.Location = new System.Drawing.Point(153, 104);
|
||||
this.labelRegistered.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelRegistered.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelRegistered.Name = "labelRegistered";
|
||||
this.labelRegistered.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelRegistered.TabIndex = 25;
|
||||
this.labelRegistered.Text = "Registered:";
|
||||
this.labelRegistered.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// logoPictureBox
|
||||
//
|
||||
this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image")));
|
||||
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.logoPictureBox.Name = "logoPictureBox";
|
||||
this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
|
||||
this.logoPictureBox.Size = new System.Drawing.Size(141, 230);
|
||||
this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.logoPictureBox.TabIndex = 12;
|
||||
this.logoPictureBox.TabStop = false;
|
||||
//
|
||||
// labelProductName
|
||||
//
|
||||
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelProductName.Location = new System.Drawing.Point(153, 0);
|
||||
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelProductName.Name = "labelProductName";
|
||||
this.labelProductName.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelProductName.TabIndex = 19;
|
||||
this.labelProductName.Text = "Product Name";
|
||||
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelVersion
|
||||
//
|
||||
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelVersion.Location = new System.Drawing.Point(153, 26);
|
||||
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelVersion.Name = "labelVersion";
|
||||
this.labelVersion.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelVersion.TabIndex = 0;
|
||||
this.labelVersion.Text = "Version";
|
||||
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelCopyright
|
||||
//
|
||||
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCopyright.Location = new System.Drawing.Point(153, 52);
|
||||
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCopyright.Name = "labelCopyright";
|
||||
this.labelCopyright.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelCopyright.TabIndex = 21;
|
||||
this.labelCopyright.Text = "Copyright";
|
||||
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelCompanyName
|
||||
//
|
||||
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCompanyName.Location = new System.Drawing.Point(153, 78);
|
||||
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCompanyName.Name = "labelCompanyName";
|
||||
this.labelCompanyName.Size = new System.Drawing.Size(261, 17);
|
||||
this.labelCompanyName.TabIndex = 22;
|
||||
this.labelCompanyName.Text = "Company Name";
|
||||
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
@@ -150,20 +150,6 @@
|
||||
this.okButton.TabIndex = 24;
|
||||
this.okButton.Text = "&OK";
|
||||
//
|
||||
// textBoxDescription
|
||||
//
|
||||
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textBoxDescription.Location = new System.Drawing.Point(153, 133);
|
||||
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
|
||||
this.textBoxDescription.Multiline = true;
|
||||
this.textBoxDescription.Name = "textBoxDescription";
|
||||
this.textBoxDescription.ReadOnly = true;
|
||||
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.textBoxDescription.Size = new System.Drawing.Size(261, 100);
|
||||
this.textBoxDescription.TabIndex = 23;
|
||||
this.textBoxDescription.TabStop = false;
|
||||
this.textBoxDescription.Text = "Description";
|
||||
//
|
||||
// AboutBox
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
@@ -180,23 +166,22 @@
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "AboutBox";
|
||||
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
|
||||
this.tableLayoutPanel.ResumeLayout(false);
|
||||
this.tableLayoutPanel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
|
||||
private System.Windows.Forms.PictureBox logoPictureBox;
|
||||
private System.Windows.Forms.Label labelProductName;
|
||||
private System.Windows.Forms.Label labelVersion;
|
||||
private System.Windows.Forms.Label labelCopyright;
|
||||
private System.Windows.Forms.Label labelCompanyName;
|
||||
private System.Windows.Forms.TextBox textBoxDescription;
|
||||
private System.Windows.Forms.Label labelCompanyName;
|
||||
private System.Windows.Forms.Label labelCopyright;
|
||||
private System.Windows.Forms.Label labelVersion;
|
||||
private System.Windows.Forms.Label labelProductName;
|
||||
private System.Windows.Forms.PictureBox logoPictureBox;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Label labelRegistered;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace MicronSync.Components
|
||||
this.labelCopyright.Text = AssemblyCopyright;
|
||||
this.labelCompanyName.Text = AssemblyCompany;
|
||||
this.textBoxDescription.Text = AssemblyDescription;
|
||||
this.labelRegistered.Text += " " + RegisteredStatus;
|
||||
}
|
||||
|
||||
#region Assembly Attribute Accessors
|
||||
@@ -101,24 +100,6 @@ namespace MicronSync.Components
|
||||
return ((AssemblyCompanyAttribute)attributes[0]).Company;
|
||||
}
|
||||
}
|
||||
|
||||
public string RegisteredStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
string status = null;
|
||||
if (Licencer.isRegistered)
|
||||
{
|
||||
status = "Yes";
|
||||
}
|
||||
else
|
||||
{
|
||||
status = "No";
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
[New Features]
|
||||
[Enhancements]
|
||||
- 7-zip is no longer required to be installed. MicronSync comes with the required dependencies.
|
||||
|
||||
[MicronSync 1.3.0.2]-------------------------------------------------------------------------------
|
||||
[Bug Fixes]
|
||||
- Fixed bug which prevented configs loaded from jump-lists from working correctly.
|
||||
|
||||
[Enhancements]
|
||||
- Window location is now preserved.
|
||||
- MicronSync no longer requires write access from the starting directory.
|
||||
|
||||
[MicronSync 1.3.0.1]-------------------------------------------------------------------------------
|
||||
MicronSync is now freeware, donation screen has been completely removed :)
|
||||
|
||||
[Bug Fixes]
|
||||
- Refreshing drives now works again as intended.
|
||||
|
||||
[Enhancements]
|
||||
- Major under the hood changes to .ini loading/saving functionality.
|
||||
- Support for new .mini files which can be associated with MicronSync for direct opening in Windows.
|
||||
- Configs are now saved with the .mini extension by default, .ini is still fully supported going forwards.
|
||||
|
||||
[MicronSync 1.3.0.0]-------------------------------------------------------------------------------
|
||||
[New Features]
|
||||
- Browse directly to any of the backup and restore paths with a conveniently placed shortcut.
|
||||
- Restore backups can now be triggered every time a restore operation is run.
|
||||
- Choose between dark and light themes which are persistent on the system..
|
||||
|
||||
-172
@@ -1,172 +0,0 @@
|
||||
namespace MicronSync.Components
|
||||
{
|
||||
partial class DonationUI
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DonationUI));
|
||||
this.textInfo = new System.Windows.Forms.RichTextBox();
|
||||
this.progWait = new System.Windows.Forms.ProgressBar();
|
||||
this.btnContinue = new System.Windows.Forms.Button();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.registerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.enterRegistrationKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.buyKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.websiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textInfo
|
||||
//
|
||||
this.textInfo.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.textInfo.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textInfo.Location = new System.Drawing.Point(112, 36);
|
||||
this.textInfo.Name = "textInfo";
|
||||
this.textInfo.ReadOnly = true;
|
||||
this.textInfo.Size = new System.Drawing.Size(460, 96);
|
||||
this.textInfo.TabIndex = 2;
|
||||
this.textInfo.Text = resources.GetString("textInfo.Text");
|
||||
//
|
||||
// progWait
|
||||
//
|
||||
this.progWait.Location = new System.Drawing.Point(12, 138);
|
||||
this.progWait.Name = "progWait";
|
||||
this.progWait.Size = new System.Drawing.Size(479, 23);
|
||||
this.progWait.Step = 20;
|
||||
this.progWait.TabIndex = 1;
|
||||
//
|
||||
// btnContinue
|
||||
//
|
||||
this.btnContinue.Enabled = false;
|
||||
this.btnContinue.Location = new System.Drawing.Point(497, 138);
|
||||
this.btnContinue.Name = "btnContinue";
|
||||
this.btnContinue.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnContinue.TabIndex = 0;
|
||||
this.btnContinue.Text = "Continue";
|
||||
this.btnContinue.UseVisualStyleBackColor = true;
|
||||
this.btnContinue.Click += new System.EventHandler(this.btnContinue_Click);
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.registerToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(584, 24);
|
||||
this.menuStrip1.TabIndex = 3;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// registerToolStripMenuItem
|
||||
//
|
||||
this.registerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.enterRegistrationKeyToolStripMenuItem,
|
||||
this.buyKeyToolStripMenuItem,
|
||||
this.toolStripSeparator1,
|
||||
this.websiteToolStripMenuItem});
|
||||
this.registerToolStripMenuItem.Name = "registerToolStripMenuItem";
|
||||
this.registerToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.registerToolStripMenuItem.Text = "Register";
|
||||
//
|
||||
// enterRegistrationKeyToolStripMenuItem
|
||||
//
|
||||
this.enterRegistrationKeyToolStripMenuItem.Name = "enterRegistrationKeyToolStripMenuItem";
|
||||
this.enterRegistrationKeyToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
|
||||
this.enterRegistrationKeyToolStripMenuItem.Text = "Enter donation key...";
|
||||
this.enterRegistrationKeyToolStripMenuItem.Click += new System.EventHandler(this.enterRegistrationKeyToolStripMenuItem_Click);
|
||||
//
|
||||
// buyKeyToolStripMenuItem
|
||||
//
|
||||
this.buyKeyToolStripMenuItem.Name = "buyKeyToolStripMenuItem";
|
||||
this.buyKeyToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
|
||||
this.buyKeyToolStripMenuItem.Text = "Donate...";
|
||||
this.buyKeyToolStripMenuItem.Click += new System.EventHandler(this.donateToolStripMenuItem_Click);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
this.pictureBox1.Location = new System.Drawing.Point(12, 36);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(94, 96);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pictureBox1.TabIndex = 4;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// websiteToolStripMenuItem
|
||||
//
|
||||
this.websiteToolStripMenuItem.Name = "websiteToolStripMenuItem";
|
||||
this.websiteToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
|
||||
this.websiteToolStripMenuItem.Text = "Website...";
|
||||
this.websiteToolStripMenuItem.Click += new System.EventHandler(this.websiteToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(179, 6);
|
||||
//
|
||||
// DonationUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.ClientSize = new System.Drawing.Size(584, 171);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.btnContinue);
|
||||
this.Controls.Add(this.progWait);
|
||||
this.Controls.Add(this.textInfo);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "DonationUI";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "MicronSync - Donation";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DonationUI_FormClosing);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RichTextBox textInfo;
|
||||
private System.Windows.Forms.ProgressBar progWait;
|
||||
private System.Windows.Forms.Button btnContinue;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem registerToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem enterRegistrationKeyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem buyKeyToolStripMenuItem;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.ToolStripMenuItem websiteToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MicronSync.Components
|
||||
{
|
||||
public partial class DonationUI : Form
|
||||
{
|
||||
public static readonly string donateUrl = "http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K5TKEUREWNCA8";
|
||||
public static readonly string websiteUrl = "http://reboundsoftware.weebly.com";
|
||||
private bool userCloseForm = false;
|
||||
private bool timerStopped = false;
|
||||
|
||||
public DonationUI()
|
||||
{
|
||||
InitializeComponent();
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
private void StartTimer()
|
||||
{
|
||||
timerStopped = false;
|
||||
|
||||
bwTimer.DoWork += BwTimer_DoWork;
|
||||
bwTimer.RunWorkerCompleted += BwTimer_RunWorkerCompleted;
|
||||
bwTimer.ProgressChanged += BwTimer_ProgressChanged;
|
||||
|
||||
bwTimer.WorkerReportsProgress = true;
|
||||
bwTimer.RunWorkerAsync();
|
||||
}
|
||||
|
||||
#region Timer
|
||||
|
||||
BackgroundWorker bwTimer = new BackgroundWorker();
|
||||
|
||||
private void BwTimer_ProgressChanged(object sender, ProgressChangedEventArgs e)
|
||||
{
|
||||
progWait.PerformStep();
|
||||
}
|
||||
|
||||
private void BwTimer_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
if (progWait.Value == 100)
|
||||
{
|
||||
userCloseForm = true;
|
||||
btnContinue.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void BwTimer_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
int position = progWait.Value;
|
||||
int stepAmount = progWait.Step;
|
||||
|
||||
while (progWait.Value < 100 &&
|
||||
!timerStopped)
|
||||
{
|
||||
Thread.Sleep(250);
|
||||
position += stepAmount;
|
||||
bwTimer.ReportProgress(position);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Form
|
||||
|
||||
private void DonationUI_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
if (userCloseForm)
|
||||
e.Cancel = false;
|
||||
}
|
||||
|
||||
private void btnContinue_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void enterRegistrationKeyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
timerStopped = true;
|
||||
|
||||
NewRegKeyUI newKey = new NewRegKeyUI();
|
||||
newKey.ShowDialog();
|
||||
|
||||
if (!newKey.userKeyValid)
|
||||
{
|
||||
StartTimer();
|
||||
}
|
||||
else
|
||||
{
|
||||
bwTimer.Dispose();
|
||||
|
||||
userCloseForm = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void donateToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(
|
||||
donateUrl);
|
||||
}
|
||||
|
||||
private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(
|
||||
websiteUrl);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@ namespace MicronSync.Components.Forms
|
||||
|
||||
// Idenfify dropped data
|
||||
FileAttributes attr = File.GetAttributes(DropUI.dropData);
|
||||
if (dropData.EndsWith(".ini"))
|
||||
if (dropData.EndsWith(".ini") || dropData.EndsWith(".mini"))
|
||||
{
|
||||
DropResult = DropAction.LoadConfig;
|
||||
Close();
|
||||
|
||||
-196
@@ -1,196 +0,0 @@
|
||||
namespace MicronSync.Components
|
||||
{
|
||||
partial class NewRegKeyUI
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.textKey1 = new System.Windows.Forms.TextBox();
|
||||
this.btnAccept = new System.Windows.Forms.Button();
|
||||
this.textKey2 = new System.Windows.Forms.TextBox();
|
||||
this.textKey3 = new System.Windows.Forms.TextBox();
|
||||
this.textKey4 = new System.Windows.Forms.TextBox();
|
||||
this.labelDash1 = new System.Windows.Forms.Label();
|
||||
this.labelDash2 = new System.Windows.Forms.Label();
|
||||
this.labelDash3 = new System.Windows.Forms.Label();
|
||||
this.btnClipboard = new System.Windows.Forms.Button();
|
||||
this.btnClear = new System.Windows.Forms.Button();
|
||||
this.labelEnterKey = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textKey1
|
||||
//
|
||||
this.textKey1.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textKey1.Location = new System.Drawing.Point(16, 51);
|
||||
this.textKey1.MaxLength = 5;
|
||||
this.textKey1.Name = "textKey1";
|
||||
this.textKey1.Size = new System.Drawing.Size(48, 20);
|
||||
this.textKey1.TabIndex = 0;
|
||||
this.textKey1.TextChanged += new System.EventHandler(this.textKey1_TextChanged);
|
||||
this.textKey1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey1_KeyPress);
|
||||
//
|
||||
// btnAccept
|
||||
//
|
||||
this.btnAccept.Location = new System.Drawing.Point(297, 50);
|
||||
this.btnAccept.Name = "btnAccept";
|
||||
this.btnAccept.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnAccept.TabIndex = 4;
|
||||
this.btnAccept.Text = "Accept";
|
||||
this.btnAccept.UseVisualStyleBackColor = true;
|
||||
this.btnAccept.Click += new System.EventHandler(this.btnAccept_Click);
|
||||
//
|
||||
// textKey2
|
||||
//
|
||||
this.textKey2.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textKey2.Location = new System.Drawing.Point(87, 51);
|
||||
this.textKey2.MaxLength = 5;
|
||||
this.textKey2.Name = "textKey2";
|
||||
this.textKey2.Size = new System.Drawing.Size(48, 20);
|
||||
this.textKey2.TabIndex = 1;
|
||||
this.textKey2.TextChanged += new System.EventHandler(this.textKey2_TextChanged);
|
||||
this.textKey2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey2_KeyPress);
|
||||
//
|
||||
// textKey3
|
||||
//
|
||||
this.textKey3.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textKey3.Location = new System.Drawing.Point(158, 51);
|
||||
this.textKey3.MaxLength = 5;
|
||||
this.textKey3.Name = "textKey3";
|
||||
this.textKey3.Size = new System.Drawing.Size(48, 20);
|
||||
this.textKey3.TabIndex = 2;
|
||||
this.textKey3.TextChanged += new System.EventHandler(this.textKey3_TextChanged);
|
||||
this.textKey3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey3_KeyPress);
|
||||
//
|
||||
// textKey4
|
||||
//
|
||||
this.textKey4.Font = new System.Drawing.Font("Times New Roman", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textKey4.Location = new System.Drawing.Point(230, 51);
|
||||
this.textKey4.MaxLength = 5;
|
||||
this.textKey4.Name = "textKey4";
|
||||
this.textKey4.Size = new System.Drawing.Size(48, 20);
|
||||
this.textKey4.TabIndex = 3;
|
||||
this.textKey4.TextChanged += new System.EventHandler(this.textKey4_TextChanged);
|
||||
this.textKey4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textKey4_KeyPress);
|
||||
//
|
||||
// labelDash1
|
||||
//
|
||||
this.labelDash1.AutoSize = true;
|
||||
this.labelDash1.Location = new System.Drawing.Point(71, 54);
|
||||
this.labelDash1.Name = "labelDash1";
|
||||
this.labelDash1.Size = new System.Drawing.Size(10, 13);
|
||||
this.labelDash1.TabIndex = 6;
|
||||
this.labelDash1.Text = "-";
|
||||
//
|
||||
// labelDash2
|
||||
//
|
||||
this.labelDash2.AutoSize = true;
|
||||
this.labelDash2.Location = new System.Drawing.Point(142, 55);
|
||||
this.labelDash2.Name = "labelDash2";
|
||||
this.labelDash2.Size = new System.Drawing.Size(10, 13);
|
||||
this.labelDash2.TabIndex = 7;
|
||||
this.labelDash2.Text = "-";
|
||||
//
|
||||
// labelDash3
|
||||
//
|
||||
this.labelDash3.AutoSize = true;
|
||||
this.labelDash3.Location = new System.Drawing.Point(214, 55);
|
||||
this.labelDash3.Name = "labelDash3";
|
||||
this.labelDash3.Size = new System.Drawing.Size(10, 13);
|
||||
this.labelDash3.TabIndex = 8;
|
||||
this.labelDash3.Text = "-";
|
||||
//
|
||||
// btnClipboard
|
||||
//
|
||||
this.btnClipboard.Location = new System.Drawing.Point(16, 86);
|
||||
this.btnClipboard.Name = "btnClipboard";
|
||||
this.btnClipboard.Size = new System.Drawing.Size(119, 23);
|
||||
this.btnClipboard.TabIndex = 5;
|
||||
this.btnClipboard.Text = "Paste from clipboard";
|
||||
this.btnClipboard.UseVisualStyleBackColor = true;
|
||||
this.btnClipboard.Click += new System.EventHandler(this.btnClipboard_Click);
|
||||
//
|
||||
// btnClear
|
||||
//
|
||||
this.btnClear.Location = new System.Drawing.Point(297, 86);
|
||||
this.btnClear.Name = "btnClear";
|
||||
this.btnClear.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnClear.TabIndex = 6;
|
||||
this.btnClear.Text = "Clear";
|
||||
this.btnClear.UseVisualStyleBackColor = true;
|
||||
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
|
||||
//
|
||||
// labelEnterKey
|
||||
//
|
||||
this.labelEnterKey.AutoSize = true;
|
||||
this.labelEnterKey.Location = new System.Drawing.Point(13, 13);
|
||||
this.labelEnterKey.Name = "labelEnterKey";
|
||||
this.labelEnterKey.Size = new System.Drawing.Size(143, 13);
|
||||
this.labelEnterKey.TabIndex = 9;
|
||||
this.labelEnterKey.Text = "Please enter your key below:";
|
||||
//
|
||||
// NewRegKeyUI
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(384, 121);
|
||||
this.Controls.Add(this.labelEnterKey);
|
||||
this.Controls.Add(this.btnClear);
|
||||
this.Controls.Add(this.btnClipboard);
|
||||
this.Controls.Add(this.labelDash3);
|
||||
this.Controls.Add(this.labelDash2);
|
||||
this.Controls.Add(this.labelDash1);
|
||||
this.Controls.Add(this.textKey4);
|
||||
this.Controls.Add(this.textKey3);
|
||||
this.Controls.Add(this.textKey2);
|
||||
this.Controls.Add(this.btnAccept);
|
||||
this.Controls.Add(this.textKey1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "NewRegKeyUI";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "MicronSync - Enter key";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NewRegKeyUI_FormClosing);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox textKey1;
|
||||
private System.Windows.Forms.Button btnAccept;
|
||||
private System.Windows.Forms.TextBox textKey2;
|
||||
private System.Windows.Forms.TextBox textKey3;
|
||||
private System.Windows.Forms.TextBox textKey4;
|
||||
private System.Windows.Forms.Label labelDash1;
|
||||
private System.Windows.Forms.Label labelDash2;
|
||||
private System.Windows.Forms.Label labelDash3;
|
||||
private System.Windows.Forms.Button btnClipboard;
|
||||
private System.Windows.Forms.Button btnClear;
|
||||
private System.Windows.Forms.Label labelEnterKey;
|
||||
}
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MicronSync.Components
|
||||
{
|
||||
public partial class NewRegKeyUI : Form
|
||||
{
|
||||
public bool userKeyValid = false;
|
||||
private readonly Licencer _licencer = new Licencer();
|
||||
|
||||
public NewRegKeyUI()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#region Transform text to uppercase.
|
||||
|
||||
private void textKey1_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
e.KeyChar = Char.ToUpper(e.KeyChar);
|
||||
}
|
||||
|
||||
private void textKey2_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
e.KeyChar = Char.ToUpper(e.KeyChar);
|
||||
}
|
||||
|
||||
private void textKey3_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
e.KeyChar = Char.ToUpper(e.KeyChar);
|
||||
}
|
||||
|
||||
private void textKey4_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
e.KeyChar = Char.ToUpper(e.KeyChar);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Automatically move cursor to next element.
|
||||
|
||||
private void textKey1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (textKey1.TextLength == 5)
|
||||
textKey2.Focus();
|
||||
}
|
||||
|
||||
private void textKey2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (textKey2.TextLength == 5)
|
||||
textKey3.Focus();
|
||||
}
|
||||
|
||||
private void textKey3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (textKey3.TextLength == 5)
|
||||
textKey4.Focus();
|
||||
}
|
||||
|
||||
private void textKey4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (textKey4.TextLength == 5)
|
||||
btnAccept.Focus();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void ClearAllText()
|
||||
{
|
||||
textKey1.Clear();
|
||||
textKey2.Clear();
|
||||
textKey3.Clear();
|
||||
textKey4.Clear();
|
||||
}
|
||||
|
||||
private void btnAccept_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<string> keyParts = new List<string>();
|
||||
keyParts.Add(textKey1.Text + "-");
|
||||
keyParts.Add(textKey2.Text + "-");
|
||||
keyParts.Add(textKey3.Text + "-");
|
||||
keyParts.Add(textKey4.Text);
|
||||
|
||||
string fullKey = null;
|
||||
foreach (var part in keyParts)
|
||||
{
|
||||
fullKey += part;
|
||||
}
|
||||
|
||||
userKeyValid = _licencer.ValidateKey(fullKey);
|
||||
if (userKeyValid)
|
||||
{
|
||||
MessageHandler.stdMessage(MessageHandler.msgCodes.NewRegKeyUI_CorrectKey, null);
|
||||
_licencer.SetKey(fullKey);
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_InvalidKey, null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnClipboard_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllText();
|
||||
|
||||
string clipboard = Clipboard.GetText(TextDataFormat.Text)
|
||||
.Replace("-", "").ToUpper();
|
||||
|
||||
for (int i = 0; i < clipboard.Length; i++)
|
||||
{
|
||||
if (i < 5)
|
||||
{
|
||||
textKey1.Text += clipboard[i].ToString();
|
||||
}
|
||||
else if (i < 10)
|
||||
{
|
||||
textKey2.Text += clipboard[i].ToString();
|
||||
}
|
||||
else if (i < 15)
|
||||
{
|
||||
textKey3.Text += clipboard[i].ToString();
|
||||
}
|
||||
else if (i < 20)
|
||||
{
|
||||
textKey4.Text += clipboard[i].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllText();
|
||||
}
|
||||
|
||||
/// Update is user registered status.
|
||||
private void NewRegKeyUI_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
Licencer.isRegistered = userKeyValid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -17,7 +17,7 @@ namespace MicronSync.Components
|
||||
}
|
||||
public LMZAParser.endResult _endResultLMZA = LMZAParser.endResult.Default;
|
||||
public CommonIO.endResult _endResultCIO = CommonIO.endResult.Default;
|
||||
private readonly MSConfig _MSConfig = MainWindow._MSConfig;
|
||||
private readonly UserConfig _userConfig = MainWindow._userConfig;
|
||||
private Stopwatch stopWatch = new Stopwatch();
|
||||
public TimeSpan compTime;
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace MicronSync.Components
|
||||
private void LmzaBackup_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
_endResultLMZA = lmzaParser.MakePackage(
|
||||
Path.GetFileName(_MSConfig.BackupDestination),
|
||||
_MSConfig.BackupSource,
|
||||
Path.GetDirectoryName(_MSConfig.BackupDestination),
|
||||
_MSConfig.CompressionLevel,
|
||||
Path.GetFileName(_userConfig.BackupDestination),
|
||||
_userConfig.BackupSource,
|
||||
Path.GetDirectoryName(_userConfig.BackupDestination),
|
||||
_userConfig.CompressionLevel,
|
||||
"",
|
||||
false);
|
||||
}
|
||||
@@ -60,39 +60,39 @@ namespace MicronSync.Components
|
||||
// Process params.
|
||||
using (CommonIO cio = new CommonIO())
|
||||
{
|
||||
var restoreBackupDir = _MSConfig.RestoreDestination + ".Backup";
|
||||
var restoreBackupDir = _userConfig.RestoreDestination + ".Backup";
|
||||
|
||||
// Clear out old backup directory if it exists.
|
||||
if (_MSConfig.OverwriteBackup && Directory.Exists(restoreBackupDir))
|
||||
if (_userConfig.OverwriteBackup && Directory.Exists(restoreBackupDir))
|
||||
{
|
||||
Directory.Delete(restoreBackupDir, true);
|
||||
Thread.Sleep(500); // Delay needed for reliability!
|
||||
}
|
||||
|
||||
// Move source directory if also purging, otherwise perform standard copy.
|
||||
if (_MSConfig.EnableBackup && !_MSConfig.EnablePurge)
|
||||
if (_userConfig.EnableBackup && !_userConfig.EnablePurge)
|
||||
{
|
||||
_endResultCIO = cio.CopyEntireDirectory(
|
||||
_MSConfig.RestoreDestination,
|
||||
_userConfig.RestoreDestination,
|
||||
restoreBackupDir);
|
||||
}
|
||||
else if (_MSConfig.EnableBackup && _MSConfig.EnablePurge)
|
||||
else if (_userConfig.EnableBackup && _userConfig.EnablePurge)
|
||||
{
|
||||
_endResultCIO = cio.RenameEntireDirectory(
|
||||
_MSConfig.RestoreDestination,
|
||||
_userConfig.RestoreDestination,
|
||||
restoreBackupDir);
|
||||
Directory.CreateDirectory(_MSConfig.RestoreDestination);
|
||||
Directory.CreateDirectory(_userConfig.RestoreDestination);
|
||||
}
|
||||
|
||||
if (_MSConfig.EnablePurge)
|
||||
_endResultCIO = cio.ClearEntireDirectory(_MSConfig.RestoreDestination);
|
||||
if (_userConfig.EnablePurge)
|
||||
_endResultCIO = cio.ClearEntireDirectory(_userConfig.RestoreDestination);
|
||||
}
|
||||
|
||||
if (_endResultCIO == CommonIO.endResult.Default)
|
||||
_endResultLMZA = lmzaParser.ExtractPackage(
|
||||
Path.GetFileName(_MSConfig.RestoreSource),
|
||||
Path.GetDirectoryName(_MSConfig.RestoreSource),
|
||||
_MSConfig.RestoreDestination,
|
||||
Path.GetFileName(_userConfig.RestoreSource),
|
||||
Path.GetDirectoryName(_userConfig.RestoreSource),
|
||||
_userConfig.RestoreDestination,
|
||||
"");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
|
||||
namespace MicronSync.Components
|
||||
{
|
||||
public class Licencer
|
||||
{
|
||||
private readonly string privateKey = "TRZzjAutdtA542aeQj";
|
||||
private static SimplerAES aes = new SimplerAES(Encoding.ASCII.GetBytes(GetMachineGUID()));
|
||||
public static bool isRegistered { get; set; } = false;
|
||||
|
||||
public bool CheckForExistingLicence()
|
||||
{
|
||||
bool isValidKey = false;
|
||||
|
||||
try
|
||||
{
|
||||
isValidKey = ValidateKey(
|
||||
aes.Decrypt(Settings.Default.UserLicenseKey));
|
||||
}
|
||||
catch (Exception) { isValidKey = false; }
|
||||
|
||||
if (isValidKey == false && Settings.Default.UserLicenseKey != string.Empty)
|
||||
{
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.NewRegKeyUI_PirateKey, null);
|
||||
Settings.Default.UserLicenseKey = string.Empty;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
|
||||
return isValidKey;
|
||||
}
|
||||
|
||||
public void ShowDonationPrompt()
|
||||
{
|
||||
DonationUI dui = new DonationUI();
|
||||
dui.ShowDialog();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Windows GUID.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string GetMachineGUID()
|
||||
{
|
||||
var regPath = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default);
|
||||
var regKey = regPath?.OpenSubKey(@"SOFTWARE\Microsoft\Cryptography");
|
||||
|
||||
return regKey.GetValue("MachineGuid").ToString().Replace("-", string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns legitimacy of key.
|
||||
/// </summary>
|
||||
/// <param name="input">Key to check.</param>
|
||||
/// <returns>Key is genuine.</returns>
|
||||
public bool ValidateKey(string input)
|
||||
{
|
||||
SKGL.Validate skgl = new SKGL.Validate();
|
||||
skgl.secretPhase = privateKey;
|
||||
skgl.Key = input.ToUpper();
|
||||
|
||||
return skgl.IsValid;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores key into user level AppData.
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
public void SetKey(string key)
|
||||
{
|
||||
Settings.Default.UserLicenseKey = aes.Encrypt(key);
|
||||
Settings.Default.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate new key based on internal private key.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CreateNewKey()
|
||||
{
|
||||
SKGL.Generate skgl = new SKGL.Generate();
|
||||
skgl.secretPhase = privateKey;
|
||||
|
||||
return skgl.doKey(0, DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ namespace MicronSync
|
||||
NewRegKeyUI_CorrectKey,
|
||||
MainWindow_SaveChanges,
|
||||
MainWindow_LoadIncompatible,
|
||||
MainWindow_SZNotInstalled,
|
||||
}
|
||||
|
||||
public enum errCodes
|
||||
@@ -27,7 +26,6 @@ namespace MicronSync
|
||||
MainWindow_DstWithinSrc,
|
||||
MainWindow_RestoreError,
|
||||
MainWindow_BackupError,
|
||||
Config_WriteError,
|
||||
Config_ReadError,
|
||||
MainWindow_ArchiveNotFound,
|
||||
NewRegKeyUI_InvalidKey,
|
||||
@@ -38,6 +36,7 @@ namespace MicronSync
|
||||
Config_BadFile,
|
||||
MainWindow_BadExplorePath,
|
||||
MainWindow_EmptyExplorePath,
|
||||
MainWindow_SZNotInstalled,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -81,10 +80,6 @@ namespace MicronSync
|
||||
MessageBox.Show($"There was a problem backing up the selected directory, check you have entered the correct path. Additionally, ensure you have sufficient read/write access.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
break;
|
||||
case errCodes.Config_WriteError:
|
||||
MessageBox.Show($"Failed to write configuration file.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
case errCodes.Config_ReadError:
|
||||
MessageBox.Show($"The current directory is either write-protected or the configuration file is corrupt.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
@@ -125,6 +120,10 @@ namespace MicronSync
|
||||
MessageBox.Show($"Cannot browse to an empty path.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
case errCodes.MainWindow_SZNotInstalled:
|
||||
MessageBox.Show("7z.exe/7z.dll can not be found in the working directory. Please ensure they both exist and try again.", "MicronSync",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -165,10 +164,6 @@ namespace MicronSync
|
||||
_dialogResult = MessageBox.Show($"You are trying load a legacy config file (v{info}) which is incompatible with this version of MicronSync.\nPlease load a config file which is at least of version 1.2.0.0 or create a new one, sorry for any inconvenience caused!", "MicronSync - Incompatible config",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
break;
|
||||
case msgCodes.MainWindow_SZNotInstalled:
|
||||
_dialogResult = MessageBox.Show("7-Zip is not currently installed but is required for MicronSync to run. Would you like to be taken to the download page?", "MicronSync",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
}
|
||||
return _dialogResult;
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace MicronSync.Components
|
||||
{
|
||||
public class SimplerAES
|
||||
{
|
||||
//private static byte[] key = { 123, 217, 19, 11, 24, 26, 85, 45, 114, 184, 27, 162, 37, 112, 222, 209, 241, 24, 175, 144, 173, 53, 196, 29, 24, 26, 17, 218, 131, 236, 53, 209 };
|
||||
private static byte[] vector = { 124, 134, 176, 172, 17, 45, 121, 41, 250, 61, 14, 213, 50, 136, 255, 236 };
|
||||
private ICryptoTransform encryptor, decryptor;
|
||||
private UTF8Encoding encoder;
|
||||
|
||||
public SimplerAES(byte[] key)
|
||||
{
|
||||
RijndaelManaged rm = new RijndaelManaged();
|
||||
encryptor = rm.CreateEncryptor(key, vector);
|
||||
decryptor = rm.CreateDecryptor(key, vector);
|
||||
encoder = new UTF8Encoding();
|
||||
}
|
||||
|
||||
public string Encrypt(string unencrypted)
|
||||
{
|
||||
return Convert.ToBase64String(Encrypt(encoder.GetBytes(unencrypted)));
|
||||
}
|
||||
|
||||
public string Decrypt(string encrypted)
|
||||
{
|
||||
return encoder.GetString(Decrypt(Convert.FromBase64String(encrypted)));
|
||||
}
|
||||
|
||||
public byte[] Encrypt(byte[] buffer)
|
||||
{
|
||||
return Transform(buffer, encryptor);
|
||||
}
|
||||
|
||||
public byte[] Decrypt(byte[] buffer)
|
||||
{
|
||||
return Transform(buffer, decryptor);
|
||||
}
|
||||
|
||||
protected byte[] Transform(byte[] buffer, ICryptoTransform transform)
|
||||
{
|
||||
MemoryStream stream = new MemoryStream();
|
||||
using (CryptoStream cs = new CryptoStream(stream, transform, CryptoStreamMode.Write))
|
||||
{
|
||||
cs.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- -->
|
||||
<!-- ILMerge project-specific settings. Almost never need to be set explicitly. -->
|
||||
<!-- for details, see http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx -->
|
||||
<!-- -->
|
||||
<!-- *** set this file to Type=None, CopyToOutput=Never *** -->
|
||||
|
||||
<!-- If True, all copy local dependencies will also be merged from referenced projects whether they are referenced in the current project explicitly or not -->
|
||||
<ILMergeTransitive>true</ILMergeTransitive>
|
||||
|
||||
<!-- Extra ILMerge library paths (semicolon-separated). Dont put your package dependencies here, they will be added automagically -->
|
||||
<ILMergeLibraryPath></ILMergeLibraryPath>
|
||||
|
||||
<!-- The solution NuGet package directory if not standard 'SOLUTION\packages' -->
|
||||
<ILMergePackagesPath></ILMergePackagesPath>
|
||||
|
||||
<!-- The merge order file name if differs from standard 'ILMergeOrder.txt' -->
|
||||
<ILMergeOrderFile></ILMergeOrderFile>
|
||||
|
||||
<!-- The strong key file name if not specified in the project -->
|
||||
<ILMergeKeyFile></ILMergeKeyFile>
|
||||
|
||||
<!-- The assembly version if differs for the version of the main assembly -->
|
||||
<ILMergeAssemblyVersion></ILMergeAssemblyVersion>
|
||||
|
||||
<!-- added in Version 1.0.4 -->
|
||||
<ILMergeFileAlignment></ILMergeFileAlignment>
|
||||
|
||||
<!-- added in Version 1.0.4, default=none -->
|
||||
<ILMergeAllowDuplicateType></ILMergeAllowDuplicateType>
|
||||
|
||||
<!-- If the <see cref="CopyAttributes"/> is also set, any assembly-level attributes names that have the same type are copied over into the target assembly -->
|
||||
<ILMergeAllowMultipleAssemblyLevelAttributes></ILMergeAllowMultipleAssemblyLevelAttributes>
|
||||
|
||||
<!-- See ILMerge documentation -->
|
||||
<ILMergeAllowZeroPeKind></ILMergeAllowZeroPeKind>
|
||||
|
||||
<!-- The assembly level attributes of each input assembly are copied over into the target assembly -->
|
||||
<ILMergeCopyAttributes></ILMergeCopyAttributes>
|
||||
|
||||
<!-- Creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies, default=true -->
|
||||
<ILMergeDebugInfo></ILMergeDebugInfo>
|
||||
|
||||
<!-- Target assembly will be delay signed -->
|
||||
<ILMergeDelaySign></ILMergeDelaySign>
|
||||
|
||||
<!-- Types in assemblies other than the primary assembly have their visibility modified -->
|
||||
<ILMergeInternalize></ILMergeInternalize>
|
||||
|
||||
<!-- The path name of the file that will be used to identify types that are not to have their visibility modified -->
|
||||
<ILMergeInternalizeExcludeFile></ILMergeInternalizeExcludeFile>
|
||||
|
||||
<!-- XML documentation files are merged to produce an XML documentation file for the target assembly -->
|
||||
<ILMergeXmlDocumentation></ILMergeXmlDocumentation>
|
||||
|
||||
<!-- External assembly references in the manifest of the target assembly will use full public keys (false) or public key tokens (true, default value) -->
|
||||
<ILMergePublicKeyTokens></ILMergePublicKeyTokens>
|
||||
|
||||
<!-- Types with the same name are all merged into a single type in the target assembly -->
|
||||
<ILMergeUnionMerge></ILMergeUnionMerge>
|
||||
|
||||
<!-- The version of the target framework, default 40 (works for 45 too) -->
|
||||
<ILTargetPlatform></ILTargetPlatform>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
# this file contains the partial list of the merged assemblies in the merge order
|
||||
# you can fill it from the obj\CONFIG\PROJECT.ilmerge generated on every build
|
||||
# and finetune merge order to your satisfaction
|
||||
|
||||
Generated
+23
-50
@@ -100,15 +100,12 @@
|
||||
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.refreshDrivesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.websiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.enableDarkThemeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rememberWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.changelogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.registerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.enterDonationKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.donateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.labelDevBuild = new System.Windows.Forms.Label();
|
||||
this.groupRestoreOptions.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
|
||||
@@ -216,7 +213,7 @@
|
||||
// btnRestore
|
||||
//
|
||||
this.btnRestore.Enabled = false;
|
||||
this.btnRestore.Location = new System.Drawing.Point(9, 145);
|
||||
this.btnRestore.Location = new System.Drawing.Point(9, 156);
|
||||
this.btnRestore.Name = "btnRestore";
|
||||
this.btnRestore.Size = new System.Drawing.Size(120, 36);
|
||||
this.btnRestore.TabIndex = 23;
|
||||
@@ -227,7 +224,7 @@
|
||||
// btnBackup
|
||||
//
|
||||
this.btnBackup.Enabled = false;
|
||||
this.btnBackup.Location = new System.Drawing.Point(9, 145);
|
||||
this.btnBackup.Location = new System.Drawing.Point(9, 156);
|
||||
this.btnBackup.Name = "btnBackup";
|
||||
this.btnBackup.Size = new System.Drawing.Size(120, 36);
|
||||
this.btnBackup.TabIndex = 11;
|
||||
@@ -827,8 +824,7 @@
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.optionsToolStripMenuItem,
|
||||
this.changelogToolStripMenuItem,
|
||||
this.registerToolStripMenuItem});
|
||||
this.changelogToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(684, 24);
|
||||
@@ -844,8 +840,7 @@
|
||||
this.saveToolStripMenuItem,
|
||||
this.saveAsToolStripMenuItem,
|
||||
this.toolStripSeparator2,
|
||||
this.refreshDrivesToolStripMenuItem,
|
||||
this.websiteToolStripMenuItem});
|
||||
this.refreshDrivesToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "File";
|
||||
@@ -900,18 +895,13 @@
|
||||
this.refreshDrivesToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;
|
||||
this.refreshDrivesToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.refreshDrivesToolStripMenuItem.Text = "Refresh Drives";
|
||||
//
|
||||
// websiteToolStripMenuItem
|
||||
//
|
||||
this.websiteToolStripMenuItem.Name = "websiteToolStripMenuItem";
|
||||
this.websiteToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
|
||||
this.websiteToolStripMenuItem.Text = "Website...";
|
||||
this.websiteToolStripMenuItem.Click += new System.EventHandler(this.websiteToolStripMenuItem_Click);
|
||||
this.refreshDrivesToolStripMenuItem.Click += new System.EventHandler(this.refreshDrivesToolStripMenuItem_Click);
|
||||
//
|
||||
// optionsToolStripMenuItem
|
||||
//
|
||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.enableDarkThemeToolStripMenuItem,
|
||||
this.rememberWindowPositionToolStripMenuItem,
|
||||
this.toolStripSeparator3,
|
||||
this.aboutToolStripMenuItem1});
|
||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||
@@ -922,19 +912,27 @@
|
||||
//
|
||||
this.enableDarkThemeToolStripMenuItem.CheckOnClick = true;
|
||||
this.enableDarkThemeToolStripMenuItem.Name = "enableDarkThemeToolStripMenuItem";
|
||||
this.enableDarkThemeToolStripMenuItem.Size = new System.Drawing.Size(176, 22);
|
||||
this.enableDarkThemeToolStripMenuItem.Size = new System.Drawing.Size(225, 22);
|
||||
this.enableDarkThemeToolStripMenuItem.Text = "Enable Dark Theme";
|
||||
this.enableDarkThemeToolStripMenuItem.Click += new System.EventHandler(this.enableDarkThemeToolStripMenuItem_Click);
|
||||
//
|
||||
// rememberWindowPositionToolStripMenuItem
|
||||
//
|
||||
this.rememberWindowPositionToolStripMenuItem.CheckOnClick = true;
|
||||
this.rememberWindowPositionToolStripMenuItem.Name = "rememberWindowPositionToolStripMenuItem";
|
||||
this.rememberWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(225, 22);
|
||||
this.rememberWindowPositionToolStripMenuItem.Text = "Remember Window Position";
|
||||
this.rememberWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.rememberWindowPositionToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(173, 6);
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(222, 6);
|
||||
//
|
||||
// aboutToolStripMenuItem1
|
||||
//
|
||||
this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1";
|
||||
this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(176, 22);
|
||||
this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(225, 22);
|
||||
this.aboutToolStripMenuItem1.Text = "About";
|
||||
this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
|
||||
//
|
||||
@@ -945,39 +943,16 @@
|
||||
this.changelogToolStripMenuItem.Text = "Change Log";
|
||||
this.changelogToolStripMenuItem.Click += new System.EventHandler(this.changelogToolStripMenuItem_Click);
|
||||
//
|
||||
// registerToolStripMenuItem
|
||||
//
|
||||
this.registerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.enterDonationKeyToolStripMenuItem,
|
||||
this.donateToolStripMenuItem});
|
||||
this.registerToolStripMenuItem.Name = "registerToolStripMenuItem";
|
||||
this.registerToolStripMenuItem.Size = new System.Drawing.Size(69, 20);
|
||||
this.registerToolStripMenuItem.Text = "[Register]";
|
||||
//
|
||||
// enterDonationKeyToolStripMenuItem
|
||||
//
|
||||
this.enterDonationKeyToolStripMenuItem.Name = "enterDonationKeyToolStripMenuItem";
|
||||
this.enterDonationKeyToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
|
||||
this.enterDonationKeyToolStripMenuItem.Text = "Enter donation key...";
|
||||
this.enterDonationKeyToolStripMenuItem.Click += new System.EventHandler(this.enterDonationKeyToolStripMenuItem_Click);
|
||||
//
|
||||
// donateToolStripMenuItem
|
||||
//
|
||||
this.donateToolStripMenuItem.Name = "donateToolStripMenuItem";
|
||||
this.donateToolStripMenuItem.Size = new System.Drawing.Size(182, 22);
|
||||
this.donateToolStripMenuItem.Text = "Donate...";
|
||||
this.donateToolStripMenuItem.Click += new System.EventHandler(this.donateToolStripMenuItem_Click);
|
||||
//
|
||||
// labelDevBuild
|
||||
//
|
||||
this.labelDevBuild.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.labelDevBuild.AutoSize = true;
|
||||
this.labelDevBuild.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.labelDevBuild.Location = new System.Drawing.Point(609, 6);
|
||||
this.labelDevBuild.Location = new System.Drawing.Point(614, 6);
|
||||
this.labelDevBuild.Name = "labelDevBuild";
|
||||
this.labelDevBuild.Size = new System.Drawing.Size(69, 13);
|
||||
this.labelDevBuild.Size = new System.Drawing.Size(64, 13);
|
||||
this.labelDevBuild.TabIndex = 23;
|
||||
this.labelDevBuild.Text = "Alpha Build 2";
|
||||
this.labelDevBuild.Text = "Beta Build 2";
|
||||
//
|
||||
// MainWindow
|
||||
//
|
||||
@@ -998,6 +973,7 @@
|
||||
this.MaximumSize = new System.Drawing.Size(5000, 325);
|
||||
this.MinimumSize = new System.Drawing.Size(700, 325);
|
||||
this.Name = "MainWindow";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "MicronSync";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWindow_FormClosing);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
@@ -1074,10 +1050,6 @@
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||
private System.Windows.Forms.Label labelLastBackup;
|
||||
private System.Windows.Forms.Label labelLastChange;
|
||||
private System.Windows.Forms.ToolStripMenuItem registerToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem enterDonationKeyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem donateToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem websiteToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem changelogToolStripMenuItem;
|
||||
private System.Windows.Forms.Button btnRepBackupDest;
|
||||
@@ -1112,6 +1084,7 @@
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1;
|
||||
private System.Windows.Forms.CheckBox chkOverwriteBackup;
|
||||
private System.Windows.Forms.ToolStripMenuItem rememberWindowPositionToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+150
-148
@@ -12,7 +12,8 @@ namespace MicronSync
|
||||
{
|
||||
public partial class MainWindow : Form
|
||||
{
|
||||
public static MSConfig _MSConfig = new MSConfig();
|
||||
internal static UserConfig _userConfig = new UserConfig();
|
||||
internal static Settings _Settings = new Settings();
|
||||
public static string[] args { get; set; }
|
||||
private readonly CommonIO _CommonIO = new CommonIO();
|
||||
private readonly ParseUserInput _ParseUserInput = new ParseUserInput();
|
||||
@@ -28,12 +29,15 @@ namespace MicronSync
|
||||
if (PerformDependencyChecks() > 0)
|
||||
Environment.Exit(1);
|
||||
|
||||
_Settings.Load();
|
||||
CreateTooltips();
|
||||
ProcessLicence();
|
||||
PopulateRootLists();
|
||||
ProcessArgs(args);
|
||||
UseDarkTheme(Settings.Default.UseDarkTheme);
|
||||
labelDevBuild.Visible = false; // Comment out before releasing.
|
||||
UseDarkTheme(_Settings.UseDarkMode);
|
||||
SetWindowLocation(_Settings.RememberWindowLoc,
|
||||
new Point (_Settings.WindowXPos, _Settings.WindowYPos));
|
||||
//Location = new Point(_Settings.WindowXPos, _Settings.WindowYPos);
|
||||
//labelDevBuild.Visible = false; // Comment out before releasing.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -57,20 +61,6 @@ namespace MicronSync
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves licence status and displays relevant licencing form.
|
||||
/// </summary>
|
||||
private void ProcessLicence()
|
||||
{
|
||||
Licencer _Licencer = new Licencer();
|
||||
|
||||
Licencer.isRegistered = _Licencer.CheckForExistingLicence();
|
||||
if (!Licencer.isRegistered)
|
||||
_Licencer.ShowDonationPrompt();
|
||||
|
||||
RemoveRegInfoMenubar(Licencer.isRegistered);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize tooltips object and set tooltips for specified UI objects.
|
||||
/// </summary>
|
||||
@@ -125,7 +115,7 @@ namespace MicronSync
|
||||
cmbRootRSrc.Items.Add(drive);
|
||||
cmbRootRDst.Items.Add(drive);
|
||||
}
|
||||
foreach (var var in MSConfig.SysVars)
|
||||
foreach (var var in UserConfig.SysVars)
|
||||
{
|
||||
cmbRootBSrc.Items.Add(var.Key);
|
||||
cmbRootBDst.Items.Add(var.Key);
|
||||
@@ -134,16 +124,6 @@ namespace MicronSync
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes registration entry from menu if registered.
|
||||
/// </summary>
|
||||
/// <param name="isLicenced"></param>
|
||||
private void RemoveRegInfoMenubar(bool isLicenced)
|
||||
{
|
||||
if (isLicenced)
|
||||
menuStrip1.Items.RemoveByKey("registerToolStripMenuItem");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
@@ -161,11 +141,11 @@ namespace MicronSync
|
||||
string loadedFile = useFileSelector ? _CommonIO.OpenFile(null, CommonIO.FileType.ini) : fileToLoad;
|
||||
|
||||
if(!string.IsNullOrEmpty(loadedFile))
|
||||
if (loadedFile.EndsWith(".ini"))
|
||||
if (loadedFile.EndsWith(".mini") || loadedFile.EndsWith(".ini"))
|
||||
{
|
||||
_MSConfig = new MSConfig { openFile = loadedFile };
|
||||
int result = _MSConfig.Load();
|
||||
if (result == 0)
|
||||
_userConfig = new UserConfig() { OpenFile = loadedFile };
|
||||
|
||||
if (_userConfig.Load())
|
||||
{
|
||||
// Set titlebar name.
|
||||
UpTitlebar = loadedFile;
|
||||
@@ -173,7 +153,7 @@ namespace MicronSync
|
||||
saveToolStripMenuItem.Enabled = true;
|
||||
}
|
||||
else
|
||||
_MSConfig = new MSConfig();
|
||||
_userConfig = new UserConfig();
|
||||
|
||||
UpdateWithConfig();
|
||||
}
|
||||
@@ -184,7 +164,7 @@ namespace MicronSync
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.MainWindow_BadConfigFile_FromEXE, null);
|
||||
//
|
||||
isLoading = false;
|
||||
_MSConfig.userModifiedConfig = false;
|
||||
_userConfig.UserModifiedConfig = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -192,24 +172,24 @@ namespace MicronSync
|
||||
/// </summary>
|
||||
private void UpdateWithConfig()
|
||||
{
|
||||
UpTitlebar = _MSConfig.openFile;
|
||||
textDescription.Text = _MSConfig.Description;
|
||||
UpRootBackupSourceUI = _MSConfig.RootBackupSource;
|
||||
textBackupSource.Text = _MSConfig.PathBackupSource;
|
||||
UpRootBackupDestinationUI = _MSConfig.RootBackupDestination;
|
||||
textBackupDest.Text = _MSConfig.PathBackupDestination;
|
||||
UpRootRestoreSourceUI = _MSConfig.RootRestoreSource;
|
||||
textRestoreSource.Text = _MSConfig.PathRestoreSource;
|
||||
UpRootRestoreDestinationUI = _MSConfig.RootRestoreDestination;
|
||||
textRestoreDest.Text = _MSConfig.PathRestoreDestination;
|
||||
trackBar.Value = _MSConfig.CompressionLevel;
|
||||
chkBackup.Checked = _MSConfig.EnableBackup;
|
||||
chkPurge.Checked = _MSConfig.EnablePurge;
|
||||
chkOverwriteBackup.Checked = _MSConfig.OverwriteBackup;
|
||||
UpTabSelection = _MSConfig.InBackupMode;
|
||||
UpTitlebar = _userConfig.OpenFile;
|
||||
textDescription.Text = _userConfig.Description;
|
||||
UpRootBackupSourceUI = _userConfig.RootBackupSource;
|
||||
textBackupSource.Text = _userConfig.PathBackupSource;
|
||||
UpRootBackupDestinationUI = _userConfig.RootBackupDestination;
|
||||
textBackupDest.Text = _userConfig.PathBackupDestination;
|
||||
UpRootRestoreSourceUI = _userConfig.RootRestoreSource;
|
||||
textRestoreSource.Text = _userConfig.PathRestoreSource;
|
||||
UpRootRestoreDestinationUI = _userConfig.RootRestoreDestination;
|
||||
textRestoreDest.Text = _userConfig.PathRestoreDestination;
|
||||
trackBar.Value = _userConfig.CompressionLevel;
|
||||
chkBackup.Checked = _userConfig.EnableBackup;
|
||||
chkPurge.Checked = _userConfig.EnablePurge;
|
||||
chkOverwriteBackup.Checked = _userConfig.OverwriteBackup;
|
||||
UpTabSelection = _userConfig.InBackupMode;
|
||||
UpBackupSizeValue = "N/A";
|
||||
UpSourceSizeValue = "N/A";
|
||||
Width = _MSConfig.WindowWidth;
|
||||
Width = _userConfig.WindowWidth;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -284,6 +264,15 @@ namespace MicronSync
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// Test local write access
|
||||
if (_CommonIO.WriteToDirectory("Write_Access_Test") == CommonIO.endResult.WriteToDirectory_Error)
|
||||
{
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.Settings_WriteError, null);
|
||||
errors++;
|
||||
}
|
||||
*/
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
@@ -293,8 +282,8 @@ namespace MicronSync
|
||||
private void BackupButtonQualifier()
|
||||
{
|
||||
int count = 0;
|
||||
if (!string.IsNullOrEmpty(_MSConfig.BackupSource)) count++;
|
||||
if (!string.IsNullOrEmpty(_MSConfig.BackupDestination)) count++;
|
||||
if (!string.IsNullOrEmpty(_userConfig.BackupSource)) count++;
|
||||
if (!string.IsNullOrEmpty(_userConfig.BackupDestination)) count++;
|
||||
|
||||
if (count == 2)
|
||||
{
|
||||
@@ -314,8 +303,8 @@ namespace MicronSync
|
||||
private void RestoreButtonQualifier()
|
||||
{
|
||||
int count = 0;
|
||||
if (!string.IsNullOrEmpty(_MSConfig.RestoreSource)) count++;
|
||||
if (!string.IsNullOrEmpty(_MSConfig.RestoreDestination)) count++;
|
||||
if (!string.IsNullOrEmpty(_userConfig.RestoreSource)) count++;
|
||||
if (!string.IsNullOrEmpty(_userConfig.RestoreDestination)) count++;
|
||||
|
||||
if (count == 2)
|
||||
{
|
||||
@@ -391,22 +380,22 @@ namespace MicronSync
|
||||
hasCancelledExit = false;
|
||||
|
||||
// Only prompt if there are unsaved changes.
|
||||
if (!_MSConfig.userModifiedConfig) return;
|
||||
if (!_userConfig.UserModifiedConfig) return;
|
||||
DialogResult result;
|
||||
result = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_SaveChanges, _MSConfig.openFile);
|
||||
result = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_SaveChanges, _userConfig.OpenFile);
|
||||
|
||||
// Save to currently open file or to new one if there isn't one loaded.
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_MSConfig.openFile))
|
||||
{ _MSConfig.Save(); }
|
||||
if (!string.IsNullOrEmpty(_userConfig.OpenFile))
|
||||
{ _userConfig.Save(); }
|
||||
else
|
||||
{
|
||||
_MSConfig.openFile =
|
||||
_userConfig.OpenFile =
|
||||
_CommonIO.SaveFile(null, CommonIO.FileType.ini);
|
||||
}
|
||||
|
||||
_MSConfig.Save();
|
||||
_userConfig.Save();
|
||||
}
|
||||
else if (result == DialogResult.Cancel)
|
||||
hasCancelledExit = true;
|
||||
@@ -438,7 +427,8 @@ namespace MicronSync
|
||||
if (darkTheme)
|
||||
{
|
||||
enableDarkThemeToolStripMenuItem.CheckState = CheckState.Checked;
|
||||
Settings.Default.UseDarkTheme = true;
|
||||
//Settings.Default.UseDarkTheme = true;
|
||||
_Settings.UseDarkMode = true;
|
||||
|
||||
// Backup Tab.
|
||||
tabBackup.BackColor = darkColour;
|
||||
@@ -456,7 +446,8 @@ namespace MicronSync
|
||||
else
|
||||
{
|
||||
enableDarkThemeToolStripMenuItem.CheckState = CheckState.Unchecked;
|
||||
Settings.Default.UseDarkTheme = false;
|
||||
//Settings.Default.UseDarkTheme = false;
|
||||
_Settings.UseDarkMode = false;
|
||||
|
||||
// Backup Tab.
|
||||
tabBackup.BackColor = lightColour;
|
||||
@@ -473,6 +464,23 @@ namespace MicronSync
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set location of window based on a predefined coordinate otherwise a default
|
||||
/// position is used.
|
||||
/// </summary>
|
||||
/// <param name="enabled"></param>
|
||||
/// <param name="loc"></param>
|
||||
private void SetWindowLocation(bool enabled, Point loc)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
Location = loc;
|
||||
rememberWindowPositionToolStripMenuItem.CheckState = CheckState.Checked;
|
||||
}
|
||||
else
|
||||
{ Location = new Point(150, 150); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region UI Functionality
|
||||
@@ -624,9 +632,9 @@ namespace MicronSync
|
||||
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||
if (!string.IsNullOrEmpty(newRoot))
|
||||
{
|
||||
_MSConfig.RootBackupSource = newRoot;
|
||||
_MSConfig.PathBackupSource = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_MSConfig.RootBackupSource), String.Empty);
|
||||
_userConfig.RootBackupSource = newRoot;
|
||||
_userConfig.PathBackupSource = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_userConfig.RootBackupSource), String.Empty);
|
||||
}
|
||||
|
||||
UpdateWithConfig();
|
||||
@@ -640,9 +648,9 @@ namespace MicronSync
|
||||
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||
if (!string.IsNullOrEmpty(newRoot))
|
||||
{
|
||||
_MSConfig.RootBackupDestination = newRoot;
|
||||
_MSConfig.PathBackupDestination = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_MSConfig.RootBackupDestination), String.Empty);
|
||||
_userConfig.RootBackupDestination = newRoot;
|
||||
_userConfig.PathBackupDestination = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_userConfig.RootBackupDestination), String.Empty);
|
||||
}
|
||||
|
||||
UpdateWithConfig();
|
||||
@@ -656,9 +664,9 @@ namespace MicronSync
|
||||
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||
if (!string.IsNullOrEmpty(newRoot))
|
||||
{
|
||||
_MSConfig.RootRestoreSource = newRoot;
|
||||
_MSConfig.PathRestoreSource = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_MSConfig.RootRestoreSource), String.Empty);
|
||||
_userConfig.RootRestoreSource = newRoot;
|
||||
_userConfig.PathRestoreSource = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_userConfig.RootRestoreSource), String.Empty);
|
||||
}
|
||||
|
||||
UpdateWithConfig();
|
||||
@@ -672,9 +680,9 @@ namespace MicronSync
|
||||
string newRoot = _CommonIO.GetRootPath(fullPath);
|
||||
if (!string.IsNullOrEmpty(newRoot))
|
||||
{
|
||||
_MSConfig.RootRestoreDestination = newRoot;
|
||||
_MSConfig.PathRestoreDestination = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_MSConfig.RootRestoreDestination), String.Empty);
|
||||
_userConfig.RootRestoreDestination = newRoot;
|
||||
_userConfig.PathRestoreDestination = fullPath.Replace(_CommonIO.ConvertVariableToPath(
|
||||
_userConfig.RootRestoreDestination), String.Empty);
|
||||
}
|
||||
|
||||
UpdateWithConfig();
|
||||
@@ -685,22 +693,34 @@ namespace MicronSync
|
||||
|
||||
#region Form
|
||||
|
||||
private void rememberWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (rememberWindowPositionToolStripMenuItem.CheckState == CheckState.Checked)
|
||||
_Settings.RememberWindowLoc = true;
|
||||
else
|
||||
_Settings.RememberWindowLoc = false;
|
||||
}
|
||||
|
||||
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (tabControl.SelectedTab == tabBackup)
|
||||
_MSConfig.InBackupMode = true;
|
||||
_userConfig.InBackupMode = true;
|
||||
else
|
||||
_MSConfig.InBackupMode = false;
|
||||
_userConfig.InBackupMode = false;
|
||||
}
|
||||
|
||||
private void textDescription_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.Description = textDescription.Text;
|
||||
_userConfig.Description = textDescription.Text;
|
||||
}
|
||||
|
||||
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
Settings.Default.Save();
|
||||
// Update window location before saving.
|
||||
_Settings.WindowYPos = Location.Y;
|
||||
_Settings.WindowXPos = Location.X;
|
||||
|
||||
_Settings.Save();
|
||||
PromptSaveChanges();
|
||||
|
||||
if (!hasCancelledExit)
|
||||
@@ -713,30 +733,30 @@ namespace MicronSync
|
||||
|
||||
private void textBackupSource_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.PathBackupSource = textBackupSource.Text;
|
||||
UpSyncDate = _MSConfig.BackupSource;
|
||||
_userConfig.PathBackupSource = textBackupSource.Text;
|
||||
UpSyncDate = _userConfig.BackupSource;
|
||||
|
||||
BackupButtonQualifier();
|
||||
}
|
||||
|
||||
private void textBackupDest_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.PathBackupDestination = textBackupDest.Text;
|
||||
_userConfig.PathBackupDestination = textBackupDest.Text;
|
||||
|
||||
BackupButtonQualifier();
|
||||
}
|
||||
|
||||
private void textRestoreSource_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.PathRestoreSource = textRestoreSource.Text;
|
||||
UpBackupDate = _MSConfig.RestoreSource;
|
||||
_userConfig.PathRestoreSource = textRestoreSource.Text;
|
||||
UpBackupDate = _userConfig.RestoreSource;
|
||||
|
||||
RestoreButtonQualifier();
|
||||
}
|
||||
|
||||
private void textRestoreDest_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.PathRestoreDestination = textRestoreDest.Text;
|
||||
_userConfig.PathRestoreDestination = textRestoreDest.Text;
|
||||
|
||||
RestoreButtonQualifier();
|
||||
}
|
||||
@@ -806,9 +826,9 @@ namespace MicronSync
|
||||
DialogResult _dialogResult = DialogResult.None;
|
||||
|
||||
if (chkPurge.Checked && !chkBackup.Checked)
|
||||
if (!string.IsNullOrEmpty(_MSConfig.RestoreDestination))
|
||||
if (!string.IsNullOrEmpty(_userConfig.RestoreDestination))
|
||||
_dialogResult = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_Warn_Purge,
|
||||
_MSConfig.RestoreDestination);
|
||||
_userConfig.RestoreDestination);
|
||||
else
|
||||
_dialogResult = MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_Warn_Purge_Null,
|
||||
null);
|
||||
@@ -818,12 +838,12 @@ namespace MicronSync
|
||||
chkPurge.CheckState = CheckState.Unchecked;
|
||||
}
|
||||
|
||||
_MSConfig.EnablePurge = chkPurge.Checked;
|
||||
_userConfig.EnablePurge = chkPurge.Checked;
|
||||
}
|
||||
|
||||
private void checkBackup_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.EnableBackup = chkBackup.Checked;
|
||||
_userConfig.EnableBackup = chkBackup.Checked;
|
||||
|
||||
if (chkBackup.CheckState == CheckState.Checked)
|
||||
chkOverwriteBackup.Enabled = true;
|
||||
@@ -833,7 +853,7 @@ namespace MicronSync
|
||||
|
||||
private void trackBar_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.CompressionLevel = trackBar.Value;
|
||||
_userConfig.CompressionLevel = trackBar.Value;
|
||||
UpCompressionLevelText = trackBar.Value;
|
||||
}
|
||||
|
||||
@@ -841,8 +861,8 @@ namespace MicronSync
|
||||
{
|
||||
bool errors =
|
||||
_ParseUserInput.IsValidationInvalid(
|
||||
_MSConfig.RestoreSource,
|
||||
_MSConfig.RestoreDestination,
|
||||
_userConfig.RestoreSource,
|
||||
_userConfig.RestoreDestination,
|
||||
false);
|
||||
|
||||
if (!errors)
|
||||
@@ -859,8 +879,8 @@ namespace MicronSync
|
||||
{
|
||||
bool errors =
|
||||
_ParseUserInput.IsValidationInvalid(
|
||||
_MSConfig.BackupSource,
|
||||
_MSConfig.BackupDestination,
|
||||
_userConfig.BackupSource,
|
||||
_userConfig.BackupDestination,
|
||||
true);
|
||||
|
||||
if (!errors)
|
||||
@@ -875,26 +895,26 @@ namespace MicronSync
|
||||
|
||||
private void cmbRootBSrc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.RootBackupSource = cmbRootBSrc.SelectedItem.ToString();
|
||||
_userConfig.RootBackupSource = cmbRootBSrc.SelectedItem.ToString();
|
||||
|
||||
UpSyncDate = _MSConfig.BackupSource;
|
||||
UpSyncDate = _userConfig.BackupSource;
|
||||
}
|
||||
|
||||
private void cmbRootBDst_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.RootBackupDestination = cmbRootBDst.SelectedItem.ToString();
|
||||
_userConfig.RootBackupDestination = cmbRootBDst.SelectedItem.ToString();
|
||||
}
|
||||
|
||||
private void cmbRootRSrc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.RootRestoreSource = cmbRootRSrc.SelectedItem.ToString();
|
||||
_userConfig.RootRestoreSource = cmbRootRSrc.SelectedItem.ToString();
|
||||
|
||||
UpBackupDate = _MSConfig.RestoreSource;
|
||||
UpBackupDate = _userConfig.RestoreSource;
|
||||
}
|
||||
|
||||
private void cmbRootRDst_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.RootRestoreDestination = cmbRootRDst.SelectedItem.ToString();
|
||||
_userConfig.RootRestoreDestination = cmbRootRDst.SelectedItem.ToString();
|
||||
}
|
||||
|
||||
private void cmbComPreset_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@@ -911,18 +931,18 @@ namespace MicronSync
|
||||
|
||||
private void btnCalcBackupSize_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (File.Exists(_MSConfig.RestoreSource))
|
||||
UpBackupSizeValue = $"{_CommonIO.CalculateFileSizeMB(_MSConfig.RestoreSource)}MB";
|
||||
if (File.Exists(_userConfig.RestoreSource))
|
||||
UpBackupSizeValue = $"{_CommonIO.CalculateFileSizeMB(_userConfig.RestoreSource)}MB";
|
||||
else
|
||||
UpBackupSizeValue = "N/A";
|
||||
}
|
||||
|
||||
private void btnSourceSize_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Directory.Exists(_MSConfig.BackupSource))
|
||||
if (Directory.Exists(_userConfig.BackupSource))
|
||||
{
|
||||
DirSizeCalculatorPrompt dirCalc = new DirSizeCalculatorPrompt();
|
||||
dirCalc.TargetDirectory = _MSConfig.BackupSource;
|
||||
dirCalc.TargetDirectory = _userConfig.BackupSource;
|
||||
dirCalc.ShowDialog();
|
||||
|
||||
UpSourceSizeValue = $"{dirCalc.Result}MB";
|
||||
@@ -934,30 +954,22 @@ namespace MicronSync
|
||||
|
||||
private void btnExploreBSource_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenWithExplorer(_MSConfig.BackupSource);
|
||||
OpenWithExplorer(_userConfig.BackupSource);
|
||||
}
|
||||
|
||||
private void btnExploreRDestination_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenWithExplorer(_MSConfig.RestoreDestination);
|
||||
OpenWithExplorer(_userConfig.RestoreDestination);
|
||||
}
|
||||
|
||||
private void chkOverwriteBackup_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.OverwriteBackup = chkOverwriteBackup.Checked;
|
||||
_userConfig.OverwriteBackup = chkOverwriteBackup.Checked;
|
||||
}
|
||||
|
||||
private void MainWindow_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
_MSConfig.WindowWidth = Width;
|
||||
}
|
||||
|
||||
private void enableDarkThemeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (enableDarkThemeToolStripMenuItem.CheckState == CheckState.Checked)
|
||||
UseDarkTheme(true);
|
||||
else
|
||||
UseDarkTheme(false);
|
||||
_userConfig.WindowWidth = Width;
|
||||
}
|
||||
|
||||
#region Drag and drop
|
||||
@@ -1011,25 +1023,25 @@ namespace MicronSync
|
||||
|
||||
private void btnRepBackupSource_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetRestoreDestination(_MSConfig.BackupSource);
|
||||
SetRestoreDestination(_userConfig.BackupSource);
|
||||
tabControl.SelectedTab = tabRestore;
|
||||
}
|
||||
|
||||
private void btnRepBackupDest_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetRestoreSource(_MSConfig.BackupDestination);
|
||||
SetRestoreSource(_userConfig.BackupDestination);
|
||||
tabControl.SelectedTab = tabRestore;
|
||||
}
|
||||
|
||||
private void btnRepRestoreSource_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetBackupDestination(_MSConfig.RestoreSource);
|
||||
SetBackupDestination(_userConfig.RestoreSource);
|
||||
tabControl.SelectedTab = tabBackup;
|
||||
}
|
||||
|
||||
private void btnRepRestoreDest_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetBackupSource(_MSConfig.RestoreDestination);
|
||||
SetBackupSource(_userConfig.RestoreDestination);
|
||||
tabControl.SelectedTab = tabBackup;
|
||||
}
|
||||
|
||||
@@ -1039,25 +1051,33 @@ namespace MicronSync
|
||||
|
||||
#region Menubar
|
||||
|
||||
private void enableDarkThemeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (enableDarkThemeToolStripMenuItem.CheckState == CheckState.Checked)
|
||||
UseDarkTheme(true);
|
||||
else
|
||||
UseDarkTheme(false);
|
||||
}
|
||||
|
||||
private void newToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_MSConfig.userModifiedConfig)
|
||||
if (_userConfig.UserModifiedConfig)
|
||||
PromptSaveChanges();
|
||||
if (!hasCancelledExit)
|
||||
{
|
||||
|
||||
_MSConfig = new MSConfig();
|
||||
_userConfig = new UserConfig();
|
||||
UpdateWithConfig();
|
||||
|
||||
UpStatus = "New job";
|
||||
saveToolStripMenuItem.Enabled = false;
|
||||
_MSConfig.userModifiedConfig = false;
|
||||
_userConfig.UserModifiedConfig = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_MSConfig.userModifiedConfig)
|
||||
if (_userConfig.UserModifiedConfig)
|
||||
PromptSaveChanges();
|
||||
if (!hasCancelledExit)
|
||||
OpenConfig(true, null, false);
|
||||
@@ -1065,8 +1085,8 @@ namespace MicronSync
|
||||
|
||||
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_MSConfig.openFile))
|
||||
_MSConfig.Save();
|
||||
if (!string.IsNullOrEmpty(_userConfig.OpenFile))
|
||||
_userConfig.Save();
|
||||
|
||||
UpStatus = "Save successful";
|
||||
}
|
||||
@@ -1077,8 +1097,8 @@ namespace MicronSync
|
||||
|
||||
if (!string.IsNullOrEmpty(saveFile))
|
||||
{
|
||||
_MSConfig.openFile = saveFile;
|
||||
_MSConfig.Save();
|
||||
_userConfig.OpenFile = saveFile;
|
||||
_userConfig.Save();
|
||||
UpStatus = "Save successful";
|
||||
}
|
||||
|
||||
@@ -1092,24 +1112,6 @@ namespace MicronSync
|
||||
about.ShowDialog();
|
||||
}
|
||||
|
||||
private void enterDonationKeyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
NewRegKeyUI regKey = new NewRegKeyUI();
|
||||
regKey.ShowDialog();
|
||||
|
||||
RemoveRegInfoMenubar(Licencer.isRegistered);
|
||||
}
|
||||
|
||||
private void donateToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start(DonationUI.donateUrl);
|
||||
}
|
||||
|
||||
private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start(DonationUI.websiteUrl);
|
||||
}
|
||||
|
||||
private void changelogToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ChangeLog cl = new ChangeLog();
|
||||
@@ -1119,7 +1121,7 @@ namespace MicronSync
|
||||
private void refreshDrivesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Retrieve user modified config status before altering values.
|
||||
bool _userModifiedConfig = _MSConfig.userModifiedConfig;
|
||||
bool _userModifiedConfig = _userConfig.UserModifiedConfig;
|
||||
|
||||
string RootBSource = (cmbRootBSrc.SelectedItem != null) ? cmbRootBSrc.SelectedItem.ToString() : null;
|
||||
string RootBDestination = (cmbRootBDst.SelectedItem != null) ? cmbRootBDst.SelectedItem.ToString() : null;
|
||||
@@ -1136,7 +1138,7 @@ namespace MicronSync
|
||||
|
||||
// Unflag save prompt if no changes have been made to config.
|
||||
if (!_userModifiedConfig)
|
||||
_MSConfig.userModifiedConfig = false;
|
||||
_userConfig.UserModifiedConfig = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
+166
-118
@@ -2,45 +2,45 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
|
||||
namespace MicronSync
|
||||
{
|
||||
/// <summary>
|
||||
/// Settings to store.
|
||||
/// </summary>
|
||||
[Obfuscation(Exclude =true, ApplyToMembers = true)]
|
||||
public class Values : INotifyPropertyChanged
|
||||
[Obfuscation(Exclude = true, ApplyToMembers = true)]
|
||||
internal class UserConfigValues : INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// Flags value to be included in configuration.
|
||||
/// </summary>
|
||||
internal class SaveToConfigAttribute : Attribute { }
|
||||
internal class SaveToConfigAttribute : Attribute {}
|
||||
|
||||
CommonIO _CIO = new CommonIO();
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected void OnPropertyChanged()
|
||||
{
|
||||
PropertyChangedEventHandler handler = PropertyChanged;
|
||||
userModifiedConfig = true;
|
||||
}
|
||||
protected virtual void OnPropertyChanged() { UserModifiedConfig = true; }
|
||||
|
||||
public static readonly Dictionary<string, string> SysVars = new Dictionary<string, string>()
|
||||
{
|
||||
{ "%appdata%\\", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" },
|
||||
{ "%localappdata%\\", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" },
|
||||
{ "%userprofile%\\", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\" },
|
||||
{"%appdata%\\", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\"},
|
||||
{"%localappdata%\\", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\"},
|
||||
{"%userprofile%\\", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\"},
|
||||
};
|
||||
|
||||
[SaveToConfig]
|
||||
public Version MSVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Assembly.GetExecutingAssembly().GetName().Version;
|
||||
}
|
||||
get { return Assembly.GetExecutingAssembly().GetName().Version; }
|
||||
}
|
||||
|
||||
[SaveToConfig]
|
||||
public string MSIniType { get; set; } = "Config";
|
||||
|
||||
[SaveToConfig]
|
||||
public string Description
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _Description = "";
|
||||
private string _Description = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public bool EnablePurge
|
||||
@@ -99,7 +99,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private int _CompressionLevel = 4;
|
||||
private int _CompressionLevel = 4;
|
||||
|
||||
[SaveToConfig]
|
||||
public string RootBackupSource
|
||||
@@ -114,7 +114,8 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _RootBackupSource = "";
|
||||
private string _RootBackupSource = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public string PathBackupSource
|
||||
{
|
||||
@@ -126,7 +127,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _PathBackupSource = "";
|
||||
private string _PathBackupSource = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public string RootBackupDestination
|
||||
@@ -140,7 +141,8 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _RootBackupDestination = "";
|
||||
private string _RootBackupDestination = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public string PathBackupDestination
|
||||
{
|
||||
@@ -153,7 +155,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _PathBackupDestination = "";
|
||||
private string _PathBackupDestination = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public string RootRestoreSource
|
||||
@@ -167,7 +169,8 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _RootRestoreSource = "";
|
||||
private string _RootRestoreSource = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public string PathRestoreSource
|
||||
{
|
||||
@@ -180,7 +183,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _PathRestoreSource = "";
|
||||
private string _PathRestoreSource = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public string RootRestoreDestination
|
||||
@@ -194,7 +197,8 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _RootRestoreDestination = "";
|
||||
private string _RootRestoreDestination = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public string PathRestoreDestination
|
||||
{
|
||||
@@ -206,28 +210,15 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
private string _PathRestoreDestination = "";
|
||||
private string _PathRestoreDestination = string.Empty;
|
||||
|
||||
[SaveToConfig]
|
||||
public bool InBackupMode
|
||||
{
|
||||
get { return _InBackupMode; }
|
||||
set
|
||||
{
|
||||
_InBackupMode = value;
|
||||
}
|
||||
}
|
||||
private bool _InBackupMode = true;
|
||||
public bool InBackupMode { get; set; } = true;
|
||||
|
||||
[SaveToConfig]
|
||||
public int WindowWidth
|
||||
{
|
||||
get { return _WindowWidth; }
|
||||
set { _WindowWidth = value; }
|
||||
}
|
||||
private int _WindowWidth;
|
||||
public int WindowWidth { get; set; }
|
||||
|
||||
#region Temporary Values
|
||||
#region Temporary UserConfigValues
|
||||
|
||||
public string BackupSource
|
||||
{
|
||||
@@ -238,6 +229,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private string _BackupSource;
|
||||
|
||||
public string BackupDestination
|
||||
@@ -249,6 +241,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private string _BackupDestination;
|
||||
|
||||
public string RestoreSource
|
||||
@@ -260,6 +253,7 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private string _RestoreSource;
|
||||
|
||||
public string RestoreDestination
|
||||
@@ -271,103 +265,157 @@ namespace MicronSync
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private string _RestoreDestintation;
|
||||
|
||||
public string openFile { get; set; }
|
||||
public string OpenFile { get; set; }
|
||||
|
||||
public bool userModifiedConfig { get; set; } = false;
|
||||
public bool UserModifiedConfig { get; set; }
|
||||
|
||||
public Version loadedVersion { get; set; }
|
||||
public bool OnSaveIni { get; set; }
|
||||
|
||||
public Version LoadedVersion { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class MSConfig : Values
|
||||
internal class UserConfig : UserConfigValues
|
||||
{
|
||||
public int Save()
|
||||
public bool IsValidConfig { get; set; } = true;
|
||||
|
||||
public void Save()
|
||||
{
|
||||
int errors = 0;
|
||||
try
|
||||
{
|
||||
// Delete existing config file.
|
||||
if (File.Exists(openFile))
|
||||
File.Delete(openFile);
|
||||
var data = new IniData();
|
||||
|
||||
StreamWriter writer = new StreamWriter(openFile, true);
|
||||
foreach (var item in GetType().GetProperties())
|
||||
for (var i = 0; i < item.GetCustomAttributes(typeof(Attribute)).Count(); i++)
|
||||
if (item.GetValue(this) != null && item.CanRead)
|
||||
data.Global.AddKey(item.Name, Convert.ToString(item.GetValue(this)));
|
||||
|
||||
foreach (var item in GetType().GetProperties())
|
||||
foreach (var attr in item.GetCustomAttributes(true))
|
||||
if (item.GetValue(this) != null && item.CanRead)
|
||||
writer.WriteLine($"{item.Name}={item.GetValue(this)}");
|
||||
writer.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.Config_WriteError, null);
|
||||
errors++;
|
||||
}
|
||||
var parser = new FileIniDataParser();
|
||||
parser.WriteFile(OpenFile, data);
|
||||
|
||||
userModifiedConfig = false;
|
||||
return errors;
|
||||
UserModifiedConfig = false;
|
||||
}
|
||||
|
||||
public int Load()
|
||||
public bool Load()
|
||||
{
|
||||
int errors = 0;
|
||||
bool validConfigFile = false;
|
||||
try
|
||||
var parser = new FileIniDataParser();
|
||||
IniData data = parser.ReadFile(OpenFile);
|
||||
|
||||
foreach (var item in GetType().GetProperties())
|
||||
for (var i = 0; i < item.GetCustomAttributes(typeof(Attribute)).Count(); i++)
|
||||
foreach (var line in data.Global)
|
||||
if (Convert.ToString(line.KeyName).StartsWith(item.Name) && item.CanWrite)
|
||||
item.SetValue(this, Convert.ChangeType(line.Value, item.PropertyType));
|
||||
|
||||
// Rules
|
||||
foreach (var line in data.Global)
|
||||
{
|
||||
foreach (var item in GetType().GetProperties())
|
||||
foreach (var attr in item.GetCustomAttributes(true))
|
||||
{
|
||||
string line;
|
||||
using (StreamReader reader = new StreamReader(openFile, true))
|
||||
while (!string.IsNullOrEmpty(
|
||||
line = reader.ReadLine()))
|
||||
{
|
||||
if (line.StartsWith(item.Name) && item.CanWrite) // Update all values applicable for config file writing.
|
||||
{
|
||||
string readValue = line.ToString().Replace(item.Name, "").TrimStart('=');
|
||||
item.SetValue(this, Convert.ChangeType(readValue, item.PropertyType));
|
||||
}
|
||||
else if (line.StartsWith("MSVersion")) // Check the config file version is acceptible.
|
||||
{
|
||||
Version readValue = null;
|
||||
if (Version.TryParse(line.ToString().Replace(item.Name, "").TrimStart('='), out readValue))
|
||||
errors += CheckConfigVersion(readValue);
|
||||
|
||||
validConfigFile = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.Config_ReadError, null);
|
||||
errors++;
|
||||
}
|
||||
|
||||
// Check config file is valid before continuing
|
||||
if (!validConfigFile)
|
||||
{
|
||||
MessageHandler.errorMessage(MessageHandler.errCodes.Config_BadFile, openFile);
|
||||
errors++;
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
private int CheckConfigVersion(Version readValue)
|
||||
{
|
||||
int errors = 0;
|
||||
Version minValue = new Version(1, 2, 0, 0);
|
||||
if (readValue < minValue)
|
||||
if (IsValidConfig)
|
||||
{
|
||||
MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_LoadIncompatible, readValue.ToString());
|
||||
errors++;
|
||||
if (line.KeyName == "MSIniType" && line.Value != "Config")
|
||||
{
|
||||
IsValidConfig = false;
|
||||
}
|
||||
if (line.KeyName == "MSVersion")
|
||||
{
|
||||
Version v;
|
||||
if (Version.TryParse(line.Value, out v))
|
||||
IsValidConfig = IsMinimumConfigVersion(v);
|
||||
}
|
||||
}
|
||||
else { break; }
|
||||
}
|
||||
|
||||
return errors;
|
||||
// Show errors
|
||||
if (!IsValidConfig)
|
||||
{ MessageHandler.errorMessage(MessageHandler.errCodes.Config_BadFile, OpenFile); }
|
||||
|
||||
return IsValidConfig;
|
||||
}
|
||||
|
||||
private bool IsMinimumConfigVersion(Version readValue)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
Version minValue = new Version(1, 2, 0, 0);
|
||||
if (readValue < minValue)
|
||||
{
|
||||
MessageHandler.stdMessage(MessageHandler.msgCodes.MainWindow_LoadIncompatible, readValue.ToString());
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
[Obfuscation(Exclude = true, ApplyToMembers = true)]
|
||||
internal class SettingsValues
|
||||
{
|
||||
public class SaveToSettingsAttribute : Attribute { }
|
||||
|
||||
[SaveToSettings]
|
||||
public Version MSVersion
|
||||
{
|
||||
get { return Assembly.GetExecutingAssembly().GetName().Version; }
|
||||
}
|
||||
|
||||
[SaveToSettings]
|
||||
public string MSIniType { get; set; } = "Settings";
|
||||
|
||||
[SaveToSettings]
|
||||
public bool UseDarkMode { get; set; }
|
||||
|
||||
[SaveToSettings]
|
||||
public bool RememberWindowLoc { get; set; } = true;
|
||||
|
||||
[SaveToSettings]
|
||||
public int WindowYPos { get; set; }
|
||||
|
||||
[SaveToSettings]
|
||||
public int WindowXPos { get; set; }
|
||||
|
||||
public static readonly string ExeDirectoryLocation = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
"MicronSync");
|
||||
|
||||
public static readonly string IniAbsoluteLocation = Path.Combine(
|
||||
ExeDirectoryLocation,
|
||||
"Settings.ini");
|
||||
}
|
||||
|
||||
internal class Settings : SettingsValues
|
||||
{
|
||||
public void Save()
|
||||
{
|
||||
if (!Directory.Exists(ExeDirectoryLocation))
|
||||
Directory.CreateDirectory(ExeDirectoryLocation);
|
||||
|
||||
var data = new IniData();
|
||||
|
||||
foreach (var item in GetType().GetProperties())
|
||||
for (var i = 0; i < item.GetCustomAttributes(typeof(Attribute)).Count(); i++)
|
||||
if (item.GetValue(this) != null && item.CanRead)
|
||||
data.Global.AddKey(item.Name, Convert.ToString(item.GetValue(this)));
|
||||
|
||||
var parser = new FileIniDataParser();
|
||||
parser.WriteFile(IniAbsoluteLocation, data);
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
if (!File.Exists(IniAbsoluteLocation))
|
||||
Save();
|
||||
|
||||
var parser = new FileIniDataParser();
|
||||
IniData data = parser.ReadFile(IniAbsoluteLocation);
|
||||
|
||||
foreach (var item in GetType().GetProperties())
|
||||
for (var i = 0; i < item.GetCustomAttributes(typeof(Attribute)).Count(); i++)
|
||||
foreach (var line in data.Global)
|
||||
if (Convert.ToString(line.KeyName).StartsWith(item.Name) && item.CanWrite)
|
||||
item.SetValue(this, Convert.ChangeType(line.Value, item.PropertyType));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props" Condition="Exists('packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -12,6 +13,9 @@
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
@@ -22,10 +26,15 @@
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>6</ApplicationRevision>
|
||||
<ApplicationVersion>0.9.9.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<ErrorReportUrl>http://www.reboundsoftware.weebly.com/</ErrorReportUrl>
|
||||
<TargetCulture>en</TargetCulture>
|
||||
<ProductName>MicronSync</ProductName>
|
||||
<PublisherName>Rebound Software</PublisherName>
|
||||
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
|
||||
<ApplicationRevision>2</ApplicationRevision>
|
||||
<ApplicationVersion>1.3.0.2</ApplicationVersion>
|
||||
<UseApplicationTrust>true</UseApplicationTrust>
|
||||
<ExcludeDeploymentUrl>true</ExcludeDeploymentUrl>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
@@ -57,26 +66,34 @@
|
||||
<ApplicationIcon>MicronSync.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestCertificateThumbprint>F6E1314BAFECF34F1321DE2C676D9C38A192420A</ManifestCertificateThumbprint>
|
||||
<ManifestCertificateThumbprint>7975FC862A8D742C2100A88470C1F1350966E5E8</ManifestCertificateThumbprint>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestKeyFile>MicronSync_TemporaryKey.pfx</ManifestKeyFile>
|
||||
<ManifestKeyFile>ReboundSoftware.pfx</ManifestKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateManifests>false</GenerateManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignManifests>false</SignManifests>
|
||||
<SignManifests>true</SignManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetZone>LocalIntranet</TargetZone>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="INIFileParser, Version=2.3.0.0, Culture=neutral, PublicKeyToken=79af7b307b65cf3c, processorArchitecture=MSIL">
|
||||
<HintPath>packages\ini-parser.2.3.0\lib\net20\INIFileParser.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="SKGL">
|
||||
<HintPath>.\SKGL.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -111,34 +128,20 @@
|
||||
<Compile Include="Components\Forms\DirSizeCalculatorPrompt.Designer.cs">
|
||||
<DependentUpon>DirSizeCalculatorPrompt.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\Forms\DonationUI.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Components\Forms\DonationUI.Designer.cs">
|
||||
<DependentUpon>DonationUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\Forms\DropUI.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Components\Forms\DropUI.Designer.cs">
|
||||
<DependentUpon>DropUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\Licencer.cs" />
|
||||
<Compile Include="Components\LMZAParser.cs" />
|
||||
<Compile Include="Components\MessageHandler.cs" />
|
||||
<Compile Include="Components\Forms\NewRegKeyUI.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Components\Forms\NewRegKeyUI.Designer.cs">
|
||||
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\Forms\WorkerUI.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Components\Forms\WorkerUI.Designer.cs">
|
||||
<DependentUpon>WorkerUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Components\SimplerAES.cs" />
|
||||
<Compile Include="MainWindow.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -146,11 +149,6 @@
|
||||
<DependentUpon>MainWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ManageCfg.cs" />
|
||||
<Compile Include="Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Startup.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Components\Forms\AboutBox.resx">
|
||||
@@ -162,15 +160,9 @@
|
||||
<EmbeddedResource Include="Components\Forms\DirSizeCalculatorPrompt.resx">
|
||||
<DependentUpon>DirSizeCalculatorPrompt.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Components\Forms\DonationUI.resx">
|
||||
<DependentUpon>DonationUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Components\Forms\DropUI.resx">
|
||||
<DependentUpon>DropUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Components\Forms\NewRegKeyUI.resx">
|
||||
<DependentUpon>NewRegKeyUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Components\Forms\WorkerUI.resx">
|
||||
<DependentUpon>WorkerUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -187,11 +179,11 @@
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="app.manifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="MicronSync_TemporaryKey.pfx" />
|
||||
<None Include="ILMerge.props" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -201,15 +193,12 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="ReboundSoftware.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Components\Forms\ChangeLog.txt" />
|
||||
<Content Include="ILMergeOrder.txt" />
|
||||
<Content Include="MicronSync.ico" />
|
||||
<None Include="Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="SKGL.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
|
||||
@@ -223,6 +212,14 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FileAssociation Include=".mini">
|
||||
<Visible>False</Visible>
|
||||
<Description>MicronSync configuration file</Description>
|
||||
<Progid>MINI</Progid>
|
||||
<DefaultIcon>MicronSync.ico</DefaultIcon>
|
||||
</FileAssociation>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
@@ -232,6 +229,14 @@
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props'))" />
|
||||
<Error Condition="!Exists('packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets'))" />
|
||||
</Target>
|
||||
<Import Project="packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets" Condition="Exists('packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
@@ -3,5 +3,20 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory>http://www.reboundsoftware.weebly.com/</ErrorReportUrlHistory>
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<EnableSecurityDebugging>false</EnableSecurityDebugging>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicronSync", "MicronSync.csproj", "{85713D72-FF1F-47BC-B034-FB20ADF4A84A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{85713D72-FF1F-47BC-B034-FB20ADF4A84A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -7,11 +7,11 @@ using System.Runtime.InteropServices;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MicronSync")]
|
||||
[assembly: AssemblyDescription("MicronSync is free software and can be used both for personal and business use free of charge. Donations are entirely optional and do not extend or enhance MicronSync's functionality in any way.This software also uses 7-Zip as a backend, let the developers know how good their compression technology is!")]
|
||||
[assembly: AssemblyDescription("MicronSync is free software and can be used both for personal and business use free of charge. MicronSync is no longer donation-ware, it's 100% freeware forever! This software is made possible by 7-Zip as uses its compression engine as a backend, thanks to the 7-Zip team for their amazing compression technology!")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Rebound Software")]
|
||||
[assembly: AssemblyProduct("MicronSync")]
|
||||
[assembly: AssemblyCopyright("Fil Sapia - Rebound Software (2016)")]
|
||||
[assembly: AssemblyCopyright("Fil Sapia - Rebound Software (2017)")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -33,7 +33,7 @@ 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.3.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.3.0.0")]
|
||||
[assembly: AssemblyVersion("1.3.0.3")]
|
||||
[assembly: AssemblyFileVersion("1.3.0.3")]
|
||||
[assembly: NeutralResourcesLanguage("en-GB")]
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,12 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MicronSync" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="UseDarkTheme" Roaming="true" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="UserLicenseKey" Roaming="true" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="MicronSync.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<userSettings>
|
||||
<MicronSync.Settings>
|
||||
<setting name="UseDarkTheme" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="UserLicenseKey" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</MicronSync.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
|
||||
<assemblyIdentity name="MicronSync.application" version="1.3.0.2" publicKeyToken="0000000000000000" language="en" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
|
||||
<description asmv2:publisher="Rebound Software" asmv2:product="MicronSync" co.v1:errorReportUrl="http://www.reboundsoftware.weebly.com/" xmlns="urn:schemas-microsoft-com:asm.v1" />
|
||||
<deployment install="true" mapFileExtensions="true" />
|
||||
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
|
||||
<framework targetVersion="4.5.2" profile="Full" supportedRuntime="4.0.30319" />
|
||||
</compatibleFrameworks>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" codebase="MicronSync.exe.manifest" size="5720">
|
||||
<assemblyIdentity name="MicronSync.exe" version="1.3.0.2" publicKeyToken="0000000000000000" language="en" processorArchitecture="msil" type="win32" />
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>Q/Vdf6BlX1qLLXReerFdcqcz5KzBSWmfOhR3KtaPzZs=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</asmv1:assembly>
|
||||
Binary file not shown.
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
|
||||
<asmv1:assemblyIdentity name="MicronSync.exe" version="1.3.0.2" publicKeyToken="0000000000000000" language="en" processorArchitecture="msil" type="win32" />
|
||||
<description asmv2:iconFile="MicronSync.ico" asmv2:publisher="Rebound Software" asmv2:product="MicronSync" co.v1:errorReportUrl="http://www.reboundsoftware.weebly.com/" xmlns="urn:schemas-microsoft-com:asm.v1" />
|
||||
<application />
|
||||
<entryPoint>
|
||||
<assemblyIdentity name="MicronSync" version="1.3.0.2" language="neutral" processorArchitecture="msil" />
|
||||
<commandLine file="MicronSync.exe" parameters="" />
|
||||
</entryPoint>
|
||||
<co.v1:useManifestForTrust xmlns="urn:schemas-microsoft-com:asm.v1" />
|
||||
<trustInfo>
|
||||
<security>
|
||||
<applicationRequestMinimum>
|
||||
<PermissionSet version="1" class="System.Security.NamedPermissionSet" Name="LocalIntranet" Description="Default rights given to applications on the local intranet" Unrestricted="true" ID="Custom" SameSite="site" />
|
||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||
</applicationRequestMinimum>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Specifying requestedExecutionLevel element will disable file and registry virtualization.
|
||||
Remove this element if your application requires this virtualization for backwards
|
||||
compatibility.
|
||||
-->
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<dependency>
|
||||
<dependentOS>
|
||||
<osVersionInfo>
|
||||
<os majorVersion="5" minorVersion="1" buildNumber="2600" servicePackMajor="0" />
|
||||
</osVersionInfo>
|
||||
</dependentOS>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
|
||||
<assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.30319.0" />
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="INIFileParser.dll" size="29696">
|
||||
<assemblyIdentity name="INIFileParser" version="2.3.0.0" publicKeyToken="79AF7B307B65CF3C" language="neutral" processorArchitecture="msil" />
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>c5RGV5B9DNSW0e7e35uHbkb3KxB1AZxfnhn+P3fhDFo=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MicronSync.exe" size="1205232">
|
||||
<assemblyIdentity name="MicronSync" version="1.3.0.2" language="neutral" processorArchitecture="msil" />
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>b1GyfaFEogEi833KfF4w8k9/EPp2UMb2OCw+Wx7ulHY=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<file name="MicronSync.ico" size="370070">
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>qddQtUOBiHjs67DBK/A2MSUuzBSEjQoCz3w1rrrZJaw=</dsig:DigestValue>
|
||||
</hash>
|
||||
</file>
|
||||
<fileAssociation extension=".mini" description="MicronSync configuration file" progid="MINI" defaultIcon="MicronSync.ico" xmlns="urn:schemas-microsoft-com:clickonce.v1" />
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of the Windows versions that this application has been tested on and is
|
||||
is designed to work with. Uncomment the appropriate elements and Windows will
|
||||
automatically selected the most compatible environment. -->
|
||||
<!-- Windows Vista -->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||
<!-- Windows 7 -->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||
<!-- Windows 8 -->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||
<!-- Windows 8.1 -->
|
||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||
<!-- Windows 10 -->
|
||||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||
</application>
|
||||
</compatibility>
|
||||
</asmv1:assembly>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ILMerge" version="2.14.1208" targetFramework="net452" />
|
||||
<package id="MSBuild.ILMerge.Task" version="1.0.5" targetFramework="net452" />
|
||||
</packages>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Alexander Nosenko
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
BIN
Binary file not shown.
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- try to import project-specific settings; also use fixed name that was injected into project by NuGet -->
|
||||
<PropertyGroup>
|
||||
<!-- at this point only MSBuild* property are available -->
|
||||
<MSBuildIlMerge1>$(MSBuildProjectDirectory)\$(MSBuildProjectName).ILMerge.props</MSBuildIlMerge1>
|
||||
<MSBuildIlMerge2>$(MSBuildProjectDirectory)\ILMerge.props</MSBuildIlMerge2>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildIlMerge1)" Condition="Exists($(MSBuildIlMerge1))"/>
|
||||
<Import Project="$(MSBuildIlMerge2)" Condition="Exists($(MSBuildIlMerge2))"/>
|
||||
</Project>
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- give project-specific settings reasonable defaults -->
|
||||
<ILMergePackagesPath Condition=" $(ILMergePackagePath) == '' ">$(SolutionDir)packages</ILMergePackagesPath>
|
||||
<ILMergeOrderFile Condition=" $(ILMergeOrderFile) == '' ">$(MSBuildProjectDir)ILMergeOrder.txt</ILMergeOrderFile>
|
||||
<ILMergeKeyFile Condition=" $(ILMergeKeyFile) == '' ">$(AssemblyOriginatorKeyFile)</ILMergeKeyFile>
|
||||
<ILMergeAssemblyVersion Condition=" $(ILMergeAssemblyVersion) == '' "></ILMergeAssemblyVersion>
|
||||
|
||||
<ILMergeAllowDuplicateType Condition=" $(ILMergeAllowDuplicateType) == '' "></ILMergeAllowDuplicateType>
|
||||
<ILMergeAllowMultipleAssemblyLevelAttributes Condition=" $(ILMergeAllowMultipleAssemblyLevelAttributes) == '' ">false</ILMergeAllowMultipleAssemblyLevelAttributes>
|
||||
<ILMergeAllowZeroPeKind Condition=" $(ILMergeAllowZeroPeKind) == '' ">false</ILMergeAllowZeroPeKind>
|
||||
<ILMergeCopyAttributes Condition=" $(ILMergeCopyAttributes) == '' ">false</ILMergeCopyAttributes>
|
||||
<ILMergeDebugInfo Condition=" $(ILMergeDebugInfo) == '' ">true</ILMergeDebugInfo>
|
||||
<ILMergeDelaySign Condition=" $(ILMergeDelaySign) == '' ">false</ILMergeDelaySign>
|
||||
<ILMergeFileAlignment Condition=" $(ILMergeFileAlignment) == '' ">512</ILMergeFileAlignment>
|
||||
<ILMergeInternalize Condition=" $(ILMergeInternalize) == '' ">false</ILMergeInternalize>
|
||||
<ILMergeInternalizeExcludeFile Condition=" $(ILMergeInternalizeExcludeFile) == '' "></ILMergeInternalizeExcludeFile>
|
||||
<ILMergeXmlDocumentation Condition=" $(ILMergeXmlDocumentation) == '' ">false</ILMergeXmlDocumentation>
|
||||
<ILMergePublicKeyTokens Condition=" $(ILMergePublicKeyTokens) == '' ">true</ILMergePublicKeyTokens>
|
||||
<ILMergeShouldLog Condition=" $(ILMergeShouldLog) == '' ">true</ILMergeShouldLog>
|
||||
<!--<ILMergeTargetKind Condition=" $(ILMergeTargetKind) == '' "></ILMergeTargetKind>-->
|
||||
<ILMergeUnionMerge Condition=" $(ILMergeUnionMerge) == '' ">false</ILMergeUnionMerge>
|
||||
<ILTargetPlatform Condition=" $(ILTargetPlatform) == '' ">40</ILTargetPlatform>
|
||||
<!--<ILMergeVersion Condition=" $(ILMergeVersion) == '' "></ILMergeVersion>-->
|
||||
|
||||
<ILMergeToolsPath>$(MSBuildThisFileDirectory)..\tools\</ILMergeToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- decide what goes into output after compile-->
|
||||
<Target Name="SaveILMergeData" AfterTargets="CoreCompile">
|
||||
<Message Text="Transitive merge" Importance="high" Condition="$(ILMergeTransitive) == 'true'" />
|
||||
|
||||
<!-- all copy local assemblies referenced from this project that go to the executable except the main one-->
|
||||
<CreateItem Include="@(ReferencePath)" Condition=" '%(CopyLocal)' == 'true' ">
|
||||
<Output TaskParameter="Include" ItemName="MergedAssemblies"/>
|
||||
</CreateItem>
|
||||
|
||||
<!-- all copy local dependency assemblies-->
|
||||
<CreateItem Include="@(ReferenceDependencyPaths)" Condition=" '%(CopyLocal)' == 'true' ">
|
||||
<Output TaskParameter="Include" ItemName="MergedDependencies"/>
|
||||
</CreateItem>
|
||||
|
||||
<!-- all assemblies that doesn't so we use their directories as library path -->
|
||||
<CreateItem Include="@(ReferencePath)" Condition=" '%(CopyLocal)' == 'false' ">
|
||||
<Output TaskParameter="Include" ItemName="UnmergedAssemblies"/>
|
||||
</CreateItem>
|
||||
|
||||
<!-- all content items marked as copy always or newest -->
|
||||
<CreateItem Include="@(Content)" Condition=" '%(Content.CopyToOutputDirectory)' == 'Always' OR '%(Content.CopyToOutputDirectory)' == 'PreserveNewest' ">
|
||||
<Output TaskParameter="Include" ItemName="LocalContentFiles"/>
|
||||
</CreateItem>
|
||||
|
||||
<!-- add the main assembly as the first one -->
|
||||
<PropertyGroup Condition=" $(ILMergeTransitive) == 'true' ">
|
||||
<MergedAssemblies>@(IntermediateAssembly->'%(FullPath)');@(MergedAssemblies->'%(FullPath)');@(MergedDependencies->'%(FullPath)')</MergedAssemblies>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" $(ILMergeTransitive) == 'false' OR $(ILMergeTransitive) == '' ">
|
||||
<MergedAssemblies>@(IntermediateAssembly->'%(FullPath)');@(MergedAssemblies->'%(FullPath)')</MergedAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Ideally we should copy all not-copy-local assemblies that are not in the ILMergeLibraryPath to -->
|
||||
<!-- a temp directory and add it to the start search path, but we keep it simple here -->
|
||||
<UnmergedAssemblies>@(UnmergedAssemblies->'%(FullPath)')</UnmergedAssemblies>
|
||||
<MergeOutputFile>$(TargetPath)</MergeOutputFile>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<!-- do not copy copy-local assemblies, they will be merged -->
|
||||
<Target Name="_CopyFilesMarkedCopyLocal" />
|
||||
|
||||
<!-- override standard target our own merge-and-copy-content -->
|
||||
<Target Name="CopyFilesToOutputDirectory">
|
||||
<Message Text="Merged assemblies: $(MergedAssemblies)" Importance="high" />
|
||||
<Message Text="Not merged assemblies: $(UnmergedAssemblies)" Importance="normal" />
|
||||
<Message Text="Merged Output in: $(MergeOutputFile)" Importance="normal" />
|
||||
<Message Text="Key file: $(ILMergeKeyFile)" Importance="normal" />
|
||||
<Message Text="Libraries in: $(ILMergeLibraryPath)" Importance="normal" />
|
||||
<Message Text="Packages in: $(ILMergePackagesPath)" Importance="normal" />
|
||||
<Message Text="Merge order file: $(ILMergeOrderFile)" Importance="normal" />
|
||||
<Message Text="Internalization enabled: $(ILMergeInternalize)" Importance="normal" />
|
||||
<Message Text="Local content: @(LocalContentFiles)" Importance="low" />
|
||||
|
||||
<!-- run ILMerge -->
|
||||
<!-- not supported: AllowWildCards, Closed (use $Transitive instead), TargetKind (default), -->
|
||||
<MSBuild.ILMerge.Task
|
||||
KeyFile="$(ILMergeKeyFile)"
|
||||
OutputFile="$(MergeOutputFile)"
|
||||
LibraryPath="$(ILMergeLibraryPath)"
|
||||
InputAssemblies="$(MergedAssemblies)"
|
||||
LibraryAssemblies="$(UnmergedAssemblies)"
|
||||
PackagesDir="$(ILMergePackagesPath)"
|
||||
MergeOrderFile="$(ILMergeOrderFile)"
|
||||
AllowDuplicateType="$(ILMergeAllowDuplicateType)"
|
||||
AllowMultipleAssemblyLevelAttributes="$(ILMergeAllowMultipleAssemblyLevelAttributes)"
|
||||
AllowZeroPeKind="$(ILMergeAllowZeroPeKind)"
|
||||
CopyAttributes="$(ILMergeCopyAttributes)"
|
||||
DebugInfo="$(ILMergeDebugInfo)"
|
||||
DelaySign="$(ILMergeDelaySign)"
|
||||
FileAlignment="$(ILMergeFileAlignment)"
|
||||
Internalize="$(ILMergeInternalize)"
|
||||
InternalizeExcludeFile ="$(ILMergeInternalizeExcludeFile)"
|
||||
XmlDocumentation="$(ILMergeXmlDocumentation)"
|
||||
PublicKeyTokens="$(ILMergePublicKeyTokens)"
|
||||
ShouldLog="$(ILMergeShouldLog)"
|
||||
TargetPlatform="$(ILTargetPlatform)"
|
||||
UnionMerge="$(ILUnionMerge)" />
|
||||
<!-- copy content files marked as copy always or newest -->
|
||||
<Copy SourceFiles="@(LocalContentFiles)" DestinationFolder="$(OutputPath)" />
|
||||
<!-- copy config file (???) -->
|
||||
<CallTarget Targets="_CopyAppConfigFile" Condition="'%(IntermediateAssembly.Extension)' == '.exe'"/>
|
||||
</Target>
|
||||
<UsingTask AssemblyFile="$(ILMergeToolsPath)MSBuild.ILMerge.Task.dll" TaskName="MSBuild.ILMerge.Task" />
|
||||
</Project>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- -->
|
||||
<!-- ILMerge project-specific settings. Almost never need to be set explicitly. -->
|
||||
<!-- for details, see http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx -->
|
||||
<!-- -->
|
||||
<!-- *** set this file to Type=None, CopyToOutput=Never *** -->
|
||||
|
||||
<!-- If True, all copy local dependencies will also be merged from referenced projects whether they are referenced in the current project explicitly or not -->
|
||||
<ILMergeTransitive>true</ILMergeTransitive>
|
||||
|
||||
<!-- Extra ILMerge library paths (semicolon-separated). Dont put your package dependencies here, they will be added automagically -->
|
||||
<ILMergeLibraryPath></ILMergeLibraryPath>
|
||||
|
||||
<!-- The solution NuGet package directory if not standard 'SOLUTION\packages' -->
|
||||
<ILMergePackagesPath></ILMergePackagesPath>
|
||||
|
||||
<!-- The merge order file name if differs from standard 'ILMergeOrder.txt' -->
|
||||
<ILMergeOrderFile></ILMergeOrderFile>
|
||||
|
||||
<!-- The strong key file name if not specified in the project -->
|
||||
<ILMergeKeyFile></ILMergeKeyFile>
|
||||
|
||||
<!-- The assembly version if differs for the version of the main assembly -->
|
||||
<ILMergeAssemblyVersion></ILMergeAssemblyVersion>
|
||||
|
||||
<!-- added in Version 1.0.4 -->
|
||||
<ILMergeFileAlignment></ILMergeFileAlignment>
|
||||
|
||||
<!-- added in Version 1.0.4, default=none -->
|
||||
<ILMergeAllowDuplicateType></ILMergeAllowDuplicateType>
|
||||
|
||||
<!-- If the <see cref="CopyAttributes"/> is also set, any assembly-level attributes names that have the same type are copied over into the target assembly -->
|
||||
<ILMergeAllowMultipleAssemblyLevelAttributes></ILMergeAllowMultipleAssemblyLevelAttributes>
|
||||
|
||||
<!-- See ILMerge documentation -->
|
||||
<ILMergeAllowZeroPeKind></ILMergeAllowZeroPeKind>
|
||||
|
||||
<!-- The assembly level attributes of each input assembly are copied over into the target assembly -->
|
||||
<ILMergeCopyAttributes></ILMergeCopyAttributes>
|
||||
|
||||
<!-- Creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies, default=true -->
|
||||
<ILMergeDebugInfo></ILMergeDebugInfo>
|
||||
|
||||
<!-- Target assembly will be delay signed -->
|
||||
<ILMergeDelaySign></ILMergeDelaySign>
|
||||
|
||||
<!-- Types in assemblies other than the primary assembly have their visibility modified -->
|
||||
<ILMergeInternalize></ILMergeInternalize>
|
||||
|
||||
<!-- The path name of the file that will be used to identify types that are not to have their visibility modified -->
|
||||
<ILMergeInternalizeExcludeFile></ILMergeInternalizeExcludeFile>
|
||||
|
||||
<!-- XML documentation files are merged to produce an XML documentation file for the target assembly -->
|
||||
<ILMergeXmlDocumentation></ILMergeXmlDocumentation>
|
||||
|
||||
<!-- External assembly references in the manifest of the target assembly will use full public keys (false) or public key tokens (true, default value) -->
|
||||
<ILMergePublicKeyTokens></ILMergePublicKeyTokens>
|
||||
|
||||
<!-- Types with the same name are all merged into a single type in the target assembly -->
|
||||
<ILMergeUnionMerge></ILMergeUnionMerge>
|
||||
|
||||
<!-- The version of the target framework, default 40 (works for 45 too) -->
|
||||
<ILTargetPlatform></ILTargetPlatform>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
# this file contains the partial list of the merged assemblies in the merge order
|
||||
# you can fill it from the obj\CONFIG\PROJECT.ilmerge generated on every build
|
||||
# and finetune merge order to your satisfaction
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user