This commit is contained in:
MaxXor 2015-04-09 19:24:56 +02:00
parent 42803078be
commit bc12b91f15
2 changed files with 22 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Vestris.ResourceLib;
@ -12,7 +13,15 @@ namespace xServer.Core.Build
{
// PHASE 1 - Settings
string encKey = Helper.Helper.GetRandomName(20);
AssemblyDefinition asmDef = AssemblyDefinition.ReadAssembly("client.bin");
AssemblyDefinition asmDef;
try
{
asmDef = AssemblyDefinition.ReadAssembly("client.bin");
}
catch (Exception ex)
{
throw new FileLoadException(ex.Message);
}
foreach (var typeDef in asmDef.Modules[0].Types)
{

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using xServer.Core.Build;
@ -242,6 +243,7 @@ namespace xServer.Forms
MessageBox.Show("Please enter a valid version number!\nExample: 1.0.0.0", "Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
asmInfo = new string[8];
asmInfo[0] = txtProductName.Text;
asmInfo[1] = txtDescription.Text;
@ -252,9 +254,18 @@ namespace xServer.Forms
asmInfo[6] = txtProductVersion.Text;
asmInfo[7] = txtFileVersion.Text;
}
ClientBuilder.Build(output, txtHost.Text, txtPassword.Text, txtInstallsub.Text, txtInstallname.Text + ".exe", txtMutex.Text, txtRegistryKeyName.Text, chkInstall.Checked, chkStartup.Checked, chkHide.Checked, int.Parse(txtPort.Text), int.Parse(txtDelay.Text), GetInstallPath(), chkElevation.Checked, icon, asmInfo, Application.ProductVersion);
ClientBuilder.Build(output, txtHost.Text, txtPassword.Text, txtInstallsub.Text,
txtInstallname.Text + ".exe", txtMutex.Text, txtRegistryKeyName.Text, chkInstall.Checked,
chkStartup.Checked, chkHide.Checked, int.Parse(txtPort.Text), int.Parse(txtDelay.Text),
GetInstallPath(), chkElevation.Checked, icon, asmInfo, Application.ProductVersion);
MessageBox.Show("Successfully built client!", "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);
}
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);