diff --git a/recipe.cake b/recipe.cake index 08fef3ba1f..7e8deee37a 100644 --- a/recipe.cake +++ b/recipe.cake @@ -156,7 +156,7 @@ Task("Prepare-Chocolatey-Packages") // Run Chocolatey Unpackself CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco_merged/choco.exe", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe"); - StartProcess(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe", new ProcessSettings{ Arguments = "unpackself -f -y --allow-unofficial-build" }); + StartProcess(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe", new ProcessSettings{ Arguments = "unpackself -f -y --allow-unofficial-build --run-actual" }); // Tidy up logs and config folder which are not required var logsDirectory = BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/logs"; diff --git a/src/chocolatey.console/Program.cs b/src/chocolatey.console/Program.cs index 39b2bbcc91..1f89ff978b 100644 --- a/src/chocolatey.console/Program.cs +++ b/src/chocolatey.console/Program.cs @@ -191,7 +191,12 @@ private static void Main(string[] args) #if DEBUG "chocolatey".Log().Info(() => "Exiting with {0}".FormatWith(Environment.ExitCode)); #endif - PauseIfDebug(); + // Chocolatey Agent runs Chocolatey CLI with --run-actual. If that's the case we don't want to pause on debug. + if (!args.Any(a => a.IsEqualTo("--run-actual"))) + { + PauseIfDebug(); + } + Bootstrap.Shutdown(); Environment.Exit(Environment.ExitCode); }