diff --git a/src/chocolatey/infrastructure.app/domain/installers/CustomInstaller.cs b/src/chocolatey/infrastructure.app/domain/installers/CustomInstaller.cs index a11058639d..fb978f6efd 100644 --- a/src/chocolatey/infrastructure.app/domain/installers/CustomInstaller.cs +++ b/src/chocolatey/infrastructure.app/domain/installers/CustomInstaller.cs @@ -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."); diff --git a/src/chocolatey/infrastructure.app/domain/installers/IInstaller.cs b/src/chocolatey/infrastructure.app/domain/installers/IInstaller.cs index 74d62db74d..34b5a517c2 100644 --- a/src/chocolatey/infrastructure.app/domain/installers/IInstaller.cs +++ b/src/chocolatey/infrastructure.app/domain/installers/IInstaller.cs @@ -33,7 +33,7 @@ public interface IInstaller IEnumerable ValidInstallExitCodes { get; } IEnumerable 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(); } } \ No newline at end of file diff --git a/src/chocolatey/infrastructure.app/domain/installers/InstallerBase.cs b/src/chocolatey/infrastructure.app/domain/installers/InstallerBase.cs index fa5b454d31..fc471233ae 100644 --- a/src/chocolatey/infrastructure.app/domain/installers/InstallerBase.cs +++ b/src/chocolatey/infrastructure.app/domain/installers/InstallerBase.cs @@ -35,15 +35,13 @@ public abstract class InstallerBase : IInstaller public IEnumerable ValidInstallExitCodes { get; protected set; } public IEnumerable 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); @@ -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(); } } } \ No newline at end of file