Skip to content

Commit

Permalink
(GH-641) log file is optional
Browse files Browse the repository at this point in the history
Make adding logging to the installer arguments optional so that install
arguments can be built without it.
  • Loading branch information
ferventcoder committed Mar 11, 2016
1 parent c0c56c9 commit a347364
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override InstallerType InstallerType
get { return InstallerType.Custom; }
}

public override string build_install_command_arguments(bool customInstallLocation, bool languageRequested)
public override string build_install_command_arguments(bool logFile, bool customInstallLocation, bool languageRequested)
{
if (customInstallLocation) this.Log().Warn("CustomInstaller doesn't support custom install locations.");
if (languageRequested) this.Log().Warn("CustomInstaller doesn't support custom language options.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface IInstaller
IEnumerable<int> ValidInstallExitCodes { get; }
IEnumerable<int> ValidUninstallExitCodes { get; }

string build_install_command_arguments(bool customInstallLocation, bool languageRequested);
string build_install_command_arguments(bool logFile, bool customInstallLocation, bool languageRequested);
string build_uninstall_command_arguments();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ public abstract class InstallerBase : IInstaller
public IEnumerable<int> ValidInstallExitCodes { get; protected set; }
public IEnumerable<int> ValidUninstallExitCodes { get; protected set; }

public virtual string build_install_command_arguments(bool customInstallLocation, bool languageRequested)
public virtual string build_install_command_arguments(bool logFile, bool customInstallLocation, bool languageRequested)
{
var args = new StringBuilder();
args.AppendFormat("{0} {1}", SilentInstall, NoReboot);
//MSI may have issues with 1622 - opening a log file location
args.AppendFormat(" {0}", LogFile);
args.Append("{0} {1} {2}".format_with(SilentInstall, NoReboot, OtherInstallOptions).trim_safe());
if (languageRequested) args.AppendFormat(" {0}", Language);
args.AppendFormat(" {0}", OtherInstallOptions);

//MSI may have issues with 1622 - opening a log file location
if (logFile) args.AppendFormat(" {0}", LogFile);
// custom install location must be last for NSIS
if (customInstallLocation) args.AppendFormat(" {0}", CustomInstallLocation);

Expand All @@ -53,7 +51,7 @@ public virtual string build_install_command_arguments(bool customInstallLocation
public virtual string build_uninstall_command_arguments()
{
//MSI has issues with 1622 - opening a log file location
return "{0} {1} {2}".format_with(SilentUninstall, NoReboot, OtherUninstallOptions);
return "{0} {1} {2}".format_with(SilentUninstall, NoReboot, OtherUninstallOptions).trim_safe();
}
}
}

0 comments on commit a347364

Please sign in to comment.