mirror of https://github.com/quasar/Quasar.git
Fixed #345
This commit is contained in:
parent
8aa84a5ea3
commit
d2eda28f4b
|
@ -211,14 +211,11 @@ namespace xServer.Forms
|
|||
|
||||
private void btnBuild_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (lstHosts.Items.Count > 0 &&
|
||||
!string.IsNullOrEmpty(txtDelay.Text) && // Connection Information
|
||||
!string.IsNullOrEmpty(txtPassword.Text) && !string.IsNullOrEmpty(txtMutex.Text) && // Client Options
|
||||
!chkInstall.Checked ||
|
||||
(chkInstall.Checked && !string.IsNullOrEmpty(txtInstallname.Text) &&
|
||||
!string.IsNullOrEmpty(txtInstallsub.Text)) && // Installation Options
|
||||
!chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrEmpty(txtRegistryKeyName.Text)))
|
||||
// Persistence and Registry Features
|
||||
if (!string.IsNullOrEmpty(txtTag.Text) && !string.IsNullOrEmpty(txtMutex.Text) && // General Settings
|
||||
lstHosts.Items.Count > 0 && !string.IsNullOrEmpty(txtPassword.Text) && !string.IsNullOrEmpty(txtDelay.Text) && // Connection
|
||||
!chkInstall.Checked || (chkInstall.Checked && !string.IsNullOrEmpty(txtInstallname.Text) && // Installation
|
||||
!string.IsNullOrEmpty(txtInstallsub.Text)) && // Installation
|
||||
!chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrEmpty(txtRegistryKeyName.Text))) // Installation
|
||||
{
|
||||
string output = string.Empty;
|
||||
string icon = string.Empty;
|
||||
|
@ -227,6 +224,7 @@ namespace xServer.Forms
|
|||
{
|
||||
using (OpenFileDialog ofd = new OpenFileDialog())
|
||||
{
|
||||
ofd.Title = "Choose Icon";
|
||||
ofd.Filter = "Icons *.ico|*.ico";
|
||||
ofd.Multiselect = false;
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
|
@ -236,15 +234,26 @@ namespace xServer.Forms
|
|||
|
||||
using (SaveFileDialog sfd = new SaveFileDialog())
|
||||
{
|
||||
sfd.Filter = "EXE Files *.exe|*.exe";
|
||||
sfd.Title = "Save Client as";
|
||||
sfd.Filter = "Executables *.exe|*.exe";
|
||||
sfd.RestoreDirectory = true;
|
||||
sfd.FileName = "Client-built.exe";
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
if (sfd.ShowDialog() != DialogResult.OK) return;
|
||||
output = sfd.FileName;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(output) && (!chkIconChange.Checked || !string.IsNullOrEmpty(icon)))
|
||||
if (string.IsNullOrEmpty(output))
|
||||
{
|
||||
MessageBox.Show("Please choose a valid output path.", "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
if (chkIconChange.Checked && string.IsNullOrEmpty(icon))
|
||||
{
|
||||
MessageBox.Show("Please choose a valid icon path.", "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string[] asmInfo = null;
|
||||
|
@ -253,7 +262,7 @@ namespace xServer.Forms
|
|||
if (!FormatHelper.IsValidVersionNumber(txtProductVersion.Text) ||
|
||||
!FormatHelper.IsValidVersionNumber(txtFileVersion.Text))
|
||||
{
|
||||
MessageBox.Show("Please enter a valid version number!\nExample: 1.0.0.0", "Builder",
|
||||
MessageBox.Show("Please enter a valid version number!\nExample: 1.0.0.0", "Build failed",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
|
@ -274,24 +283,23 @@ namespace xServer.Forms
|
|||
chkHide.Checked, chkKeylogger.Checked, int.Parse(txtDelay.Text), GetInstallPath(), icon, asmInfo,
|
||||
Application.ProductVersion);
|
||||
|
||||
MessageBox.Show("Successfully built client!", "Success", MessageBoxButtons.OK,
|
||||
MessageBox.Show("Successfully built client!", "Build Success", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information);
|
||||
}
|
||||
catch (FileLoadException)
|
||||
{
|
||||
MessageBox.Show("Unable to load the Client Assembly Information.\nPlease re-build the Client.",
|
||||
"Error loading Client", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
"Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(
|
||||
string.Format("An error occurred!\n\nError Message: {0}\nStack Trace:\n{1}", ex.Message,
|
||||
ex.StackTrace), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
ex.StackTrace), "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
MessageBox.Show("Please fill out all required fields!", "Builder", MessageBoxButtons.OK,
|
||||
MessageBox.Show("Please fill out all required fields!", "Build failed", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue