2
0

Added copy to clipboard support

Fixed Win8.1 installer issue
Changed username to Full Name and allowed all casing
This commit is contained in:
Michel Verhagen 2014-11-17 23:31:40 +13:00
parent 66220ed34e
commit b533400286
8 changed files with 71 additions and 25 deletions

View File

@ -19,7 +19,7 @@
--> -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="$(var.MasterPassword.ProjectName)" Language="1033" Version="!(bind.FileVersion.ProjectOutput)" Manufacturer="GuruCE" UpgradeCode="40c052f9-f8e1-422c-b78c-83f980f3355b"> <Product Id="*" Name="$(var.MasterPassword.ProjectName)" Language="1033" Version="!(bind.FileVersion.ProjectOutput)" Manufacturer="GuruCE" UpgradeCode="40c052f9-f8e1-422c-b78c-83f980f3355b">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" /> <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<MajorUpgrade Schedule="afterInstallValidate" DowngradeErrorMessage="A newer version of [ProductName] is already installed."/> <MajorUpgrade Schedule="afterInstallValidate" DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>

View File

@ -1,6 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="MasterPassword.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
<userSettings>
<MasterPassword.Properties.Settings>
<setting name="c2c" serializeAs="String">
<value>False</value>
</setting>
</MasterPassword.Properties.Settings>
</userSettings>
</configuration> </configuration>

View File

@ -50,4 +50,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.3.0.0")]

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.18444 // Runtime Version:4.0.30319.34014
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@ -22,5 +22,18 @@ namespace MasterPassword.Properties {
return defaultInstance; return defaultInstance;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public bool c2c {
get {
return ((bool)(this["c2c"]));
}
set {
this["c2c"] = value;
}
}
} }
} }

View File

@ -1,7 +1,9 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MasterPassword.Properties" GeneratedClassName="Settings">
<Profiles> <Profiles />
<Profile Name="(Default)" /> <Settings>
</Profiles> <Setting Name="c2c" Roaming="true" Type="System.Boolean" Scope="User">
<Settings /> <Value Profile="(Default)">False</Value>
</SettingsFile> </Setting>
</Settings>
</SettingsFile>

View File

@ -62,6 +62,7 @@ namespace MasterPassword
this.cmbSite = new System.Windows.Forms.ComboBox(); this.cmbSite = new System.Windows.Forms.ComboBox();
this.btnDelete = new System.Windows.Forms.Button(); this.btnDelete = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.chkC2C = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.nudCounter)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudCounter)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -70,15 +71,14 @@ namespace MasterPassword
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 73); this.label1.Location = new System.Drawing.Point(12, 73);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(58, 13); this.label1.Size = new System.Drawing.Size(55, 13);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "Username:"; this.label1.Text = "Full name:";
// //
// txtUsername // txtUsername
// //
this.txtUsername.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.txtUsername.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.txtUsername.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower;
this.txtUsername.Location = new System.Drawing.Point(77, 65); this.txtUsername.Location = new System.Drawing.Point(77, 65);
this.txtUsername.Name = "txtUsername"; this.txtUsername.Name = "txtUsername";
this.txtUsername.Size = new System.Drawing.Size(235, 20); this.txtUsername.Size = new System.Drawing.Size(235, 20);
@ -150,7 +150,7 @@ namespace MasterPassword
0, 0,
0}); 0});
this.nudCounter.Name = "nudCounter"; this.nudCounter.Name = "nudCounter";
this.nudCounter.Size = new System.Drawing.Size(125, 20); this.nudCounter.Size = new System.Drawing.Size(73, 20);
this.nudCounter.TabIndex = 5; this.nudCounter.TabIndex = 5;
this.nudCounter.Value = new decimal(new int[] { this.nudCounter.Value = new decimal(new int[] {
1, 1,
@ -169,7 +169,7 @@ namespace MasterPassword
this.txtPassword.Name = "txtPassword"; this.txtPassword.Name = "txtPassword";
this.txtPassword.ReadOnly = true; this.txtPassword.ReadOnly = true;
this.txtPassword.Size = new System.Drawing.Size(235, 31); this.txtPassword.Size = new System.Drawing.Size(235, 31);
this.txtPassword.TabIndex = 7; this.txtPassword.TabIndex = 8;
this.txtPassword.TabStop = false; this.txtPassword.TabStop = false;
// //
// label5 // label5
@ -205,10 +205,10 @@ namespace MasterPassword
// //
this.btnGetPassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnGetPassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnGetPassword.Enabled = false; this.btnGetPassword.Enabled = false;
this.btnGetPassword.Location = new System.Drawing.Point(209, 119); this.btnGetPassword.Location = new System.Drawing.Point(224, 119);
this.btnGetPassword.Name = "btnGetPassword"; this.btnGetPassword.Name = "btnGetPassword";
this.btnGetPassword.Size = new System.Drawing.Size(103, 23); this.btnGetPassword.Size = new System.Drawing.Size(88, 23);
this.btnGetPassword.TabIndex = 6; this.btnGetPassword.TabIndex = 7;
this.btnGetPassword.Text = "Get &Password"; this.btnGetPassword.Text = "Get &Password";
this.btnGetPassword.UseVisualStyleBackColor = true; this.btnGetPassword.UseVisualStyleBackColor = true;
this.btnGetPassword.Click += new System.EventHandler(this.btnGetPassword_Click); this.btnGetPassword.Click += new System.EventHandler(this.btnGetPassword_Click);
@ -223,7 +223,7 @@ namespace MasterPassword
this.cmbSite.Location = new System.Drawing.Point(77, 38); this.cmbSite.Location = new System.Drawing.Point(77, 38);
this.cmbSite.Name = "cmbSite"; this.cmbSite.Name = "cmbSite";
this.cmbSite.Size = new System.Drawing.Size(235, 21); this.cmbSite.Size = new System.Drawing.Size(235, 21);
this.cmbSite.TabIndex = 1; this.cmbSite.TabIndex = 2;
this.cmbSite.SelectedIndexChanged += new System.EventHandler(this.cmbSite_Check); this.cmbSite.SelectedIndexChanged += new System.EventHandler(this.cmbSite_Check);
this.cmbSite.Enter += new System.EventHandler(this.cmbSite_Enter); this.cmbSite.Enter += new System.EventHandler(this.cmbSite_Enter);
this.cmbSite.Leave += new System.EventHandler(this.cmbSite_Check); this.cmbSite.Leave += new System.EventHandler(this.cmbSite_Check);
@ -237,19 +237,30 @@ namespace MasterPassword
this.btnDelete.Location = new System.Drawing.Point(51, 40); this.btnDelete.Location = new System.Drawing.Point(51, 40);
this.btnDelete.Name = "btnDelete"; this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(19, 19); this.btnDelete.Size = new System.Drawing.Size(19, 19);
this.btnDelete.TabIndex = 2; this.btnDelete.TabIndex = 1;
this.btnDelete.TabStop = false; this.btnDelete.TabStop = false;
this.btnDelete.UseVisualStyleBackColor = true; this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
// //
// chkC2C
//
this.chkC2C.AutoSize = true;
this.chkC2C.Location = new System.Drawing.Point(156, 122);
this.chkC2C.Name = "chkC2C";
this.chkC2C.Size = new System.Drawing.Size(70, 17);
this.chkC2C.TabIndex = 6;
this.chkC2C.Text = "Clipboard";
this.chkC2C.UseVisualStyleBackColor = true;
//
// frmMain // frmMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(324, 182); this.ClientSize = new System.Drawing.Size(324, 181);
this.Controls.Add(this.btnGetPassword);
this.Controls.Add(this.chkC2C);
this.Controls.Add(this.btnDelete); this.Controls.Add(this.btnDelete);
this.Controls.Add(this.cmbSite); this.Controls.Add(this.cmbSite);
this.Controls.Add(this.btnGetPassword);
this.Controls.Add(this.txtMasterPassword); this.Controls.Add(this.txtMasterPassword);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
this.Controls.Add(this.label5); this.Controls.Add(this.label5);
@ -291,6 +302,7 @@ namespace MasterPassword
private System.Windows.Forms.ComboBox cmbSite; private System.Windows.Forms.ComboBox cmbSite;
private System.Windows.Forms.Button btnDelete; private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.CheckBox chkC2C;
} }
} }

View File

@ -39,6 +39,8 @@ namespace MasterPassword
timerVisibitlity.Interval = PASSWORD_VISIBILITY_MS; timerVisibitlity.Interval = PASSWORD_VISIBILITY_MS;
timerVisibitlity.Tick += timerVisibitlity_Tick; timerVisibitlity.Tick += timerVisibitlity_Tick;
chkC2C.Checked = Properties.Settings.Default.c2c;
#region Test Case #region Test Case
// Test case, should produce: // Test case, should produce:
// masterKeySalt ID: 8C-45-CA-48-46-73-5F-C7-29-ED-8B-52-E8-74-88-15-5E-18-56-B9-CD-CA-6D-FF-88-10-A6-E8-46-BE-ED-20 // masterKeySalt ID: 8C-45-CA-48-46-73-5F-C7-29-ED-8B-52-E8-74-88-15-5E-18-56-B9-CD-CA-6D-FF-88-10-A6-E8-46-BE-ED-20
@ -139,6 +141,9 @@ namespace MasterPassword
if (cmbType.SelectedIndex == -1) if (cmbType.SelectedIndex == -1)
cmbType.SelectedIndex = 0; cmbType.SelectedIndex = 0;
txtPassword.Text = MasterPassword.Calculate(txtMasterPassword.Text, txtUsername.Text, cmbSite.Text, (int)nudCounter.Value, (MasterPassword.MPType)cmbType.SelectedIndex); txtPassword.Text = MasterPassword.Calculate(txtMasterPassword.Text, txtUsername.Text, cmbSite.Text, (int)nudCounter.Value, (MasterPassword.MPType)cmbType.SelectedIndex);
if (chkC2C.Checked)
Clipboard.SetText(txtPassword.Text);
timerVisibitlity.Stop();
timerVisibitlity.Start(); timerVisibitlity.Start();
if (mruData.ContainsKey(cmbSite.Text)) if (mruData.ContainsKey(cmbSite.Text))
{ // Update mruData { // Update mruData
@ -163,6 +168,8 @@ namespace MasterPassword
fileTitle = fileTitle.Replace("-", string.Empty); fileTitle = fileTitle.Replace("-", string.Empty);
SaveMRU(fileTitle + ".dat"); SaveMRU(fileTitle + ".dat");
} }
Properties.Settings.Default.c2c = chkC2C.Checked;
Properties.Settings.Default.Save();
} }
private void cmbSite_Check(object sender, EventArgs e) private void cmbSite_Check(object sender, EventArgs e)

View File

@ -120,10 +120,10 @@
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnDelete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnDelete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
YQUAAAAJcEhZcwAADsAAAA7AAWrWiQkAAACFSURBVDhPhZABCsAwCAN9en++1dFI1NgdBKZN0jJTLLOn vwAADr8BOAVTJAAAAIVJREFUOE+FkAEKwDAIA316f77V0UjU2B0Epk3SMlMss6fqHN2BebubfoumYJUs
6hzdgXm7m36LpmCVLElhh2exbyVRwGAn9u5fa+1PDkOMmo/iFa3ApSieeIUscDHi/F6gKJ65gFHzURSk SWGHZ7FvJVHAYCf27l9r7U8OQ4yaj+IVrcClKJ54hSxwMeL8XqAonrmAUfNRFKT/wGAn9gj3Aph5Fvt0
/8BgJ/YI9wKYeRb7dDtIJRe125nvkMwsnI1h8Bk4UILXMMOBOWj2ArMw0u96HiIGAAAAAElFTkSuQmCC O0glF7Xbme+QzCycjWHwGThQgtcww4E5aPYCszDS73oeIgYAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">