Skip to content

Commit

Permalink
Merge branch 'pr1984' into stable
Browse files Browse the repository at this point in the history
* pr1984:
  (GH-1983) exit-on-reboot-detected environment variable
  • Loading branch information
ferventcoder committed May 16, 2020
2 parents fed2515 + 55fd097 commit 7298fd8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/chocolatey/infrastructure.app/ApplicationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public static class Environment
public static readonly string ChocolateyCheckLastExitCode = "ChocolateyCheckLastExitCode";
public static readonly string ChocolateyPowerShellHost = "ChocolateyPowerShellHost";
public static readonly string ChocolateyForce = "ChocolateyForce";
public static readonly string ChocolateyExitOnRebootDetected = "ChocolateyExitOnRebootDetected";
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static void reset_environment_variables(ChocolateyConfiguration config)
Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyAllowEmptyChecksumsSecure, null);
Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyPowerShellHost, null);
Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyForce, null);
Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyExitOnRebootDetected, null);

Environment.SetEnvironmentVariable("chocolateyProxyLocation", null);
Environment.SetEnvironmentVariable("chocolateyProxyBypassList", null);
Expand Down Expand Up @@ -127,6 +128,7 @@ public static void set_environment_variables(ChocolateyConfiguration config)

if (config.Features.UsePowerShellHost) Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyPowerShellHost, "true");
if (config.Force) Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyForce, "true");
if (config.Features.ExitOnRebootDetected) Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyExitOnRebootDetected, "true");
set_licensed_environment(config);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Chocolatey makes a number of environment variables available (You can access any
* ChocolateyEnvironmentDebug - Was `--debug` passed? If using the built-in PowerShell host, this is always true (but only logs debug messages to console if `--debug` was passed) (0.9.10+)
* ChocolateyEnvironmentVerbose - Was `--verbose` passed? If using the built-in PowerShell host, this is always true (but only logs verbose messages to console if `--verbose` was passed). (0.9.10+)
* ChocolateyExitOnRebootDetected - Are we exiting on a detected reboot? Set by ` --exit-when-reboot-detected` or the feature `exitOnRebootDetected` (0.10.16+)
* ChocolateyForce - Was `--force` passed? (0.9.10+)
* ChocolateyForceX86 - Was `-x86` passed? (CHECK)
* ChocolateyRequestTimeout - How long before a web request will time out. Set by config `webRequestTimeoutSeconds` (CHECK)
Expand Down

0 comments on commit 7298fd8

Please sign in to comment.