Fixed building Client with empty hosts list

This commit is contained in:
MaxXor 2015-08-28 23:44:26 +02:00
parent a714178604
commit 21fb90e559
1 changed files with 100 additions and 94 deletions

View File

@ -210,13 +210,23 @@ namespace xServer.Forms
}
#endregion
private bool CheckInput()
{
return (!string.IsNullOrEmpty(txtTag.Text) && !string.IsNullOrEmpty(txtMutex.Text) && // General Settings
_hosts.Count > 0 && !string.IsNullOrEmpty(txtPassword.Text) && !string.IsNullOrEmpty(txtDelay.Text) && // Connection
(!chkInstall.Checked || (chkInstall.Checked && !string.IsNullOrEmpty(txtInstallname.Text))) && // Installation
(!chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrEmpty(txtRegistryKeyName.Text)))); // Installation
}
private void btnBuild_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtTag.Text) && !string.IsNullOrEmpty(txtMutex.Text) && // General Settings
_hosts.Count > 0 && !string.IsNullOrEmpty(txtPassword.Text) && !string.IsNullOrEmpty(txtDelay.Text) && // Connection
!chkInstall.Checked || (chkInstall.Checked && !string.IsNullOrEmpty(txtInstallname.Text)) && // Installation
!chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrEmpty(txtRegistryKeyName.Text))) // Installation
if (!CheckInput())
{
MessageBox.Show("Please fill out all required fields!", "Build failed", MessageBoxButtons.OK,
MessageBoxIcon.Information);
return;
}
string output = string.Empty;
string icon = string.Empty;
string password = txtPassword.Text;
@ -306,10 +316,6 @@ namespace xServer.Forms
ex.StackTrace), "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
MessageBox.Show("Please fill out all required fields!", "Build failed", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
private void RefreshExamplePath()
{