From 1675a19d8b1c8ad6e3efb11a4202ff4dffe8557c Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 21 Mar 2019 20:10:14 -0500 Subject: [PATCH 1/5] (maint) formatting / order Set the order for items nulled out to match the order from the code below when those items are set. --- .../infrastructure.app/services/PowershellService.cs | 4 ++-- .../infrastructure/registration/SecurityProtocol.cs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index d21726a6f5..6904c0d661 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -384,12 +384,12 @@ public void prepare_powershell_environment(IPackage package, ChocolateyConfigura Environment.SetEnvironmentVariable("installArguments", null); Environment.SetEnvironmentVariable("installerArguments", null); Environment.SetEnvironmentVariable("chocolateyInstallArguments", null); + Environment.SetEnvironmentVariable("chocolateyInstallOverride", null); Environment.SetEnvironmentVariable("packageParameters", null); Environment.SetEnvironmentVariable("chocolateyPackageParameters", null); - Environment.SetEnvironmentVariable("chocolateyInstallOverride", null); Environment.SetEnvironmentVariable("chocolateyChecksum32", null); - Environment.SetEnvironmentVariable("chocolateyChecksumType32", null); Environment.SetEnvironmentVariable("chocolateyChecksum64", null); + Environment.SetEnvironmentVariable("chocolateyChecksumType32", null); Environment.SetEnvironmentVariable("chocolateyChecksumType64", null); // we only want to pass the following args to packages that would apply. diff --git a/src/chocolatey/infrastructure/registration/SecurityProtocol.cs b/src/chocolatey/infrastructure/registration/SecurityProtocol.cs index 60013d899c..e8d2d8b895 100644 --- a/src/chocolatey/infrastructure/registration/SecurityProtocol.cs +++ b/src/chocolatey/infrastructure/registration/SecurityProtocol.cs @@ -54,7 +54,6 @@ Chaining. Upgrade to at least .NET 4.5 at your earliest convenience. For more information you should visit https://www.howsmyssl.com/"); } - } try From 3e8984109e0c4ef805a91fbb5615e4bfe8bb4fb4 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 21 Mar 2019 20:11:18 -0500 Subject: [PATCH 2/5] (GH-1772) Fix: choco remembers Forcex86 Ensure that Force X86 is reset each time a package is called. --- src/chocolatey/infrastructure.app/services/PowershellService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 6904c0d661..9e1622634a 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -391,6 +391,7 @@ public void prepare_powershell_environment(IPackage package, ChocolateyConfigura Environment.SetEnvironmentVariable("chocolateyChecksum64", null); Environment.SetEnvironmentVariable("chocolateyChecksumType32", null); Environment.SetEnvironmentVariable("chocolateyChecksumType64", null); + Environment.SetEnvironmentVariable("chocolateyForceX86", null); // we only want to pass the following args to packages that would apply. // like choco install git --params '' should pass those params to git.install, From e8bd27e56f6b783ea57d1f16deaf21ccb68140a0 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 21 Mar 2019 20:12:07 -0500 Subject: [PATCH 3/5] (GH-1772) Null out env var for Download Cache Ensure that Download Cache Available environment variable is also nulled out. --- src/chocolatey/infrastructure.app/services/PowershellService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 9e1622634a..88fd11aeeb 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -392,6 +392,7 @@ public void prepare_powershell_environment(IPackage package, ChocolateyConfigura Environment.SetEnvironmentVariable("chocolateyChecksumType32", null); Environment.SetEnvironmentVariable("chocolateyChecksumType64", null); Environment.SetEnvironmentVariable("chocolateyForceX86", null); + Environment.SetEnvironmentVariable("DownloadCacheAvailable", null); // we only want to pass the following args to packages that would apply. // like choco install git --params '' should pass those params to git.install, From 1797a277f299ffd716a9f12e49044c8b4fc2ada6 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 21 Mar 2019 20:13:52 -0500 Subject: [PATCH 4/5] (version) 0.10.14-beta --- .uppercut | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.uppercut b/.uppercut index a795ff61b0..eb4ccf0dbb 100644 --- a/.uppercut +++ b/.uppercut @@ -17,10 +17,10 @@ - + - - + + From 3aaa1077a4f183e2c023f07606b709ca5ac6aaa2 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 1 Apr 2019 11:40:00 -0500 Subject: [PATCH 5/5] (GH-1784) Turn off enhanced exit codes by default Turning on enhanced exit codes by default turned out to be quite harmful for integrations. It should be an opt-in behavior and off by default. --- .../infrastructure.app/builders/ConfigurationBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs index d505ec14ab..2cd950b35b 100644 --- a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs +++ b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs @@ -292,7 +292,7 @@ private static void set_feature_flags(ChocolateyConfiguration config, ConfigFile config.Features.FailOnInvalidOrMissingLicense = set_feature_flag(ApplicationParameters.Features.FailOnInvalidOrMissingLicense, configFileSettings, defaultEnabled: false, description: "Fail On Invalid Or Missing License - allows knowing when a license is expired or not applied to a machine. Available in 0.9.10+."); config.Features.IgnoreInvalidOptionsSwitches = set_feature_flag(ApplicationParameters.Features.IgnoreInvalidOptionsSwitches, configFileSettings, defaultEnabled: true, description: "Ignore Invalid Options/Switches - If a switch or option is passed that is not recognized, should choco fail? Available in 0.9.10+."); config.Features.UsePackageExitCodes = set_feature_flag(ApplicationParameters.Features.UsePackageExitCodes, configFileSettings, defaultEnabled: true, description: "Use Package Exit Codes - Package scripts can provide exit codes. With this on, package exit codes will be what choco uses for exit when non-zero (this value can come from a dependency package). Chocolatey defines valid exit codes as 0, 1605, 1614, 1641, 3010. With this feature off, choco will exit with 0, 1, or -1 (matching previous behavior). Available in 0.9.10+."); - config.Features.UseEnhancedExitCodes = set_feature_flag(ApplicationParameters.Features.UseEnhancedExitCodes, configFileSettings, defaultEnabled: true, description: "Use Enhanced Exit Codes - Chocolatey is able to provide enhanced exit codes surrounding list, search, info, outdated and other commands that don't deal directly with package operations. To see enhanced exit codes and their meanings, please run `choco [cmdname] -?`. With this feature off, choco will exit with 0, 1, or -1 (matching previous behavior). Available in 0.10.12+."); + config.Features.UseEnhancedExitCodes = set_feature_flag(ApplicationParameters.Features.UseEnhancedExitCodes, configFileSettings, defaultEnabled: false, description: "Use Enhanced Exit Codes - Chocolatey is able to provide enhanced exit codes surrounding list, search, info, outdated and other commands that don't deal directly with package operations. To see enhanced exit codes and their meanings, please run `choco [cmdname] -?`. With this feature off, choco will exit with 0, 1, or -1 (matching previous behavior). Available in 0.10.12+."); config.Features.ExitOnRebootDetected = set_feature_flag(ApplicationParameters.Features.ExitOnRebootDetected, configFileSettings, defaultEnabled: false, description: "Exit On Reboot Detected - Stop running install, upgrade, or uninstall when a reboot request is detected. Requires '{0}' feature to be turned on. Will exit with either {1} or {2}. When it exits with {1}, it means pending reboot discovered prior to running operation. When it exits with {2}, it means some work completed prior to reboot request being detected. Available in 0.10.12+.".format_with(ApplicationParameters.Features.ExitOnRebootDetected, ApplicationParameters.ExitCodes.ErrorFailNoActionReboot, ApplicationParameters.ExitCodes.ErrorInstallSuspend)); config.Features.UseFipsCompliantChecksums = set_feature_flag(ApplicationParameters.Features.UseFipsCompliantChecksums, configFileSettings, defaultEnabled: false, description: "Use FIPS Compliant Checksums - Ensure checksumming done by choco uses FIPS compliant algorithms. Not recommended unless required by FIPS Mode. Enabling on an existing installation could have unintended consequences related to upgrades/uninstalls. Available in 0.9.10+."); config.Features.ShowNonElevatedWarnings = set_feature_flag(ApplicationParameters.Features.ShowNonElevatedWarnings, configFileSettings, defaultEnabled: true, description: "Show Non-Elevated Warnings - Display non-elevated warnings. Available in 0.10.4+.");