Refactored ChangelogHelper
This commit is contained in:
@ -10,7 +10,7 @@ namespace KattekerCreator
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
private const string _executable = @"C:\Program Files (x86)\NSIS\makensis.exe";
|
||||
private const string Executable = @"C:\Program Files (x86)\NSIS\makensis.exe";
|
||||
private readonly string _baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
private ApplicationArguments _appArguments;
|
||||
private AssemblyFileInfo _assemblyFileInfo;
|
||||
@ -118,13 +118,13 @@ namespace KattekerCreator
|
||||
|
||||
private static string CompileSetupScript(string templateFile)
|
||||
{
|
||||
if (!File.Exists(_executable)) throw new FileNotFoundException("NSIS not installed properly.");
|
||||
if (!File.Exists(Executable)) throw new FileNotFoundException("NSIS not installed properly.");
|
||||
int exitcode;
|
||||
using (var p = new Process())
|
||||
{
|
||||
p.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = _executable,
|
||||
FileName = Executable,
|
||||
Arguments = $"\"{templateFile}\"",
|
||||
UseShellExecute = false
|
||||
};
|
||||
@ -132,10 +132,10 @@ namespace KattekerCreator
|
||||
p.Start();
|
||||
p.WaitForExit();
|
||||
exitcode = p.ExitCode;
|
||||
Log.WriteInfoLine($"{Path.GetFileName(_executable)} has exited with Exitcode: {exitcode} (Took: {sw.ElapsedMilliseconds}ms)");
|
||||
Log.WriteInfoLine($"{Path.GetFileName(Executable)} has exited with Exitcode: {exitcode} (Took: {sw.ElapsedMilliseconds}ms)");
|
||||
}
|
||||
|
||||
if (exitcode != 0) throw new Exception($"{Path.GetFileName(_executable)} has exited with Exitcode: {exitcode}");
|
||||
if (exitcode != 0) throw new Exception($"{Path.GetFileName(Executable)} has exited with Exitcode: {exitcode}");
|
||||
return Path.ChangeExtension(templateFile, "exe");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user