mirror of https://github.com/quasar/Quasar.git
Improved Builder Hosts List
This commit is contained in:
parent
173e600cf2
commit
4cb311f792
|
@ -26,5 +26,16 @@ namespace xServer.Core.Helper
|
|||
return type.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string GenerateMutex(int length = 18)
|
||||
{
|
||||
return "xRAT_MUTEX_" + FileHelper.GetRandomFilename(length);
|
||||
}
|
||||
|
||||
public static bool IsValidVersionNumber(string input)
|
||||
{
|
||||
Match match = Regex.Match(input, @"^[0-9]+\.[0-9]+\.(\*|[0-9]+)\.(\*|[0-9]+)$", RegexOptions.IgnoreCase);
|
||||
return match.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using xServer.Core.Utilities;
|
||||
|
@ -37,5 +38,15 @@ namespace xServer.Core.Helper
|
|||
|
||||
return rawHosts.ToString();
|
||||
}
|
||||
|
||||
public static string GetRawHosts(BindingList<Host> hosts)
|
||||
{
|
||||
StringBuilder rawHosts = new StringBuilder();
|
||||
|
||||
foreach (var host in hosts)
|
||||
rawHosts.Append(host + ";");
|
||||
|
||||
return rawHosts.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,8 +32,15 @@
|
|||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmBuilder));
|
||||
this.btnBuild = new System.Windows.Forms.Button();
|
||||
this.tooltip = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.picUAC2 = new System.Windows.Forms.PictureBox();
|
||||
this.picUAC1 = new System.Windows.Forms.PictureBox();
|
||||
this.rbSystem = new System.Windows.Forms.RadioButton();
|
||||
this.rbProgramFiles = new System.Windows.Forms.RadioButton();
|
||||
this.chkElevation = new System.Windows.Forms.CheckBox();
|
||||
this.chkIconChange = new System.Windows.Forms.CheckBox();
|
||||
this.ctxtMenuHosts = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.ctxtRemove = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ctxtClear = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.builderTabs = new xServer.Controls.DotNetBarTabControl();
|
||||
this.generalPage = new System.Windows.Forms.TabPage();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
|
@ -72,12 +79,8 @@
|
|||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.line4 = new xServer.Controls.Line();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.picUAC2 = new System.Windows.Forms.PictureBox();
|
||||
this.picUAC1 = new System.Windows.Forms.PictureBox();
|
||||
this.chkInstall = new System.Windows.Forms.CheckBox();
|
||||
this.rbSystem = new System.Windows.Forms.RadioButton();
|
||||
this.lblInstallname = new System.Windows.Forms.Label();
|
||||
this.rbProgramFiles = new System.Windows.Forms.RadioButton();
|
||||
this.txtInstallname = new System.Windows.Forms.TextBox();
|
||||
this.txtRegistryKeyName = new System.Windows.Forms.TextBox();
|
||||
this.lblExtension = new System.Windows.Forms.Label();
|
||||
|
@ -117,15 +120,13 @@
|
|||
this.line9 = new xServer.Controls.Line();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.chkKeylogger = new System.Windows.Forms.CheckBox();
|
||||
this.chkElevation = new System.Windows.Forms.CheckBox();
|
||||
this.chkIconChange = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC1)).BeginInit();
|
||||
this.ctxtMenuHosts.SuspendLayout();
|
||||
this.builderTabs.SuspendLayout();
|
||||
this.generalPage.SuspendLayout();
|
||||
this.connectionPage.SuspendLayout();
|
||||
this.installationPage.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC1)).BeginInit();
|
||||
this.assemblyPage.SuspendLayout();
|
||||
this.additionalTab.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
|
@ -140,21 +141,102 @@
|
|||
this.btnBuild.UseVisualStyleBackColor = true;
|
||||
this.btnBuild.Click += new System.EventHandler(this.btnBuild_Click);
|
||||
//
|
||||
// picUAC2
|
||||
//
|
||||
this.picUAC2.Image = global::xServer.Properties.Resources.uac_shield;
|
||||
this.picUAC2.Location = new System.Drawing.Point(363, 88);
|
||||
this.picUAC2.Name = "picUAC2";
|
||||
this.picUAC2.Size = new System.Drawing.Size(16, 20);
|
||||
this.picUAC2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.picUAC2.TabIndex = 32;
|
||||
this.picUAC2.TabStop = false;
|
||||
this.tooltip.SetToolTip(this.picUAC2, "Administrator Privileges are required to install the client in System.");
|
||||
//
|
||||
// picUAC1
|
||||
//
|
||||
this.picUAC1.Image = global::xServer.Properties.Resources.uac_shield;
|
||||
this.picUAC1.Location = new System.Drawing.Point(363, 68);
|
||||
this.picUAC1.Name = "picUAC1";
|
||||
this.picUAC1.Size = new System.Drawing.Size(16, 20);
|
||||
this.picUAC1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.picUAC1.TabIndex = 31;
|
||||
this.picUAC1.TabStop = false;
|
||||
this.tooltip.SetToolTip(this.picUAC1, "Administrator Privileges are required to install the client in Program Files.");
|
||||
//
|
||||
// rbSystem
|
||||
//
|
||||
this.rbSystem.AutoSize = true;
|
||||
this.rbSystem.Location = new System.Drawing.Point(241, 91);
|
||||
this.rbSystem.Name = "rbSystem";
|
||||
this.rbSystem.Size = new System.Drawing.Size(60, 17);
|
||||
this.rbSystem.TabIndex = 5;
|
||||
this.rbSystem.TabStop = true;
|
||||
this.rbSystem.Text = "System";
|
||||
this.tooltip.SetToolTip(this.rbSystem, "Administrator Privileges are required to install the client in System.");
|
||||
this.rbSystem.UseVisualStyleBackColor = true;
|
||||
this.rbSystem.CheckedChanged += new System.EventHandler(this.HasChangedSettingAndFilePath);
|
||||
//
|
||||
// rbProgramFiles
|
||||
//
|
||||
this.rbProgramFiles.AutoSize = true;
|
||||
this.rbProgramFiles.Location = new System.Drawing.Point(241, 68);
|
||||
this.rbProgramFiles.Name = "rbProgramFiles";
|
||||
this.rbProgramFiles.Size = new System.Drawing.Size(94, 17);
|
||||
this.rbProgramFiles.TabIndex = 4;
|
||||
this.rbProgramFiles.TabStop = true;
|
||||
this.rbProgramFiles.Text = "Program Files";
|
||||
this.tooltip.SetToolTip(this.rbProgramFiles, "Administrator Privileges are required to install the client in Program Files.");
|
||||
this.rbProgramFiles.UseVisualStyleBackColor = true;
|
||||
this.rbProgramFiles.CheckedChanged += new System.EventHandler(this.HasChangedSettingAndFilePath);
|
||||
//
|
||||
// chkElevation
|
||||
//
|
||||
this.chkElevation.AutoSize = true;
|
||||
this.chkElevation.Location = new System.Drawing.Point(23, 119);
|
||||
this.chkElevation.Name = "chkElevation";
|
||||
this.chkElevation.Size = new System.Drawing.Size(147, 17);
|
||||
this.chkElevation.TabIndex = 5;
|
||||
this.chkElevation.Text = "Enable Admin Elevation";
|
||||
this.tooltip.SetToolTip(this.chkElevation, "Custom social engineering tactic to elevate Admin privileges.");
|
||||
this.chkElevation.UseVisualStyleBackColor = true;
|
||||
this.chkElevation.CheckedChanged += new System.EventHandler(this.HasChangedSetting);
|
||||
//
|
||||
// chkIconChange
|
||||
//
|
||||
this.chkIconChange.AutoSize = true;
|
||||
this.chkIconChange.Location = new System.Drawing.Point(23, 39);
|
||||
this.chkIconChange.Name = "chkIconChange";
|
||||
this.chkIconChange.Size = new System.Drawing.Size(91, 17);
|
||||
this.chkIconChange.TabIndex = 2;
|
||||
this.chkIconChange.Text = "Change Icon";
|
||||
this.tooltip.SetToolTip(this.chkIconChange, "Custom social engineering tactic to elevate Admin privileges.");
|
||||
this.chkIconChange.UseVisualStyleBackColor = true;
|
||||
this.chkIconChange.CheckedChanged += new System.EventHandler(this.HasChangedSetting);
|
||||
//
|
||||
// ctxtMenuHosts
|
||||
//
|
||||
this.ctxtMenuHosts.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.ctxtRemove});
|
||||
this.ctxtRemove,
|
||||
this.ctxtClear});
|
||||
this.ctxtMenuHosts.Name = "ctxtMenuHosts";
|
||||
this.ctxtMenuHosts.Size = new System.Drawing.Size(118, 26);
|
||||
this.ctxtMenuHosts.Size = new System.Drawing.Size(144, 48);
|
||||
//
|
||||
// ctxtRemove
|
||||
//
|
||||
this.ctxtRemove.Image = global::xServer.Properties.Resources.delete;
|
||||
this.ctxtRemove.Name = "ctxtRemove";
|
||||
this.ctxtRemove.Size = new System.Drawing.Size(117, 22);
|
||||
this.ctxtRemove.Text = "Remove";
|
||||
this.ctxtRemove.Size = new System.Drawing.Size(143, 22);
|
||||
this.ctxtRemove.Text = "Remove host";
|
||||
this.ctxtRemove.Click += new System.EventHandler(this.ctxtRemove_Click);
|
||||
//
|
||||
// ctxtClear
|
||||
//
|
||||
this.ctxtClear.Image = global::xServer.Properties.Resources.broom;
|
||||
this.ctxtClear.Name = "ctxtClear";
|
||||
this.ctxtClear.Size = new System.Drawing.Size(143, 22);
|
||||
this.ctxtClear.Text = "Clear all";
|
||||
this.ctxtClear.Click += new System.EventHandler(this.ctxtClear_Click);
|
||||
//
|
||||
// builderTabs
|
||||
//
|
||||
this.builderTabs.Alignment = System.Windows.Forms.TabAlignment.Left;
|
||||
|
@ -569,28 +651,6 @@
|
|||
this.label5.TabIndex = 0;
|
||||
this.label5.Text = "Installation Location";
|
||||
//
|
||||
// picUAC2
|
||||
//
|
||||
this.picUAC2.Image = global::xServer.Properties.Resources.uac_shield;
|
||||
this.picUAC2.Location = new System.Drawing.Point(363, 88);
|
||||
this.picUAC2.Name = "picUAC2";
|
||||
this.picUAC2.Size = new System.Drawing.Size(16, 20);
|
||||
this.picUAC2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.picUAC2.TabIndex = 32;
|
||||
this.picUAC2.TabStop = false;
|
||||
this.tooltip.SetToolTip(this.picUAC2, "Administrator Privileges are required to install the client in System.");
|
||||
//
|
||||
// picUAC1
|
||||
//
|
||||
this.picUAC1.Image = global::xServer.Properties.Resources.uac_shield;
|
||||
this.picUAC1.Location = new System.Drawing.Point(363, 68);
|
||||
this.picUAC1.Name = "picUAC1";
|
||||
this.picUAC1.Size = new System.Drawing.Size(16, 20);
|
||||
this.picUAC1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.picUAC1.TabIndex = 31;
|
||||
this.picUAC1.TabStop = false;
|
||||
this.tooltip.SetToolTip(this.picUAC1, "Administrator Privileges are required to install the client in Program Files.");
|
||||
//
|
||||
// chkInstall
|
||||
//
|
||||
this.chkInstall.AutoSize = true;
|
||||
|
@ -602,19 +662,6 @@
|
|||
this.chkInstall.UseVisualStyleBackColor = true;
|
||||
this.chkInstall.CheckedChanged += new System.EventHandler(this.chkInstall_CheckedChanged);
|
||||
//
|
||||
// rbSystem
|
||||
//
|
||||
this.rbSystem.AutoSize = true;
|
||||
this.rbSystem.Location = new System.Drawing.Point(241, 91);
|
||||
this.rbSystem.Name = "rbSystem";
|
||||
this.rbSystem.Size = new System.Drawing.Size(60, 17);
|
||||
this.rbSystem.TabIndex = 5;
|
||||
this.rbSystem.TabStop = true;
|
||||
this.rbSystem.Text = "System";
|
||||
this.tooltip.SetToolTip(this.rbSystem, "Administrator Privileges are required to install the client in System.");
|
||||
this.rbSystem.UseVisualStyleBackColor = true;
|
||||
this.rbSystem.CheckedChanged += new System.EventHandler(this.HasChangedSettingAndFilePath);
|
||||
//
|
||||
// lblInstallname
|
||||
//
|
||||
this.lblInstallname.AutoSize = true;
|
||||
|
@ -624,19 +671,6 @@
|
|||
this.lblInstallname.TabIndex = 8;
|
||||
this.lblInstallname.Text = "Install Name:";
|
||||
//
|
||||
// rbProgramFiles
|
||||
//
|
||||
this.rbProgramFiles.AutoSize = true;
|
||||
this.rbProgramFiles.Location = new System.Drawing.Point(241, 68);
|
||||
this.rbProgramFiles.Name = "rbProgramFiles";
|
||||
this.rbProgramFiles.Size = new System.Drawing.Size(94, 17);
|
||||
this.rbProgramFiles.TabIndex = 4;
|
||||
this.rbProgramFiles.TabStop = true;
|
||||
this.rbProgramFiles.Text = "Program Files";
|
||||
this.tooltip.SetToolTip(this.rbProgramFiles, "Administrator Privileges are required to install the client in Program Files.");
|
||||
this.rbProgramFiles.UseVisualStyleBackColor = true;
|
||||
this.rbProgramFiles.CheckedChanged += new System.EventHandler(this.HasChangedSettingAndFilePath);
|
||||
//
|
||||
// txtInstallname
|
||||
//
|
||||
this.txtInstallname.Location = new System.Drawing.Point(182, 153);
|
||||
|
@ -1018,30 +1052,6 @@
|
|||
this.chkKeylogger.UseVisualStyleBackColor = true;
|
||||
this.chkKeylogger.CheckedChanged += new System.EventHandler(this.HasChangedSetting);
|
||||
//
|
||||
// chkElevation
|
||||
//
|
||||
this.chkElevation.AutoSize = true;
|
||||
this.chkElevation.Location = new System.Drawing.Point(23, 119);
|
||||
this.chkElevation.Name = "chkElevation";
|
||||
this.chkElevation.Size = new System.Drawing.Size(147, 17);
|
||||
this.chkElevation.TabIndex = 5;
|
||||
this.chkElevation.Text = "Enable Admin Elevation";
|
||||
this.tooltip.SetToolTip(this.chkElevation, "Custom social engineering tactic to elevate Admin privileges.");
|
||||
this.chkElevation.UseVisualStyleBackColor = true;
|
||||
this.chkElevation.CheckedChanged += new System.EventHandler(this.HasChangedSetting);
|
||||
//
|
||||
// chkIconChange
|
||||
//
|
||||
this.chkIconChange.AutoSize = true;
|
||||
this.chkIconChange.Location = new System.Drawing.Point(23, 39);
|
||||
this.chkIconChange.Name = "chkIconChange";
|
||||
this.chkIconChange.Size = new System.Drawing.Size(91, 17);
|
||||
this.chkIconChange.TabIndex = 2;
|
||||
this.chkIconChange.Text = "Change Icon";
|
||||
this.tooltip.SetToolTip(this.chkIconChange, "Custom social engineering tactic to elevate Admin privileges.");
|
||||
this.chkIconChange.UseVisualStyleBackColor = true;
|
||||
this.chkIconChange.CheckedChanged += new System.EventHandler(this.HasChangedSetting);
|
||||
//
|
||||
// FrmBuilder
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -1060,6 +1070,8 @@
|
|||
this.Text = "Client Builder";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmBuilder_FormClosing);
|
||||
this.Load += new System.EventHandler(this.FrmBuilder_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC1)).EndInit();
|
||||
this.ctxtMenuHosts.ResumeLayout(false);
|
||||
this.builderTabs.ResumeLayout(false);
|
||||
this.generalPage.ResumeLayout(false);
|
||||
|
@ -1068,8 +1080,6 @@
|
|||
this.connectionPage.PerformLayout();
|
||||
this.installationPage.ResumeLayout(false);
|
||||
this.installationPage.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picUAC1)).EndInit();
|
||||
this.assemblyPage.ResumeLayout(false);
|
||||
this.assemblyPage.PerformLayout();
|
||||
this.additionalTab.ResumeLayout(false);
|
||||
|
@ -1169,5 +1179,6 @@
|
|||
private System.Windows.Forms.Label label12;
|
||||
private Controls.Line line10;
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.ToolStripMenuItem ctxtClear;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using xServer.Core.Build;
|
||||
using xServer.Core.Helper;
|
||||
|
@ -15,36 +15,19 @@ namespace xServer.Forms
|
|||
{
|
||||
private bool _profileLoaded;
|
||||
private bool _changed;
|
||||
private List<Host> _hosts = new List<Host>();
|
||||
private BindingList<Host> _hosts = new BindingList<Host>();
|
||||
|
||||
public FrmBuilder()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void HasChanged()
|
||||
{
|
||||
if (!_changed && _profileLoaded)
|
||||
_changed = true;
|
||||
}
|
||||
|
||||
private void UpdateControlStates()
|
||||
{
|
||||
txtInstallname.Enabled = chkInstall.Checked;
|
||||
rbAppdata.Enabled = chkInstall.Checked;
|
||||
rbProgramFiles.Enabled = chkInstall.Checked;
|
||||
rbSystem.Enabled = chkInstall.Checked;
|
||||
txtInstallsub.Enabled = chkInstall.Checked;
|
||||
chkHide.Enabled = chkInstall.Checked;
|
||||
chkStartup.Enabled = chkInstall.Checked;
|
||||
txtRegistryKeyName.Enabled = (chkInstall.Checked && chkStartup.Checked);
|
||||
}
|
||||
|
||||
private void LoadProfile(string profilename)
|
||||
{
|
||||
ProfileManager pm = new ProfileManager(profilename + ".xml");
|
||||
var rawHosts = pm.ReadValueSafe("Hosts");
|
||||
_hosts.AddRange(HostHelper.GetHostsList(rawHosts));
|
||||
foreach (var host in HostHelper.GetHostsList(rawHosts))
|
||||
_hosts.Add(host);
|
||||
lstHosts.DataSource = new BindingSource(_hosts, null);
|
||||
txtPassword.Text = pm.ReadValue("Password");
|
||||
txtDelay.Text = pm.ReadValue("Delay");
|
||||
|
@ -106,7 +89,7 @@ namespace xServer.Forms
|
|||
{
|
||||
txtPort.Text = XMLSettings.ListenPort.ToString();
|
||||
txtPassword.Text = XMLSettings.Password;
|
||||
txtMutex.Text = FileHelper.GetRandomFilename(32);
|
||||
txtMutex.Text = FormatHelper.GenerateMutex();
|
||||
}
|
||||
|
||||
UpdateControlStates();
|
||||
|
@ -142,19 +125,18 @@ namespace xServer.Forms
|
|||
}
|
||||
|
||||
_hosts.Add(new Host {Hostname = host, Port = port});
|
||||
lstHosts.DataSource = new BindingSource(_hosts, null);
|
||||
|
||||
txtHost.Text = "";
|
||||
txtPort.Text = "";
|
||||
}
|
||||
|
||||
#region "Context Menu"
|
||||
private void ctxtRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
HasChanged();
|
||||
|
||||
List<string> selected = (from object arr in lstHosts.SelectedItems select arr.ToString()).ToList();
|
||||
List<string> selectedHosts = (from object arr in lstHosts.SelectedItems select arr.ToString()).ToList();
|
||||
|
||||
foreach (var item in selected)
|
||||
foreach (var item in selectedHosts)
|
||||
{
|
||||
foreach (var host in _hosts)
|
||||
{
|
||||
|
@ -165,10 +147,17 @@ namespace xServer.Forms
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
lstHosts.DataSource = new BindingSource(_hosts, null);
|
||||
}
|
||||
|
||||
private void ctxtClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
HasChanged();
|
||||
|
||||
_hosts.Clear();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "Misc"
|
||||
private void chkShowPass_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
txtPassword.PasswordChar = (chkShowPass.Checked) ? '\0' : '•';
|
||||
|
@ -200,7 +189,7 @@ namespace xServer.Forms
|
|||
{
|
||||
HasChanged();
|
||||
|
||||
txtMutex.Text = FileHelper.GetRandomFilename(32);
|
||||
txtMutex.Text = FormatHelper.GenerateMutex();
|
||||
}
|
||||
|
||||
private void chkInstall_CheckedChanged(object sender, EventArgs e)
|
||||
|
@ -223,28 +212,7 @@ namespace xServer.Forms
|
|||
|
||||
ToggleAsmInfoControls();
|
||||
}
|
||||
|
||||
private void RefreshExamplePath()
|
||||
{
|
||||
string path = string.Empty;
|
||||
if (rbAppdata.Checked)
|
||||
path =
|
||||
Path.Combine(
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
txtInstallsub.Text), txtInstallname.Text);
|
||||
else if (rbProgramFiles.Checked)
|
||||
path =
|
||||
Path.Combine(
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
|
||||
txtInstallsub.Text), txtInstallname.Text);
|
||||
else if (rbSystem.Checked)
|
||||
path =
|
||||
Path.Combine(
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), txtInstallsub.Text),
|
||||
txtInstallname.Text);
|
||||
|
||||
this.Invoke((MethodInvoker) delegate { txtExamplePath.Text = path + ".exe"; });
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void btnBuild_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -287,8 +255,8 @@ namespace xServer.Forms
|
|||
string[] asmInfo = null;
|
||||
if (chkChangeAsmInfo.Checked)
|
||||
{
|
||||
if (!IsValidVersionNumber(txtProductVersion.Text) ||
|
||||
!IsValidVersionNumber(txtFileVersion.Text))
|
||||
if (!FormatHelper.IsValidVersionNumber(txtProductVersion.Text) ||
|
||||
!FormatHelper.IsValidVersionNumber(txtFileVersion.Text))
|
||||
{
|
||||
MessageBox.Show("Please enter a valid version number!\nExample: 1.0.0.0", "Builder",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
|
@ -333,6 +301,28 @@ namespace xServer.Forms
|
|||
MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void RefreshExamplePath()
|
||||
{
|
||||
string path = string.Empty;
|
||||
if (rbAppdata.Checked)
|
||||
path =
|
||||
Path.Combine(
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
txtInstallsub.Text), txtInstallname.Text);
|
||||
else if (rbProgramFiles.Checked)
|
||||
path =
|
||||
Path.Combine(
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
|
||||
txtInstallsub.Text), txtInstallname.Text);
|
||||
else if (rbSystem.Checked)
|
||||
path =
|
||||
Path.Combine(
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), txtInstallsub.Text),
|
||||
txtInstallname.Text);
|
||||
|
||||
this.Invoke((MethodInvoker)delegate { txtExamplePath.Text = path + ".exe"; });
|
||||
}
|
||||
|
||||
private int GetInstallPath()
|
||||
{
|
||||
if (rbAppdata.Checked) return 1;
|
||||
|
@ -362,25 +352,41 @@ namespace xServer.Forms
|
|||
{
|
||||
foreach (Control ctrl in assemblyPage.Controls)
|
||||
{
|
||||
if (ctrl is Label)
|
||||
((Label) ctrl).Enabled = chkChangeAsmInfo.Checked;
|
||||
else if (ctrl is TextBox)
|
||||
((TextBox) ctrl).Enabled = chkChangeAsmInfo.Checked;
|
||||
var label = ctrl as Label;
|
||||
if (label != null)
|
||||
{
|
||||
label.Enabled = chkChangeAsmInfo.Checked;
|
||||
continue;
|
||||
}
|
||||
|
||||
var box = ctrl as TextBox;
|
||||
if (box != null)
|
||||
box.Enabled = chkChangeAsmInfo.Checked;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private bool IsValidVersionNumber(string input)
|
||||
private void HasChanged()
|
||||
{
|
||||
Match match = Regex.Match(input, @"^[0-9]+\.[0-9]+\.(\*|[0-9]+)\.(\*|[0-9]+)$", RegexOptions.IgnoreCase);
|
||||
return match.Success;
|
||||
if (!_changed && _profileLoaded)
|
||||
_changed = true;
|
||||
}
|
||||
|
||||
private void UpdateControlStates()
|
||||
{
|
||||
txtInstallname.Enabled = chkInstall.Checked;
|
||||
rbAppdata.Enabled = chkInstall.Checked;
|
||||
rbProgramFiles.Enabled = chkInstall.Checked;
|
||||
rbSystem.Enabled = chkInstall.Checked;
|
||||
txtInstallsub.Enabled = chkInstall.Checked;
|
||||
chkHide.Enabled = chkInstall.Checked;
|
||||
chkStartup.Enabled = chkInstall.Checked;
|
||||
txtRegistryKeyName.Enabled = (chkInstall.Checked && chkStartup.Checked);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles a basic change in setting.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void HasChangedSetting(object sender, EventArgs e)
|
||||
{
|
||||
HasChanged();
|
||||
|
@ -389,8 +395,6 @@ namespace xServer.Forms
|
|||
/// <summary>
|
||||
/// Handles a basic change in setting, also refreshing the example file path.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void HasChangedSettingAndFilePath(object sender, EventArgs e)
|
||||
{
|
||||
HasChanged();
|
||||
|
|
|
@ -100,6 +100,16 @@ namespace xServer.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap broom {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("broom", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
|
|
@ -148,12 +148,12 @@
|
|||
<data name="world_go" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\world_go.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="run" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\run.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="terminal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\terminal.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="keyboard_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\keyboard_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="upload" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\upload.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
@ -239,6 +239,9 @@
|
|||
<data name="eye" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\eye.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="application_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\application_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
@ -248,11 +251,8 @@
|
|||
<data name="logger" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\logger.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="application_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\application_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="registry" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\registry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="run" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\run.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="registry" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\registry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
|
@ -267,10 +267,7 @@
|
|||
<value>..\images\information.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="keyboard_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\keyboard_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="broom" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\images\broom.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
Binary file not shown.
After Width: | Height: | Size: 784 B |
Loading…
Reference in New Issue