From cb6b92c3343848766b0908086cc11fd72e8797f2 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 18 Mar 2017 23:42:39 -0500 Subject: [PATCH 1/8] (GH-902) Fix: User changed to SYSTEM during env update Previously, running RefreshEnv / Update-SessionEnvironment would change current user to SYSTEM. This is due to Machine environment variables noting user as SYSTEM. To stop this, set the original username as a variable and reset the Username environment variable after the refresh. Do the same for Processor_Architecture. --- .../helpers/functions/Update-SessionEnvironment.ps1 | 6 ++++++ src/chocolatey.resources/redirects/RefreshEnv.cmd | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/chocolatey.resources/helpers/functions/Update-SessionEnvironment.ps1 b/src/chocolatey.resources/helpers/functions/Update-SessionEnvironment.ps1 index 9166cccd5b..f984ab6362 100644 --- a/src/chocolatey.resources/helpers/functions/Update-SessionEnvironment.ps1 +++ b/src/chocolatey.resources/helpers/functions/Update-SessionEnvironment.ps1 @@ -59,6 +59,8 @@ None Write-Verbose "Refreshing environment variables from the registry." } + $userName = $env:USERNAME + $architecture = $env:PROCESSOR_ARCHITECTURE $psModulePath = $env:PSModulePath #ordering is important here, $user comes after so we can override $machine @@ -82,6 +84,10 @@ None # PSModulePath is almost always updated by process, so we want to preserve it. $env:PSModulePath = $psModulePath + # reset user and architecture + if ($userName) { $env:USERNAME = $userName; } + if ($architecture) { $env:PROCESSOR_ARCHITECTURE = $architecture; } + if ($refreshEnv) { Write-Output "Finished" } diff --git a/src/chocolatey.resources/redirects/RefreshEnv.cmd b/src/chocolatey.resources/redirects/RefreshEnv.cmd index 9536d33a78..86234b538c 100644 --- a/src/chocolatey.resources/redirects/RefreshEnv.cmd +++ b/src/chocolatey.resources/redirects/RefreshEnv.cmd @@ -49,8 +49,16 @@ goto main del /f /q "%TEMP%\_envset.tmp" 2>nul del /f /q "%TEMP%\_envget.tmp" 2>nul + :: capture user / architecture + SET "OriginalUserName=%USERNAME%" + SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%" + :: Set these variables call "%TEMP%\_env.cmd" + :: reset user / architecture + SET "USERNAME=%OriginalUserName%" + SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%" + echo | set /p dummy="Finished." echo . From 279988deb38b06481df6d8bb9a8d3ca2bc693185 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 19 Mar 2017 10:33:18 -0500 Subject: [PATCH 2/8] (GH-1151) Option - Stop on first package failure Add option/feature to stop on first package failure. Although it is normally recommended to let the process continue when one package fails, sometimes it is best to stop further action from occurring. --- src/chocolatey/infrastructure.app/ApplicationParameters.cs | 1 + .../infrastructure.app/builders/ConfigurationBuilder.cs | 1 + .../commands/ChocolateyInstallCommand.cs | 4 ++++ .../commands/ChocolateyUninstallCommand.cs | 6 +++++- .../commands/ChocolateyUpgradeCommand.cs | 7 ++++++- .../configuration/ChocolateyConfiguration.cs | 2 ++ .../services/ChocolateyPackageService.cs | 5 +++++ src/chocolatey/infrastructure.app/services/NugetService.cs | 4 ++++ 8 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/chocolatey/infrastructure.app/ApplicationParameters.cs b/src/chocolatey/infrastructure.app/ApplicationParameters.cs index 87ed233422..d915aed012 100644 --- a/src/chocolatey/infrastructure.app/ApplicationParameters.cs +++ b/src/chocolatey/infrastructure.app/ApplicationParameters.cs @@ -160,6 +160,7 @@ public static class Features public static readonly string ScriptsCheckLastExitCode = "scriptsCheckLastExitCode"; public static readonly string ShowNonElevatedWarnings = "showNonElevatedWarnings"; public static readonly string ShowDownloadProgress = "showDownloadProgress"; + public static readonly string StopOnFirstPackageFailure = "stopOnFirstPackageFailure"; } public static class Messages diff --git a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs index a7d5bfbb36..7ec66f7f26 100644 --- a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs +++ b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs @@ -273,6 +273,7 @@ private static void set_feature_flags(ChocolateyConfiguration config, ConfigFile 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+."); config.Features.ShowDownloadProgress = set_feature_flag(ApplicationParameters.Features.ShowDownloadProgress, configFileSettings, defaultEnabled: true, description: "Show Download Progress - Show download progress percentages in the CLI. Available in 0.10.4+."); + config.Features.StopOnFirstPackageFailure = set_feature_flag(ApplicationParameters.Features.StopOnFirstPackageFailure, configFileSettings, defaultEnabled: false, description: "Stop On First Package Failure - stop running install, upgrade or uninstall on first package failure instead of continuing with others. As this will affect upgrade all, it is normally recommended to leave this off. Available in 0.10.4+."); config.Features.ScriptsCheckLastExitCode = set_feature_flag(ApplicationParameters.Features.ScriptsCheckLastExitCode, configFileSettings, defaultEnabled: false, description: "Scripts Check $LastExitCode (external commands) - Leave this off unless you absolutely need it while you fix your package scripts to use `throw 'error message'` or `Set-PowerShellExitCode #` instead of `exit #`. This behavior started in 0.9.10 and produced hard to find bugs. If the last external process exits successfully but with an exit code of not zero, this could cause hard to detect package failures. Available in 0.10.3+. Will be removed in 0.11.0."); config.PromptForConfirmation = !set_feature_flag(ApplicationParameters.Features.AllowGlobalConfirmation, configFileSettings, defaultEnabled: false, description: "Prompt for confirmation in scripts or bypass."); } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs index 597cd04ed1..24accdd906 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs @@ -149,6 +149,10 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon .Add("usepackagecodes|usepackageexitcodes|use-package-codes|use-package-exit-codes", "UsePackageExitCodes - Package scripts can provide exit codes. Use those for choco's exit code when non-zero (this value can come from a dependency package). Chocolatey defines valid exit codes as 0, 1605, 1614, 1641, 3010. Overrides the default feature '{0}' set to '{1}'. Available in 0.9.10+.".format_with(ApplicationParameters.Features.UsePackageExitCodes, configuration.Features.UsePackageExitCodes.to_string()), option => configuration.Features.UsePackageExitCodes = option != null + ) + .Add("stoponfirstfailure|stop-on-first-failure|stop-on-first-package-failure", + "Stop On First Package Failure - stop running install, upgrade or uninstall on first package failure instead of continuing with others. Overrides the default feature '{0}' set to '{1}'. Available in 0.10.4+.".format_with(ApplicationParameters.Features.StopOnFirstPackageFailure, configuration.Features.StopOnFirstPackageFailure.to_string()), + option => configuration.Features.StopOnFirstPackageFailure = option != null ) ; diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs index 57f6d16557..580d6ffcad 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs @@ -112,7 +112,11 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon { configuration.Features.FailOnAutoUninstaller = false; } - }) + }) + .Add("stoponfirstfailure|stop-on-first-failure|stop-on-first-package-failure", + "Stop On First Package Failure - stop running install, upgrade or uninstall on first package failure instead of continuing with others. Overrides the default feature '{0}' set to '{1}'. Available in 0.10.4+.".format_with(ApplicationParameters.Features.StopOnFirstPackageFailure, configuration.Features.StopOnFirstPackageFailure.to_string()), + option => configuration.Features.StopOnFirstPackageFailure = option != null + ) ; } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs index dad5245eaa..8abc5f06e1 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs @@ -156,7 +156,12 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon ) .Add("except=", "Except - a comma-separated list of package names that should not be upgraded when upgrading 'all'. Defaults to empty. Available in 0.9.10+.", - option => configuration.UpgradeCommand.PackageNamesToSkip = option.remove_surrounding_quotes()) + option => configuration.UpgradeCommand.PackageNamesToSkip = option.remove_surrounding_quotes() + ) + .Add("stoponfirstfailure|stop-on-first-failure|stop-on-first-package-failure", + "Stop On First Package Failure - stop running install, upgrade or uninstall on first package failure instead of continuing with others. Overrides the default feature '{0}' set to '{1}'. Available in 0.10.4+.".format_with(ApplicationParameters.Features.StopOnFirstPackageFailure, configuration.Features.StopOnFirstPackageFailure.to_string()), + option => configuration.Features.StopOnFirstPackageFailure = option != null + ) ; } diff --git a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs index 2ccbd5fe07..cf5d62e22e 100644 --- a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs +++ b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs @@ -356,6 +356,8 @@ public sealed class FeaturesConfiguration public bool UseFipsCompliantChecksums { get; set; } public bool ShowNonElevatedWarnings { get; set; } public bool ShowDownloadProgress { get; set; } + public bool StopOnFirstPackageFailure { get; set; } + //todo remove in 0.11.0 public bool ScriptsCheckLastExitCode { get; set; } } diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index 6eaaf66fec..de186394a2 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -421,6 +421,11 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu this.Log().Error(ChocolateyLoggers.Important, "The {0} of {1} was NOT successful.".format_with(commandName.to_string(), packageResult.Name)); handle_unsuccessful_operation(config, packageResult, movePackageToFailureLocation: true, attemptRollback: true); + if (config.Features.StopOnFirstPackageFailure) + { + throw new ApplicationException("Stopping further execution as {0} has failed {1}.".format_with(packageResult.Name, commandName.to_string())); + } + return; } diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index ec208679f5..48a60de2a0 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -1217,6 +1217,10 @@ public ConcurrentDictionary uninstall_run(ChocolateyConfi var result = packageUninstalls.GetOrAdd(packageVersion.Id.to_lower() + "." + packageVersion.Version.to_string(), new PackageResult(packageVersion, _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, packageVersion.Id))); result.Messages.Add(new ResultMessage(ResultType.Error, logMessage)); if (result.ExitCode == 0) result.ExitCode = 1; + if (config.Features.StopOnFirstPackageFailure) + { + throw new ApplicationException("Stopping further execution as {0} has failed uninstallation".format_with(packageVersion.Id.to_lower())); + } // do not call continueAction - will result in multiple passes } } From 3ce7e90c1332316b58bdc8a366e456562152e8cc Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 19 Mar 2017 12:19:12 -0500 Subject: [PATCH 3/8] (GH-686) Upgrade Prereleases When a prerelease is installed, it should automatically be upgraded to the newest absolute version (prerelease or stable) unless `--exclude-prerelease` is specified. This means when running `choco upgrade all`, all packages will be upgraded automatically in a way that makes sense. --- .../commands/ChocolateyUpgradeCommand.cs | 4 ++++ .../configuration/ChocolateyConfiguration.cs | 1 + .../infrastructure.app/services/NugetService.cs | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs index 8abc5f06e1..f945bc6503 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs @@ -162,6 +162,10 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon "Stop On First Package Failure - stop running install, upgrade or uninstall on first package failure instead of continuing with others. Overrides the default feature '{0}' set to '{1}'. Available in 0.10.4+.".format_with(ApplicationParameters.Features.StopOnFirstPackageFailure, configuration.Features.StopOnFirstPackageFailure.to_string()), option => configuration.Features.StopOnFirstPackageFailure = option != null ) + .Add("exclude-pre|exclude-prerelease|exclude-prereleases", + "Exclude Prerelease - Should prerelease be ignored for upgrades? Will be ignored if you pass `--pre`. Available in 0.10.4+.", + option => configuration.UpgradeCommand.ExcludePrerelease = option != null + ) ; } diff --git a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs index cf5d62e22e..b558854dd5 100644 --- a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs +++ b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs @@ -393,6 +393,7 @@ public sealed class UpgradeCommandConfiguration public bool FailOnNotInstalled { get; set; } public bool NotifyOnlyAvailableUpgrades { get; set; } public string PackageNamesToSkip { get; set; } + public bool ExcludePrerelease { get; set; } } [Serializable] diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 48a60de2a0..0afa51eec4 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -603,8 +603,17 @@ public ConcurrentDictionary upgrade_run(ChocolateyConfigu var pkgInfo = _packageInfoService.get_package_information(installedPackage); bool isPinned = pkgInfo != null && pkgInfo.IsPinned; + // if we have a prerelease installed, we want to have it upgrade based on newer prereleases + var originalPrerelease = config.Prerelease; + if (!string.IsNullOrWhiteSpace(installedPackage.Version.SpecialVersion) && !config.UpgradeCommand.ExcludePrerelease) + { + // this is a prerelease - opt in for newer prereleases. + config.Prerelease = true; + } IPackage availablePackage = packageManager.SourceRepository.FindPackage(packageName, version, config.Prerelease, allowUnlisted: false); + config.Prerelease = originalPrerelease; + if (availablePackage == null) { string logMessage = "{0} was not found with the source(s) listed.{1} If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.{1} Version: \"{2}\"; Source(s): \"{3}\"".format_with(packageName, Environment.NewLine, config.Version, config.Sources); From 25ab95f3d07e8c6819b0ed5a752647ba7b2e3005 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 19 Mar 2017 12:25:02 -0500 Subject: [PATCH 4/8] (GH-686) Upgrade Scenarios for Prereleases - upgrade existing package with prerelease available but without prerelease specified - Upgrading an existing package with prerelease available and prerelease specified - Upgrade installed prerelease without prerelease specified - Upgrade installed prerelease with prerelease available with `--exclude-prerelease` - Upgrade all with prereleases installed - Upgrade all with prereleases installed with `--exclude-prerelease` specified --- Scenarios.md | 80 ++- .../chocolatey.tests.integration.csproj | 54 ++ .../tools/chocolateyBeforeModify.ps1 | 1 + .../1.1.1-beta/tools/chocolateyinstall.ps1 | 1 + .../1.1.1-beta/tools/chocolateyuninstall.ps1 | 1 + .../1.1.1-beta/tools/console.exe | 1 + .../1.1.1-beta/tools/console.exe.config | 10 + .../tools/console.exe.config.install.xdt | 9 + .../1.1.1-beta/tools/graphical.exe | 1 + .../1.1.1-beta/tools/graphical.exe.gui | 1 + .../1.1.1-beta/upgradepackage.nuspec | 18 + .../tools/chocolateyBeforeModify.ps1 | 1 + .../1.1.1-beta2/tools/chocolateyinstall.ps1 | 1 + .../1.1.1-beta2/tools/chocolateyuninstall.ps1 | 1 + .../1.1.1-beta2/tools/console.exe | 1 + .../1.1.1-beta2/tools/console.exe.config | 10 + .../tools/console.exe.config.install.xdt | 9 + .../1.1.1-beta2/tools/graphical.exe | 1 + .../1.1.1-beta2/tools/graphical.exe.gui | 1 + .../1.1.1-beta2/upgradepackage.nuspec | 18 + .../scenarios/UpgradeScenarios.cs | 571 ++++++++++++++++++ 21 files changed, 790 insertions(+), 1 deletion(-) create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyBeforeModify.ps1 create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyinstall.ps1 create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyuninstall.ps1 create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config.install.xdt create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe.gui create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/upgradepackage.nuspec create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyBeforeModify.ps1 create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyinstall.ps1 create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyuninstall.ps1 create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config.install.xdt create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe.gui create mode 100644 src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/upgradepackage.nuspec diff --git a/Scenarios.md b/Scenarios.md index 2468913d4b..cb70cf863b 100644 --- a/Scenarios.md +++ b/Scenarios.md @@ -647,7 +647,7 @@ * should throw an error that it is not allowed -### ChocolateyUpgradeCommand [ 29 Scenario(s), 226 Observation(s) ] +### ChocolateyUpgradeCommand [ 35 Scenario(s), 286 Observation(s) ] #### when force upgrading a package @@ -938,6 +938,20 @@ * should report for all non skipped packages * should skip packages in except list +#### when upgrading all packages with prereleases installed + + * should report for all installed packages + * should skip packages without upgrades + * should upgrade packages with upgrades + * should upgrade upgradepackage + +#### when upgrading all packages with prereleases installed with excludeprerelease specified + + * should not upgrade upgradepackage + * should report for all installed packages + * should skip packages without upgrades + * should upgrade packages with upgrades + #### when upgrading an existing package happy path * config should match package result name @@ -958,6 +972,70 @@ * should upgrade the package * should upgrade where install location reports +#### when upgrading an existing package with prerelease available and prerelease specified + + * config should match package result name + * should contain a warning message that it upgraded successfully + * should contain a warning message with old and new versions + * should contain newer version in directory + * should delete the rollback + * should have a successful package result + * should have executed chocolateyBeforeModify before chocolateyInstall + * should have executed chocolateyBeforeModify script for original package + * should have executed chocolateyInstall script for new package + * should match the upgrade version of the new beta + * should not have executed chocolateyBeforeModify script for new package + * should not have executed chocolateyUninstall script for original package + * should not have inconclusive package result + * should not have warning package result + * should upgrade a package in the lib directory + * should upgrade the package + * should upgrade where install location reports + +#### when upgrading an existing package with prerelease available without prerelease specified + + * should be the same version of the package + * should contain a message that no packages were upgraded + * should contain a message that you have the latest version available + * should have a successful package result + * should have inconclusive package result + * should match the original package version + * should not create a rollback + * should not have warning package result + * should not remove the package from the lib directory + +#### when upgrading an existing prerelease package with prerelease available with excludeprelease and without prerelease specified + + * should be the same version of the package + * should contain a message that no packages were upgraded + * should contain a message that you have the latest version available + * should have a successful package result + * should have inconclusive package result + * should not create a rollback + * should not have warning package result + * should not remove the package from the lib directory + * should only find the last stable version + +#### when upgrading an existing prerelease package without prerelease specified + + * config should match package result name + * should contain a warning message that it upgraded successfully + * should contain a warning message with old and new versions + * should contain newer version in directory + * should delete the rollback + * should have a successful package result + * should have executed chocolateyBeforeModify before chocolateyInstall + * should have executed chocolateyBeforeModify script for original package + * should have executed chocolateyInstall script for new package + * should match the upgrade version of the new beta + * should not have executed chocolateyBeforeModify script for new package + * should not have executed chocolateyUninstall script for original package + * should not have inconclusive package result + * should not have warning package result + * should upgrade a package in the lib directory + * should upgrade the package + * should upgrade where install location reports + #### when upgrading packages with packages config * should throw an error that it is not allowed diff --git a/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj b/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj index dbdebd39f7..484552e747 100644 --- a/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj +++ b/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj @@ -373,6 +373,48 @@ Always + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + Designer @@ -422,6 +464,18 @@ Always + + Always + + + Always + + + Always + + + Always + Always diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyBeforeModify.ps1 b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyBeforeModify.ps1 new file mode 100644 index 0000000000..af5bb142e8 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyBeforeModify.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Before Modification" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyinstall.ps1 b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyuninstall.ps1 b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe new file mode 100644 index 0000000000..e2069184ee --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe @@ -0,0 +1 @@ +1.1.1-beta \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config new file mode 100644 index 0000000000..13dc6cb41b --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config.install.xdt b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config.install.xdt new file mode 100644 index 0000000000..21cc0d1d62 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/console.exe.config.install.xdt @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe new file mode 100644 index 0000000000..e2069184ee --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe @@ -0,0 +1 @@ +1.1.1-beta \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe.gui b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe.gui new file mode 100644 index 0000000000..1cc5f657e0 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/tools/graphical.exe.gui @@ -0,0 +1 @@ +1.1.0 \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/upgradepackage.nuspec b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/upgradepackage.nuspec new file mode 100644 index 0000000000..c135dc44f8 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta/upgradepackage.nuspec @@ -0,0 +1,18 @@ + + + + upgradepackage + 1.1.1-beta + upgradepackage + __REPLACE_AUTHORS_OF_SOFTWARE__ + __REPLACE_YOUR_NAME__ + false + __REPLACE__ + __REPLACE__ + + upgradepackage admin + + + + + \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyBeforeModify.ps1 b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyBeforeModify.ps1 new file mode 100644 index 0000000000..af5bb142e8 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyBeforeModify.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Before Modification" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyinstall.ps1 b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyuninstall.ps1 b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe new file mode 100644 index 0000000000..23c8c723e0 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe @@ -0,0 +1 @@ +1.1.1-beta2 \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config new file mode 100644 index 0000000000..13dc6cb41b --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config.install.xdt b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config.install.xdt new file mode 100644 index 0000000000..21cc0d1d62 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/console.exe.config.install.xdt @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe new file mode 100644 index 0000000000..23c8c723e0 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe @@ -0,0 +1 @@ +1.1.1-beta2 \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe.gui b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe.gui new file mode 100644 index 0000000000..1cc5f657e0 --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/tools/graphical.exe.gui @@ -0,0 +1 @@ +1.1.0 \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/upgradepackage.nuspec b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/upgradepackage.nuspec new file mode 100644 index 0000000000..c0ae60cbbf --- /dev/null +++ b/src/chocolatey.tests.integration/context/upgradepackage/1.1.1-beta2/upgradepackage.nuspec @@ -0,0 +1,18 @@ + + + + upgradepackage + 1.1.1-beta2 + upgradepackage + __REPLACE_AUTHORS_OF_SOFTWARE__ + __REPLACE_YOUR_NAME__ + false + __REPLACE__ + __REPLACE__ + + upgradepackage admin + + + + + \ No newline at end of file diff --git a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs index 9d5dbf2e71..fef17cf8ad 100644 --- a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs @@ -337,6 +337,478 @@ public void should_have_executed_chocolateyInstall_script_for_new_package() } } + [Concern(typeof (ChocolateyUpgradeCommand))] + public class when_upgrading_an_existing_package_with_prerelease_available_without_prerelease_specified : ScenariosBase + { + private PackageResult _packageResult; + + public override void Context() + { + base.Context(); + Scenario.install_package(Configuration, "upgradepackage", "1.1.0"); + } + + public override void Because() + { + Results = Service.upgrade_run(Configuration); + _packageResult = Results.FirstOrDefault().Value; + } + + [Fact] + public void should_contain_a_message_that_you_have_the_latest_version_available() + { + bool expectedMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Info).or_empty_list_if_null()) + { + if (message.Contains("upgradepackage v1.1.0 is the latest version available based on your source(s)")) expectedMessage = true; + } + + expectedMessage.ShouldBeTrue(); + } + + [Fact] + public void should_contain_a_message_that_no_packages_were_upgraded() + { + bool expectedMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("upgraded 0/1 ")) expectedMessage = true; + } + + expectedMessage.ShouldBeTrue(); + } + + [Fact] + public void should_not_create_a_rollback() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeFalse(); + } + + [Fact] + public void should_not_remove_the_package_from_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeTrue(); + } + + [Fact] + public void should_be_the_same_version_of_the_package() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + Constants.PackageExtension); + var package = new OptimizedZipPackage(packageFile); + package.Version.Version.to_string().ShouldEqual("1.1.0.0"); + } + + [Fact] + public void should_have_a_successful_package_result() + { + _packageResult.Success.ShouldBeTrue(); + } + + [Fact] + public void should_have_inconclusive_package_result() + { + _packageResult.Inconclusive.ShouldBeTrue(); + } + + [Fact] + public void should_not_have_warning_package_result() + { + _packageResult.Warning.ShouldBeFalse(); + } + + [Fact] + public void should_match_the_original_package_version() + { + _packageResult.Version.ShouldEqual("1.1.0"); + } + } + + [Concern(typeof (ChocolateyUpgradeCommand))] + public class when_upgrading_an_existing_package_with_prerelease_available_and_prerelease_specified : ScenariosBase + { + private PackageResult _packageResult; + + public override void Context() + { + base.Context(); + Configuration.Prerelease = true; + } + + public override void Because() + { + Results = Service.upgrade_run(Configuration); + _packageResult = Results.FirstOrDefault().Value; + } + + [Fact] + public void should_upgrade_where_install_location_reports() + { + Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + } + + [Fact] + public void should_upgrade_a_package_in_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeTrue(); + } + + [Fact] + public void should_delete_the_rollback() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeFalse(); + } + + [Fact] + public void should_contain_newer_version_in_directory() + { + var shimFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "console.exe"); + + File.ReadAllText(shimFile).ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_upgrade_the_package() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + Constants.PackageExtension); + var package = new OptimizedZipPackage(packageFile); + package.Version.Version.to_string().ShouldEqual("1.1.1.0"); + package.Version.to_string().ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_contain_a_warning_message_that_it_upgraded_successfully() + { + bool upgradedSuccessMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("upgraded 1/1")) upgradedSuccessMessage = true; + } + + upgradedSuccessMessage.ShouldBeTrue(); + } + + [Fact] + public void should_contain_a_warning_message_with_old_and_new_versions() + { + bool upgradeMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("You have upgradepackage v1.0.0 installed. Version 1.1.1-beta2 is available based on your source")) upgradeMessage = true; + } + + upgradeMessage.ShouldBeTrue(); + } + + [Fact] + public void should_have_a_successful_package_result() + { + _packageResult.Success.ShouldBeTrue(); + } + + [Fact] + public void should_not_have_inconclusive_package_result() + { + _packageResult.Inconclusive.ShouldBeFalse(); + } + + [Fact] + public void should_not_have_warning_package_result() + { + _packageResult.Warning.ShouldBeFalse(); + } + + [Fact] + public void config_should_match_package_result_name() + { + _packageResult.Name.ShouldEqual(Configuration.PackageNames); + } + + [Fact] + public void should_match_the_upgrade_version_of_the_new_beta() + { + _packageResult.Version.ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_have_executed_chocolateyBeforeModify_script_for_original_package() + { + MockLogger.contains_message("upgradepackage 1.0.0 Before Modification", LogLevel.Info).ShouldBeTrue(); + } + + [Fact] + public void should_have_executed_chocolateyBeforeModify_before_chocolateyInstall() + { + MockLogger.MessagesFor(LogLevel.Info).or_empty_list_if_null() + .SkipWhile(p => !p.Contains("upgradepackage 1.0.0 Before Modification")) + .Any(p => p.EndsWith("upgradepackage 1.1.1-beta2 Installed")) + .ShouldBeTrue(); + } + + [Fact] + public void should_not_have_executed_chocolateyUninstall_script_for_original_package() + { + MockLogger.contains_message("upgradepackage 1.0.0 Uninstalled", LogLevel.Info).ShouldBeFalse(); + } + + [Fact] + public void should_not_have_executed_chocolateyBeforeModify_script_for_new_package() + { + MockLogger.contains_message("upgradepackage 1.1.1-beta2 Before Modification", LogLevel.Info).ShouldBeFalse(); + } + + [Fact] + public void should_have_executed_chocolateyInstall_script_for_new_package() + { + MockLogger.contains_message("upgradepackage 1.1.1-beta2 Installed", LogLevel.Info).ShouldBeTrue(); + } + } + + [Concern(typeof (ChocolateyUpgradeCommand))] + public class when_upgrading_an_existing_prerelease_package_without_prerelease_specified : ScenariosBase + { + private PackageResult _packageResult; + + public override void Context() + { + base.Context(); + Configuration.Prerelease = true; + Scenario.install_package(Configuration, "upgradepackage", "1.1.1-beta"); + Configuration.Prerelease = false; + } + + public override void Because() + { + Results = Service.upgrade_run(Configuration); + _packageResult = Results.FirstOrDefault().Value; + } + + [Fact] + public void should_upgrade_where_install_location_reports() + { + Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + } + + [Fact] + public void should_upgrade_a_package_in_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeTrue(); + } + + [Fact] + public void should_delete_the_rollback() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeFalse(); + } + + [Fact] + public void should_contain_newer_version_in_directory() + { + var shimFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "console.exe"); + + File.ReadAllText(shimFile).ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_upgrade_the_package() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + Constants.PackageExtension); + var package = new OptimizedZipPackage(packageFile); + package.Version.Version.to_string().ShouldEqual("1.1.1.0"); + package.Version.to_string().ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_contain_a_warning_message_that_it_upgraded_successfully() + { + bool upgradedSuccessMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("upgraded 1/1")) upgradedSuccessMessage = true; + } + + upgradedSuccessMessage.ShouldBeTrue(); + } + + [Fact] + public void should_contain_a_warning_message_with_old_and_new_versions() + { + bool upgradeMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("You have upgradepackage v1.1.1-beta installed. Version 1.1.1-beta2 is available based on your source")) upgradeMessage = true; + } + + upgradeMessage.ShouldBeTrue(); + } + + [Fact] + public void should_have_a_successful_package_result() + { + _packageResult.Success.ShouldBeTrue(); + } + + [Fact] + public void should_not_have_inconclusive_package_result() + { + _packageResult.Inconclusive.ShouldBeFalse(); + } + + [Fact] + public void should_not_have_warning_package_result() + { + _packageResult.Warning.ShouldBeFalse(); + } + + [Fact] + public void config_should_match_package_result_name() + { + _packageResult.Name.ShouldEqual(Configuration.PackageNames); + } + + [Fact] + public void should_match_the_upgrade_version_of_the_new_beta() + { + _packageResult.Version.ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_have_executed_chocolateyBeforeModify_script_for_original_package() + { + MockLogger.contains_message("upgradepackage 1.1.1-beta Before Modification", LogLevel.Info).ShouldBeTrue(); + } + + [Fact] + public void should_have_executed_chocolateyBeforeModify_before_chocolateyInstall() + { + MockLogger.MessagesFor(LogLevel.Info).or_empty_list_if_null() + .SkipWhile(p => !p.Contains("upgradepackage 1.1.1-beta Before Modification")) + .Any(p => p.EndsWith("upgradepackage 1.1.1-beta2 Installed")) + .ShouldBeTrue(); + } + + [Fact] + public void should_not_have_executed_chocolateyUninstall_script_for_original_package() + { + MockLogger.contains_message("upgradepackage 1.1.1-beta Uninstalled", LogLevel.Info).ShouldBeFalse(); + } + + [Fact] + public void should_not_have_executed_chocolateyBeforeModify_script_for_new_package() + { + MockLogger.contains_message("upgradepackage 1.1.1-beta2 Before Modification", LogLevel.Info).ShouldBeFalse(); + } + + [Fact] + public void should_have_executed_chocolateyInstall_script_for_new_package() + { + MockLogger.contains_message("upgradepackage 1.1.1-beta2 Installed", LogLevel.Info).ShouldBeTrue(); + } + } + + [Concern(typeof(ChocolateyUpgradeCommand))] + public class when_upgrading_an_existing_prerelease_package_with_prerelease_available_with_excludeprelease_and_without_prerelease_specified : ScenariosBase + { + private PackageResult _packageResult; + + public override void Context() + { + base.Context(); + Configuration.Prerelease = true; + Scenario.install_package(Configuration, "upgradepackage", "1.1.1-beta"); + Configuration.Prerelease = false; + Configuration.UpgradeCommand.ExcludePrerelease = true; + } + public override void Because() + { + Results = Service.upgrade_run(Configuration); + _packageResult = Results.FirstOrDefault().Value; + } + + [Fact] + public void should_contain_a_message_that_you_have_the_latest_version_available() + { + bool expectedMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Info).or_empty_list_if_null()) + { + if (message.Contains("upgradepackage v1.1.1-beta is newer")) expectedMessage = true; + } + + expectedMessage.ShouldBeTrue(); + } + + [Fact] + public void should_contain_a_message_that_no_packages_were_upgraded() + { + bool expectedMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("upgraded 0/1 ")) expectedMessage = true; + } + + expectedMessage.ShouldBeTrue(); + } + + [Fact] + public void should_not_create_a_rollback() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeFalse(); + } + + [Fact] + public void should_not_remove_the_package_from_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); + + Directory.Exists(packageDir).ShouldBeTrue(); + } + + [Fact] + public void should_be_the_same_version_of_the_package() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + Constants.PackageExtension); + var package = new OptimizedZipPackage(packageFile); + package.Version.Version.to_string().ShouldEqual("1.1.1.0"); + } + + [Fact] + public void should_have_a_successful_package_result() + { + _packageResult.Success.ShouldBeTrue(); + } + + [Fact] + public void should_have_inconclusive_package_result() + { + _packageResult.Inconclusive.ShouldBeTrue(); + } + + [Fact] + public void should_not_have_warning_package_result() + { + _packageResult.Warning.ShouldBeFalse(); + } + + [Fact] + public void should_only_find_the_last_stable_version() + { + _packageResult.Version.ShouldEqual("1.1.0"); + } + } + [Concern(typeof (ChocolateyUpgradeCommand))] public class when_force_upgrading_a_package : ScenariosBase { @@ -2480,6 +2952,105 @@ public void should_upgrade_packages_with_upgrades() upgradePackageResult.First().Value.Version.ShouldEqual("1.1.0"); } + [Fact] + public void should_skip_packages_without_upgrades() + { + var installPackageResult = Results.Where(x => x.Key == "installpackage").ToList(); + installPackageResult.Count.ShouldEqual(1, "installpackage must be there once"); + installPackageResult.First().Value.Version.ShouldEqual("1.0.0"); + } + } + + [Concern(typeof(ChocolateyUpgradeCommand))] + public class when_upgrading_all_packages_with_prereleases_installed : ScenariosBase + { + public override void Context() + { + base.Context(); + Configuration.Prerelease = true; + Scenario.install_package(Configuration, "upgradepackage", "1.1.1-beta"); + Configuration.Prerelease = false; + Configuration.PackageNames = Configuration.Input = "all"; + } + + public override void Because() + { + Results = Service.upgrade_run(Configuration); + } + + [Fact] + public void should_report_for_all_installed_packages() + { + Results.Count().ShouldEqual(3); + } + + [Fact] + public void should_upgrade_packages_with_upgrades() + { + var upgradePackageResult = Results.Where(x => x.Key == "upgradepackage").ToList(); + upgradePackageResult.Count.ShouldEqual(1, "upgradepackage must be there once"); + upgradePackageResult.First().Value.Version.ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_upgrade_upgradepackage() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", "upgradepackage", "upgradepackage" + Constants.PackageExtension); + var package = new OptimizedZipPackage(packageFile); + package.Version.to_string().ShouldEqual("1.1.1-beta2"); + } + + [Fact] + public void should_skip_packages_without_upgrades() + { + var installPackageResult = Results.Where(x => x.Key == "installpackage").ToList(); + installPackageResult.Count.ShouldEqual(1, "installpackage must be there once"); + installPackageResult.First().Value.Version.ShouldEqual("1.0.0"); + } + } + + [Concern(typeof(ChocolateyUpgradeCommand))] + public class when_upgrading_all_packages_with_prereleases_installed_with_excludeprerelease_specified : ScenariosBase + { + public override void Context() + { + base.Context(); + Configuration.Prerelease = true; + Scenario.install_package(Configuration, "upgradepackage", "1.1.1-beta"); + Configuration.Prerelease = false; + + Configuration.PackageNames = Configuration.Input = "all"; + Configuration.UpgradeCommand.ExcludePrerelease = true; + } + + public override void Because() + { + Results = Service.upgrade_run(Configuration); + } + + [Fact] + public void should_report_for_all_installed_packages() + { + Results.Count().ShouldEqual(3); + } + + [Fact] + public void should_upgrade_packages_with_upgrades() + { + var upgradePackageResult = Results.Where(x => x.Key == "upgradepackage").ToList(); + upgradePackageResult.Count.ShouldEqual(1, "upgradepackage must be there once"); + // available version will show as last stable + upgradePackageResult.First().Value.Version.ShouldEqual("1.1.0"); + } + + [Fact] + public void should_not_upgrade_upgradepackage() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", "upgradepackage", "upgradepackage" + Constants.PackageExtension); + var package = new OptimizedZipPackage(packageFile); + package.Version.to_string().ShouldEqual("1.1.1-beta"); + } + [Fact] public void should_skip_packages_without_upgrades() { From 8d810b10f045b1169f5b6ff52299befa0091b741 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 19 Mar 2017 12:57:02 -0500 Subject: [PATCH 5/8] (GH-1039) Remove quotes before testing path This will remove unnecessary warnings when checking for the existence of an executable that will be run. --- .../helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 b/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 index a01c408b88..a1ca50999b 100644 --- a/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 +++ b/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 @@ -140,6 +140,10 @@ param( Write-Debug "Removing null characters resulted in an error - $($_.Exception.Message)" } + if ($exeToRun -ne $null) { + $exeToRun = $exeToRun.Trim().Trim("'").Trim('"') + } + $wrappedStatements = $statements if ($wrappedStatements -eq $null) { $wrappedStatements = ''} @@ -236,10 +240,6 @@ $dbMessagePrepend [`"$exeToRun`" $wrappedStatements]. This may take a while, dep # in case empty args makes a difference, try to be compatible with the older # version $psi = New-Object System.Diagnostics.ProcessStartInfo - - if ($exeToRun -ne $null) { - $exeToRun = $exeToRun.Trim().Trim("'").Trim('"') - } $psi.FileName = $exeToRun if ($wrappedStatements -ne '') { From 9d935ec07300f2dc294ba77a34a7fa62d8cd708c Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 19 Mar 2017 13:01:25 -0500 Subject: [PATCH 6/8] (GH-1187) Get-ChocolateyUnzip - support both archs Allow passing both 32-bit and 64-bit archives to Get-ChocolateyUnzip. One of the two needs to be there for the function not to error. If only 64bit is passed, it will fail a package on a 32 bit system. --- .../helpers/functions/Get-ChocolateyUnzip.ps1 | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 b/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 index 37231d0a3e..2c56691536 100644 --- a/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 @@ -49,6 +49,18 @@ next to the install script, the path will be like In 0.10.1+, `File` is an alias for FileFullPath. +This can be a 32-bit or 64-bit file. This is mandatory in earlier versions +of Chocolatey, but optional if FileFullPath64 has been provided. + +.PARAMETER FileFullPath64 +Full file path to a 64-bit native installer to run. Available in 0.10.4+. +If embedding in the package, you can get it to the path with +`"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"` + +Provide this when you want to provide both 32-bit and 64-bit +installers or explicitly only a 64-bit installer (which will cause a package +install failure on 32-bit systems). + .PARAMETER Destination This is a directory where you would like the unzipped files to end up. If it does not exist, it will be created. @@ -73,16 +85,30 @@ Get-ChocolateyUnzip -FileFullPath "c:\someFile.zip" -Destination $toolsDir Install-ChocolateyZipPackage #> param( - [alias("file")][parameter(Mandatory=$true, Position=0)][string] $fileFullPath, + [alias("file")][parameter(Mandatory=$false, Position=0)][string] $fileFullPath, [parameter(Mandatory=$true, Position=1)][string] $destination, [parameter(Mandatory=$false, Position=2)][string] $specificFolder, [parameter(Mandatory=$false, Position=3)][string] $packageName, + [alias("file64")][parameter(Mandatory=$false)][string] $fileFullPath64, [parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments ) - $zipfileFullPath=$fileFullPath Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters + $bitnessMessage = '' + $zipfileFullPath=$fileFullPath + if ((Get-ProcessorBits 32) -or $env:ChocolateyForceX86 -eq 'true') { + if (!$fileFullPath) { throw "32-bit archive is not supported for $packageName"; } + if ($fileFullPath64) { $bitnessMessage = '32-bit '; } + } elseif ($fileFullPath64) { + $zipfileFullPath = $fileFullPath64 + $bitnessMessage = '64-bit ' + } + + if ($zipfileFullPath -eq '' -or $zipfileFullPath -eq $null) { + throw 'Package parameters incorrect, either FileFullPath or FileFullPath64 must be specified.' + } + if ($packageName) { $packagelibPath = $env:ChocolateyPackageFolder if (!(Test-Path -path $packagelibPath)) { @@ -97,7 +123,7 @@ param( Write-Warning "Install Directory override not available for zip packages at this time.`n If this package also runs a native installer using Chocolatey`n functions, the directory will be honored." } - Write-Host "Extracting $fileFullPath to $destination..." + Write-Host "Extracting $bitnessMessage$zipfileFullPath to $destination..." if (![System.IO.Directory]::Exists($destination)) { [System.IO.Directory]::CreateDirectory($destination) | Out-Null } $7zip = Join-Path "$helpersPath" '..\tools\7z.exe' @@ -113,10 +139,10 @@ param( # Replace System32 with sysnative, which does not get redirected. # 32-bit 7z is required so it can see both architectures if ([IntPtr]::Size -ne 4) { - $fileFullPathNoRedirection = $fileFullPath -ireplace ([regex]::Escape([Environment]::GetFolderPath('System'))),(Join-Path $Env:SystemRoot 'SysNative') + $fileFullPathNoRedirection = $zipfileFullPath -ireplace ([regex]::Escape([Environment]::GetFolderPath('System'))),(Join-Path $Env:SystemRoot 'SysNative') $destinationNoRedirection = $destination -ireplace ([regex]::Escape([Environment]::GetFolderPath('System'))),(Join-Path $Env:SystemRoot 'SysNative') } else { - $fileFullPathNoRedirection = $fileFullPath + $fileFullPathNoRedirection = $zipfileFullPath $destinationNoRedirection = $destination } From 56389e7943b452e0005f351ffd473a39c1b86185 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 19 Mar 2017 13:04:42 -0500 Subject: [PATCH 7/8] (docs) update generated docs --- docs/generated/CommandsApiKey.md | 42 ++++++++- docs/generated/CommandsConfig.md | 42 ++++++++- docs/generated/CommandsDownload.md | 86 +++++++++++++++---- docs/generated/CommandsFeature.md | 42 ++++++++- docs/generated/CommandsFeatures.md | 42 ++++++++- docs/generated/CommandsInfo.md | 42 ++++++++- docs/generated/CommandsInstall.md | 48 ++++++++++- docs/generated/CommandsList.md | 42 ++++++++- docs/generated/CommandsNew.md | 86 ++++++++++++++++--- docs/generated/CommandsOutdated.md | 42 ++++++++- docs/generated/CommandsPack.md | 44 +++++++++- docs/generated/CommandsPin.md | 42 ++++++++- docs/generated/CommandsPush.md | 42 ++++++++- docs/generated/CommandsReference.md | 47 +++++++++- docs/generated/CommandsSearch.md | 42 ++++++++- docs/generated/CommandsSetapiKey.md | 42 ++++++++- docs/generated/CommandsSource.md | 51 ++++++++++- docs/generated/CommandsSources.md | 51 ++++++++++- docs/generated/CommandsSupport.md | 42 ++++++++- docs/generated/CommandsUninstall.md | 54 +++++++++++- docs/generated/CommandsUnpackself.md | 42 ++++++++- docs/generated/CommandsUpdate.md | 42 ++++++++- docs/generated/CommandsUpgrade.md | 52 ++++++++++- docs/generated/CommandsVersion.md | 42 ++++++++- docs/generated/HelpersGetChocolateyUnzip.md | 27 +++++- .../HelpersGetUninstallRegistryKey.md | 47 +++++++--- .../HelpersInstallChocolateyInstallPackage.md | 27 +++++- ...lpersInstallChocolateyPowershellCommand.md | 42 ++++----- .../HelpersInstallChocolateyVsixPackage.md | 19 ++-- .../HelpersStartChocolateyProcessAsAdmin.md | 11 +++ 30 files changed, 1203 insertions(+), 119 deletions(-) diff --git a/docs/generated/CommandsApiKey.md b/docs/generated/CommandsApiKey.md index ed13b185a7..8785877c84 100644 --- a/docs/generated/CommandsApiKey.md +++ b/docs/generated/CommandsApiKey.md @@ -48,7 +48,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -71,7 +77,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -91,6 +97,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source [REQUIRED] - The source location for the key diff --git a/docs/generated/CommandsConfig.md b/docs/generated/CommandsConfig.md index d1b078152d..ec3d034f04 100644 --- a/docs/generated/CommandsConfig.md +++ b/docs/generated/CommandsConfig.md @@ -48,7 +48,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -71,7 +77,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -91,6 +97,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + --name=VALUE Name - the name of the config setting. Required with some actions. Defaults to empty. diff --git a/docs/generated/CommandsDownload.md b/docs/generated/CommandsDownload.md index 259336d035..cbad0f8bcc 100644 --- a/docs/generated/CommandsDownload.md +++ b/docs/generated/CommandsDownload.md @@ -2,21 +2,23 @@ # Download Command (choco download) -Package Internalizer +### Package Copy / Package Downloader + +[Chocolatey Professional](https://chocolatey.org/compare) and up starting in version 1.7.1. + +Downloads a package from a source and unpacks it. + +### Package Internalizer [Chocolatey for Business](https://chocolatey.org/compare) starting at licensed version 1.5.0. -Downloads a package from a source, optionally downloading remote - resources and recompiling the package to use internal resources. This - takes an existing package and makes it available without any internet +Downloads a package from a source, optionally downloading remote + resources and recompiling the package to use internal resources. This + takes an existing package and makes it available without any internet requirement. See https://chocolatey.org/docs/features-automatically-recompile-packages -Package Copy / Package Downloader -[Chocolatey Professional](https://chocolatey.org/compare) and up starting in version 1.7.1. - -Downloads a package from a source and unpacks it. ## Usage @@ -58,7 +60,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -81,7 +89,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -101,6 +109,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source to find the package(s) to download. Defaults to default feeds. @@ -125,23 +165,39 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Certificate Password - the client certificate's password to the source. Defaults to empty. - --outputdirectory=VALUE + --out, --outdir, --outputdirectory, --output-directory=VALUE OutputDirectory - Specifies the directory for the downloaded Chocolatey package file. If not specified, uses the current directory. + -i, --ignoredependencies, --ignore-dependencies + IgnoreDependencies - Ignore dependencies when installing package(s). + [Licensed editions](https://chocolatey.org/compare) v1.9.0+ Defaults to false. + --recompile, --internalize Recompile / Internalize - Download all external resources and recompile - the package to use the local resources instead. + the package to use the local resources instead. Business editions only + (licensed version 1.5.0+). --resources-location=VALUE - Resources Location - When recompiling, use this location for resources - instead of embedding the downloaded resources into the package. + Resources Location - When internalizing, use this location for resources + instead of embedding the downloaded resources into the package. Can be a + file share or an internal url location. When it is a file share, it will + attempt to download to that location. When it is an internal url, it + will download locally and give further instructions on where it should + be uploaded to match package edits. Business editions only (licensed + version 1.5.1+). + + --download-location=VALUE + Download Location - OPTIONAL - when internalizing, download the + resources to this location. Used with Resources Location (and defaults + to Resources Location when not set). Business editions only (licensed + version 1.8.3+). --append-useoriginallocation, --append-use-original-location Append -UseOriginalLocation - When `Install-ChocolateyPackage` is internalized, append the `-UseOriginalLocation` parameter to the function. Business editions only (licensed version 1.7.0+). Requires at - least Chocolatey v0.10.1 for `Install-ChocolateyPacakge` to recognize + least Chocolatey v0.10.1 for `Install-ChocolateyPackage` to recognize the switch appropriately. Overrides the feature 'internalizeAppendUseOriginalLocation' set to by default to 'False'. diff --git a/docs/generated/CommandsFeature.md b/docs/generated/CommandsFeature.md index ff7ada61e4..54dd8d0b00 100644 --- a/docs/generated/CommandsFeature.md +++ b/docs/generated/CommandsFeature.md @@ -34,7 +34,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -57,7 +63,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -77,6 +83,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -n, --name=VALUE Name - the name of the source. Required with some actions. Defaults to empty. diff --git a/docs/generated/CommandsFeatures.md b/docs/generated/CommandsFeatures.md index a88904fbe4..50add18a4a 100644 --- a/docs/generated/CommandsFeatures.md +++ b/docs/generated/CommandsFeatures.md @@ -34,7 +34,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -57,7 +63,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -77,6 +83,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -n, --name=VALUE Name - the name of the source. Required with some actions. Defaults to empty. diff --git a/docs/generated/CommandsInfo.md b/docs/generated/CommandsInfo.md index 7f5d67ec9c..97bbe4ea24 100644 --- a/docs/generated/CommandsInfo.md +++ b/docs/generated/CommandsInfo.md @@ -27,7 +27,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -50,7 +56,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -70,6 +76,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - Source location for install. Can include special 'webpi'. Defaults to sources. diff --git a/docs/generated/CommandsInstall.md b/docs/generated/CommandsInstall.md index 7e014d1813..6ee9566c4f 100644 --- a/docs/generated/CommandsInstall.md +++ b/docs/generated/CommandsInstall.md @@ -165,7 +165,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -188,7 +194,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -208,6 +214,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to @@ -339,6 +377,12 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch 1614, 1641, 3010. Overrides the default feature 'usePackageExitCodes' set to 'True'. Available in 0.9.10+. + --stoponfirstfailure, --stop-on-first-failure, --stop-on-first-package-failure + Stop On First Package Failure - stop running install, upgrade or + uninstall on first package failure instead of continuing with others. + Overrides the default feature 'stopOnFirstPackageFailure' set to 'False- + '. Available in 0.10.4+. + --sdc, --skipdownloadcache, --skip-download-cache Skip Download Cache - Use the original download even if a private CDN cache is available for a package. Overrides the default feature diff --git a/docs/generated/CommandsList.md b/docs/generated/CommandsList.md index 2bf3149377..6bb869e890 100644 --- a/docs/generated/CommandsList.md +++ b/docs/generated/CommandsList.md @@ -67,7 +67,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -90,7 +96,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -110,6 +116,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - Source location for install. Can include special 'webpi'. Defaults to sources. diff --git a/docs/generated/CommandsNew.md b/docs/generated/CommandsNew.md index f7ae2cfc2d..94408a3ab1 100644 --- a/docs/generated/CommandsNew.md +++ b/docs/generated/CommandsNew.md @@ -1,5 +1,22 @@  +# Package Builder Command (choco new) + +Chocolatey [Licensed editions](https://chocolatey.org/compare) include some level of Package Builder. + + - Professional (licensed edition v1.9.0+) can take advantage of + Package Builder UI minus the auto-detection + - Business (licensed edition v1.4.0+) can use `--file` or Package + Builder UI to generate a fully ready to go unattended software + deployment in seconds. So easy a 7 year old can do it. Right Click + 'Create Package...' + - Business (licensed edition v1.8.0+) can use + `--from-programs-and-features` to generate packages directly from + Programs and Features! + +See https://chocolatey.org/docs/features-create-packages-from-installers + + # New Command (choco new) Chocolatey will generate package specification files for a new package. @@ -56,7 +73,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -79,7 +102,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -99,6 +122,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -a, --auto, --automaticpackage AutomaticPackage - Generate automatic package instead of normal. Defaults to false @@ -120,7 +175,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Maintainer - the name of the maintainer. Can also be passed as the property MaintainerName=somevalue - --outputdirectory=VALUE + --out, --outdir, --outputdirectory, --output-directory=VALUE OutputDirectory - Specifies the directory for the created Chocolatey package file. If not specified, uses the current directory. Available in 0.9.10+. @@ -130,29 +185,30 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch override. Available in 0.9.10+. --file, --url=VALUE - Inspect a file (native installer, zip, patch/upgrade file, or remote url - to download first) to to completely create a package with proper silent - arguments! Can be 32-bit or 64-bit architecture. Available in Business + Location of binary. In [Chocolatey for Business](https://chocolatey.org/compare), file is used for auto- + detection (native installer, zip, patch/upgrade file, or remote url to + download first) to completely create a package with proper silent + arguments! Can be 32-bit or 64-bit architecture. Available in licensed editions only (licensed version 1.4.0+, url/zip starting in 1.6.0). See https://chocolatey.org/docs/features-create-packages-from-installers --file64, --url64=VALUE Optional - used when specifying both a 32-bit and a 64-bit file. Can be - an installer or a zip, or remote url to download. Available in Business + an installer or a zip, or remote url to download. Available in licensed editions only (licensed version 1.6.0+). --keepremote, --keep-remote, --originallocation, --original-location, --useoriginallocation, --use-original-location, --useoriginalfileslocation, --use-original-files-location Use Original Files Location - when using file or url, use the original - location in packaging. Available in Business editions only (licensed + location in packaging. Available in [licensed editions](https://chocolatey.org/compare) only (licensed version 1.6.0+). --checksum, --downloadchecksum, --download-checksum=VALUE Download Checksum - checksum to verify File/Url with. Defaults to empty. - Available in Business editions only (licensed version 1.7.0+). + Available in [licensed editions](https://chocolatey.org/compare) only (licensed version 1.7.0+). --checksum64, --checksumx64, --downloadchecksumx64, --download-checksum-x64=VALUE Download Checksum 64-bit - checksum to verify File64/Url64 with. - Defaults to empty. Available in Business editions only (licensed version + Defaults to empty. Available in [licensed editions](https://chocolatey.org/compare) only (licensed version 1.7.0+). --checksumtype, --checksum-type, --downloadchecksumtype, --download-checksum-type=VALUE @@ -164,17 +220,21 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --pauseonerror, --pause-on-error Pause on Error - Pause when there is an error with creating the package. - Available in Business editions only (licensed version 1.7.0+). + Available in [licensed editions](https://chocolatey.org/compare) only (licensed version 1.7.0+). - --buildpackage, --build-package + --buildpackage, --build-package, --build-packages Build Package - Attempt to compile the package after creating it. - Available in Business editions only (licensed version 1.7.0+). + Available in [licensed editions](https://chocolatey.org/compare) only (licensed version 1.7.0+). --fromprograms, --from-programs, --fromprogramsandfeatures, --from-programs-and-features Generate Packages From Installed Software - Generate packages from the installed software on a system (does not handle dependencies). Available in Business editions only (licensed version 1.8.0+). + --for-public, --for-community, --generate-for-community + Generate the Package for Community - Generate the package for community + use. Available in Business editions only (licensed version 1.9.0+). + --removearchitecture, --removearchitecturefromname, --remove-architecture, --remove-architecture-from-name Remove Architecture From Name - Remove x86, x64, 64-bit, etc from the package id. Default setting is to remove architecture. Available in diff --git a/docs/generated/CommandsOutdated.md b/docs/generated/CommandsOutdated.md index b41902fc46..ff09fac48c 100644 --- a/docs/generated/CommandsOutdated.md +++ b/docs/generated/CommandsOutdated.md @@ -45,7 +45,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -68,7 +74,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -88,6 +94,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to diff --git a/docs/generated/CommandsPack.md b/docs/generated/CommandsPack.md index db2380b4bc..250a550401 100644 --- a/docs/generated/CommandsPack.md +++ b/docs/generated/CommandsPack.md @@ -46,7 +46,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -69,7 +75,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -89,10 +95,42 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + --version=VALUE Version - The version you would like to insert into the package. - --outputdirectory=VALUE + --out, --outdir, --outputdirectory, --output-directory=VALUE OutputDirectory - Specifies the directory for the created Chocolatey package file. If not specified, uses the current directory. diff --git a/docs/generated/CommandsPin.md b/docs/generated/CommandsPin.md index 0a5b757f2a..b367105f88 100644 --- a/docs/generated/CommandsPin.md +++ b/docs/generated/CommandsPin.md @@ -40,7 +40,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -63,7 +69,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -83,6 +89,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -n, --name=VALUE Name - the name of the package. Required with some actions. Defaults to empty. diff --git a/docs/generated/CommandsPush.md b/docs/generated/CommandsPush.md index bf56d65c8c..8a47786113 100644 --- a/docs/generated/CommandsPush.md +++ b/docs/generated/CommandsPush.md @@ -66,7 +66,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -89,7 +95,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -109,6 +115,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source we are pushing the package to. Use https://chocolatey.org/ to push to [community feed](https://chocolatey.org/packages). diff --git a/docs/generated/CommandsReference.md b/docs/generated/CommandsReference.md index f0a59b38dc..38f38da96e 100644 --- a/docs/generated/CommandsReference.md +++ b/docs/generated/CommandsReference.md @@ -22,8 +22,8 @@ This is a listing of all of the different things you can pass to choco. * [[config|CommandsConfig]] - Retrieve and configure config file settings * [[feature|CommandsFeature]] - view and configure choco features * [[features|CommandsFeatures]] - view and configure choco features (alias for feature) - * [[setapikey|CommandsSetapikey]] - retrieves or saves an apikey for a particular source (alias for apikey) * [[apikey|CommandsApikey]] - retrieves or saves an apikey for a particular source + * [[setapikey|CommandsSetapikey]] - retrieves or saves an apikey for a particular source (alias for apikey) * [[unpackself|CommandsUnpackself]] - have chocolatey set it self up * [[version|CommandsVersion]] - [DEPRECATED] will be removed in v1 - use [[`choco outdated`|Commandsoutdated]] or `cup -whatif` instead * [[update|CommandsUpdate]] - [DEPRECATED] RESERVED for future use (you are looking for upgrade, these are not the droids you are looking for) @@ -56,6 +56,9 @@ You can pass options and switches in the following ways: (`` `"value`" ``) or apostrophes (`'value'`). Using the combination allows for both shells to work without issue, except for when the next section applies. + * **Periods in PowerShell**: If you need to pass a period as part of a + value or a path, PowerShell doesn't always handle it well. Please + quote those values using "Quote Values" section above. * **Pass quotes in arguments**: When you need to pass quoted values to to something like a native installer, you are in for a world of fun. In cmd.exe you must pass it like this: `-ia "/yo=""Spaces spaces"""`. In @@ -90,7 +93,13 @@ You can pass options and switches in the following ways: Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -113,7 +122,7 @@ You can pass options and switches in the following ways: --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -133,6 +142,38 @@ You can pass options and switches in the following ways: instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + ~~~ diff --git a/docs/generated/CommandsSearch.md b/docs/generated/CommandsSearch.md index 92899e6c54..9c395775be 100644 --- a/docs/generated/CommandsSearch.md +++ b/docs/generated/CommandsSearch.md @@ -67,7 +67,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -90,7 +96,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -110,6 +116,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - Source location for install. Can include special 'webpi'. Defaults to sources. diff --git a/docs/generated/CommandsSetapiKey.md b/docs/generated/CommandsSetapiKey.md index 62e6c5e394..50589f810a 100644 --- a/docs/generated/CommandsSetapiKey.md +++ b/docs/generated/CommandsSetapiKey.md @@ -48,7 +48,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -71,7 +77,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -91,6 +97,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source [REQUIRED] - The source location for the key diff --git a/docs/generated/CommandsSource.md b/docs/generated/CommandsSource.md index b360ef1f2c..b66c167f2c 100644 --- a/docs/generated/CommandsSource.md +++ b/docs/generated/CommandsSource.md @@ -45,7 +45,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -68,7 +74,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -88,6 +94,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -n, --name=VALUE Name - the name of the source. Required with some actions. Defaults to empty. @@ -116,6 +154,15 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch above 0 will be evaluated first, then zero-based values will be evaluated in config file order. Available in 0.9.9.9+. + --bypassproxy, --bypass-proxy + Bypass Proxy - Should this source explicitly bypass any explicitly or + system configured proxies? Defaults to false. Available in 0.10.4+. + + --allowselfservice, --allow-self-service + Allow Self-Service - Should this source be allowed to be used with self- + service? Requires business edition. Defaults to false. Available in 0.1- + 0.4+. + ~~~ [[Command Reference|CommandsReference]] diff --git a/docs/generated/CommandsSources.md b/docs/generated/CommandsSources.md index 4c89711ce1..4f48c3e2e9 100644 --- a/docs/generated/CommandsSources.md +++ b/docs/generated/CommandsSources.md @@ -45,7 +45,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -68,7 +74,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -88,6 +94,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -n, --name=VALUE Name - the name of the source. Required with some actions. Defaults to empty. @@ -116,6 +154,15 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch above 0 will be evaluated first, then zero-based values will be evaluated in config file order. Available in 0.9.9.9+. + --bypassproxy, --bypass-proxy + Bypass Proxy - Should this source explicitly bypass any explicitly or + system configured proxies? Defaults to false. Available in 0.10.4+. + + --allowselfservice, --allow-self-service + Allow Self-Service - Should this source be allowed to be used with self- + service? Requires business edition. Defaults to false. Available in 0.1- + 0.4+. + ~~~ [[Command Reference|CommandsReference]] diff --git a/docs/generated/CommandsSupport.md b/docs/generated/CommandsSupport.md index 61e0bca702..67915d2cfd 100644 --- a/docs/generated/CommandsSupport.md +++ b/docs/generated/CommandsSupport.md @@ -15,7 +15,13 @@ As a licensed customer, you can reach out to Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -38,7 +44,7 @@ As a licensed customer, you can reach out to --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -58,6 +64,38 @@ As a licensed customer, you can reach out to instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + ~~~ [[Command Reference|CommandsReference]] diff --git a/docs/generated/CommandsUninstall.md b/docs/generated/CommandsUninstall.md index 04a4f10d0d..9e3e7c5042 100644 --- a/docs/generated/CommandsUninstall.md +++ b/docs/generated/CommandsUninstall.md @@ -94,7 +94,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -117,7 +123,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -137,6 +143,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to @@ -215,6 +253,18 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch uninstaller reports an error. Overrides the default feature 'failOnAutoUninstaller' set to 'False'. Available in 0.9.10+. + --stoponfirstfailure, --stop-on-first-failure, --stop-on-first-package-failure + Stop On First Package Failure - stop running install, upgrade or + uninstall on first package failure instead of continuing with others. + Overrides the default feature 'stopOnFirstPackageFailure' set to 'False- + '. Available in 0.10.4+. + + --fromprograms, --from-programs, --fromprogramsandfeatures, --from-programs-and-features + From Programs and Features - Uninstalls a program from programs and + features. Name used for package must be a match or a wildcard (*). + Available in [licensed editions](https://chocolatey.org/compare) only (licensed version 1.8.0+) and + requires v0.10.4+. + ~~~ [[Command Reference|CommandsReference]] diff --git a/docs/generated/CommandsUnpackself.md b/docs/generated/CommandsUnpackself.md index 3bfa07b26c..41a713ecd3 100644 --- a/docs/generated/CommandsUnpackself.md +++ b/docs/generated/CommandsUnpackself.md @@ -28,7 +28,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -51,7 +57,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -71,6 +77,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + ~~~ [[Command Reference|CommandsReference]] diff --git a/docs/generated/CommandsUpdate.md b/docs/generated/CommandsUpdate.md index 3e4e3ffc94..e261e12a00 100644 --- a/docs/generated/CommandsUpdate.md +++ b/docs/generated/CommandsUpdate.md @@ -25,7 +25,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -48,7 +54,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -68,6 +74,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to diff --git a/docs/generated/CommandsUpgrade.md b/docs/generated/CommandsUpgrade.md index 0ec5231b3c..c3fb8d27cd 100644 --- a/docs/generated/CommandsUpgrade.md +++ b/docs/generated/CommandsUpgrade.md @@ -64,7 +64,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -87,7 +93,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -107,6 +113,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to @@ -245,6 +283,16 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Except - a comma-separated list of package names that should not be upgraded when upgrading 'all'. Defaults to empty. Available in 0.9.10+. + --stoponfirstfailure, --stop-on-first-failure, --stop-on-first-package-failure + Stop On First Package Failure - stop running install, upgrade or + uninstall on first package failure instead of continuing with others. + Overrides the default feature 'stopOnFirstPackageFailure' set to 'False- + '. Available in 0.10.4+. + + --exclude-prerelease + Exclude Prerelease - Should prerelease be ignored for upgrades? Will be + ignored if you pass `--pre`. Available in 0.10.4+. + --sdc, --skipdownloadcache, --skip-download-cache Skip Download Cache - Use the original download even if a private CDN cache is available for a package. Overrides the default feature diff --git a/docs/generated/CommandsVersion.md b/docs/generated/CommandsVersion.md index bbde45e005..fe1be4d770 100644 --- a/docs/generated/CommandsVersion.md +++ b/docs/generated/CommandsVersion.md @@ -29,7 +29,13 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch Debug - Show debug messaging. -v, --verbose - Verbose - Show verbose messaging. + Verbose - Show verbose messaging. Very verbose messaging, avoid using + under normal circumstances. + + --trace + Trace - Show trace messaging. Very, very verbose trace messaging. Avoid + except when needing super low-level .NET Framework debugging. Available + in 0.10.4+. --acceptlicense, --accept-license AcceptLicense - Accept license dialogs automatically. Reserved for @@ -52,7 +58,7 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch --timeout, --execution-timeout=VALUE CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the - configuration of 2700 seconds. + configuration of 2700 seconds. '0' for infinite starting in 0.10.4. -c, --cache, --cachelocation, --cache-location=VALUE CacheLocation - Location for download cache, defaults to %TEMP% or value @@ -72,6 +78,38 @@ Includes [[default options/switches|CommandsReference#default-options-and-switch instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+. + --no-progress + Do Not Show Progress - Do not show download progress percentages. + Available in 0.10.4+. + + --proxy=VALUE + Proxy Location - Explicit proxy location. Overrides the default proxy + location of ''. Available for config settings in 0.9.9.9+, this CLI + option available in 0.10.4+. + + --proxy-user=VALUE + Proxy User Name - Explicit proxy user (optional). Requires explicity + proxy (`--proxy` or config setting). Overrides the default proxy user of + '123'. Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-password=VALUE + Proxy Password - Explicit proxy password (optional) to be used with + username. Requires explicity proxy (`--proxy` or config setting) and + user name. Overrides the default proxy password (encrypted in settings + if set). Available for config settings in 0.9.9.9+, this CLI option + available in 0.10.4+. + + --proxy-bypass-list=VALUE + ProxyBypassList - Comma separated list of regex locations to bypass on + proxy. Requires explicity proxy (`--proxy` or config setting). Overrides + the default proxy bypass list of ''. Available in 0.10.4+. + + --proxy-bypass-on-local + Proxy Bypass On Local - Bypass proxy for local connections. Requires + explicity proxy (`--proxy` or config setting). Overrides the default + proxy bypass on local setting of 'True'. Available in 0.10.4+. + -s, --source=VALUE Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to diff --git a/docs/generated/HelpersGetChocolateyUnzip.md b/docs/generated/HelpersGetChocolateyUnzip.md index 8730225a1b..6e5d093816 100644 --- a/docs/generated/HelpersGetChocolateyUnzip.md +++ b/docs/generated/HelpersGetChocolateyUnzip.md @@ -8,10 +8,11 @@ Unzips an archive file and returns the location for further processing. ~~~powershell Get-ChocolateyUnzip ` - -FileFullPath ` + [-FileFullPath ] ` -Destination ` [-SpecificFolder ] ` [-PackageName ] ` + [-FileFullPath64 ] ` [-IgnoredArguments ] [] ~~~ @@ -61,17 +62,20 @@ None ## Parameters -### -FileFullPath <String> +### -FileFullPath [<String>] This is the full path to the zip file. If embedding it in the package next to the install script, the path will be like `"$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\\file.zip"` In 0.10.1+, `File` is an alias for FileFullPath. +This can be a 32-bit or 64-bit file. This is mandatory in earlier versions +of Chocolatey, but optional if FileFullPath64 has been provided. + Property | Value ---------------------- | ----- Aliases | file -Required? | true +Required? | false Position? | 1 Default Value | Accept Pipeline Input? | false @@ -111,6 +115,23 @@ Position? | 4 Default Value | Accept Pipeline Input? | false +### -FileFullPath64 [<String>] +Full file path to a 64-bit native installer to run. Available in 0.10.4+. +If embedding in the package, you can get it to the path with +`"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"` + +Provide this when you want to provide both 32-bit and 64-bit +installers or explicitly only a 64-bit installer (which will cause a package +install failure on 32-bit systems). + +Property | Value +---------------------- | ------ +Aliases | file64 +Required? | false +Position? | named +Default Value | +Accept Pipeline Input? | false + ### -IgnoredArguments [<Object[]>] Allows splatting with arguments that do not apply. Do not use directly. diff --git a/docs/generated/HelpersGetUninstallRegistryKey.md b/docs/generated/HelpersGetUninstallRegistryKey.md index 54cad2b9c7..d9f31c2738 100644 --- a/docs/generated/HelpersGetUninstallRegistryKey.md +++ b/docs/generated/HelpersGetUninstallRegistryKey.md @@ -25,11 +25,12 @@ handling wrongly encoded registry keys. ## Notes Available in 0.9.10+. If you need to maintain compatibility with pre -0.9.10, please add the following to your nuspec: +0.9.10, please add the following to your nuspec (check for minimum +version): ~~~xml - + ~~~ @@ -44,16 +45,16 @@ Available in 0.9.10+. If you need to maintain compatibility with pre ~~~powershell -# Software name in Programs and Features is "Gpg4Win (2.3.0)" -[array]$key = Get-UninstallRegistryKey -SoftwareName "Gpg4win*" -$key.DisplayName +# Version match: Software name is "Gpg4Win (2.3.0)" +[array]$key = Get-UninstallRegistryKey -SoftwareName "Gpg4win (*)" +$key.UninstallString ~~~ **EXAMPLE 2** ~~~powershell -# Software name is "Launchy 2.5" +# Fuzzy match: Software name is "Launchy 2.5" [array]$key = Get-UninstallRegistryKey -SoftwareName "Launchy*" $key.UninstallString ~~~ @@ -62,8 +63,18 @@ $key.UninstallString ~~~powershell -# Software name is "Mozilla Firefox" -[array]$key = Get-UninstallRegistryKey -SoftwareName "Mozilla Firefox" +# Exact match: Software name in Programs and Features is "VLC media player" +[array]$key = Get-UninstallRegistryKey -SoftwareName "VLC media player" +$key.UninstallString +~~~ + +**EXAMPLE 4** + +~~~powershell + +# Version match: Software name is "SketchUp 2016" +# Note that the similar software name "SketchUp Viewer" would not be matched. +[array]$key = Get-UninstallRegistryKey -SoftwareName "SketchUp [0-9]*" $key.UninstallString ~~~ @@ -80,12 +91,20 @@ None ### -SoftwareName <String> Part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique. +The syntax follows the rules of the PowerShell `-like` operator, so the +`*` character is interpreted as a wildcard, which matches any (zero or +more) characters. -If the display name contains a version number, such as "Launchy 2.5", -it is recommended you use a fuzzy search `"Launchy*"` (the wildcard `*`) -as if the version is upgraded or autoupgraded, suddenly the uninstall -script will stop working and it may not be clear as to what went wrong -at first. +If the display name contains a version number, such as "Launchy (2.5)", +it is recommended you use a fuzzy search `"Launchy (*)"` (the wildcard +`*`) so if Launchy auto-updates or is updated outside of Chocolatey, the +uninstall script will not fail. + +Take care not to abuse fuzzy/glob pattern searches. Be conscious of +programs that may have shared or common root words to prevent +overmatching. For example, "SketchUp*" would match two keys with +software names "SketchUp 2016" and "SketchUp Viewer" that are different +programs released by the same company. Property | Value ---------------------- | -------------- @@ -96,6 +115,8 @@ Default Value | Accept Pipeline Input? | true (ByValue) ### -IgnoredArguments [<Object[]>] +Allows splatting with arguments that do not apply. Do not use directly. + Property | Value ---------------------- | ----- Aliases | diff --git a/docs/generated/HelpersInstallChocolateyInstallPackage.md b/docs/generated/HelpersInstallChocolateyInstallPackage.md index 9cb07a5e8c..b0d4889924 100644 --- a/docs/generated/HelpersInstallChocolateyInstallPackage.md +++ b/docs/generated/HelpersInstallChocolateyInstallPackage.md @@ -14,7 +14,8 @@ Install-ChocolateyInstallPackage ` -PackageName ` [-FileType ] ` [-SilentArgs ] ` - -File ` + [-File ] ` + [-File64 ] ` [-ValidExitCodes ] ` [-UseOnlyPackageSilentArguments] ` [-IgnoredArguments ] [] @@ -161,21 +162,41 @@ Position? | 3 Default Value | Accept Pipeline Input? | false -### -File <String> +### -File [<String>] Full file path to native installer to run. If embedding in the package, you can get it to the path with `"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"` In 0.10.1+, `FileFullPath` is an alias for File. +This can be a 32-bit or 64-bit file. This is mandatory in earlier versions +of Chocolatey, but optional if File64 has been provided. + Property | Value ---------------------- | ------------ Aliases | fileFullPath -Required? | true +Required? | false Position? | 4 Default Value | Accept Pipeline Input? | false +### -File64 [<String>] +Full file path to a 64-bit native installer to run. Available in 0.10.4+. +If embedding in the package, you can get it to the path with +`"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"` + +Provide this when you want to provide both 32-bit and 64-bit +installers or explicitly only a 64-bit installer (which will cause a package +install failure on 32-bit systems). + +Property | Value +---------------------- | -------------- +Aliases | fileFullPath64 +Required? | false +Position? | named +Default Value | +Accept Pipeline Input? | false + ### -ValidExitCodes [<Object>] Array of exit codes indicating success. Defaults to `@(0)`. diff --git a/docs/generated/HelpersInstallChocolateyPowershellCommand.md b/docs/generated/HelpersInstallChocolateyPowershellCommand.md index 36a8996bcd..ec557767e7 100644 --- a/docs/generated/HelpersInstallChocolateyPowershellCommand.md +++ b/docs/generated/HelpersInstallChocolateyPowershellCommand.md @@ -116,7 +116,7 @@ Accept Pipeline Input? | false This is the 32 bit url to download the resource from. This resource can be used on 64 bit systems when a package has both a Url and Url64bit specified if a user passes `--forceX86`. If there is only a 64 bit url -available, please remove do not use the paramter (only use Url64bit). +available, please remove do not use the parameter (only use Url64bit). Will fail on 32bit systems if missing or if a user attempts to force a 32 bit installation on a 64 bit system. @@ -150,20 +150,20 @@ Default Value | Accept Pipeline Input? | false ### -Checksum [<String>] -The checksum hash value of the Url resource. This allows a checksum to +The checksum hash value of the Url resource. This allows a checksum to be validated for files that are not local. The checksum type is covered -by ChecksumType. +by ChecksumType. -**NOTE:** Checksums in packages are meant as a measure to validate the +**NOTE:** Checksums in packages are meant as a measure to validate the originally intended file that was used in the creation of a package is the same file that is received at a future date. Since this is used for -other steps in the process related to the [community repository](https://chocolatey.org/packages), it +other steps in the process related to the [community repository](https://chocolatey.org/packages), it ensures that the file a user receives is the same file a maintainer -and a moderator (if applicable), plus any moderation review has -intended for you to receive with this package. If you are looking at a -remote source that uses the same url for updates, you will need to -ensure the package also stays updated in line with those remote -resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages) +and a moderator (if applicable), plus any moderation review has +intended for you to receive with this package. If you are looking at a +remote source that uses the same url for updates, you will need to +ensure the package also stays updated in line with those remote +resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages) to help provide that functionality. Property | Value @@ -197,22 +197,22 @@ OPTIONAL if no Url64bit - The checksum hash value of the Url64bit resource. This allows a checksum to be validated for files that are not local. The checksum type is covered by ChecksumType64. -**NOTE:** Checksums in packages are meant as a measure to validate the +**NOTE:** Checksums in packages are meant as a measure to validate the originally intended file that was used in the creation of a package is the same file that is received at a future date. Since this is used for -other steps in the process related to the [community repository](https://chocolatey.org/packages), it +other steps in the process related to the [community repository](https://chocolatey.org/packages), it ensures that the file a user receives is the same file a maintainer -and a moderator (if applicable), plus any moderation review has -intended for you to receive with this package. If you are looking at a -remote source that uses the same url for updates, you will need to -ensure the package also stays updated in line with those remote -resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages) +and a moderator (if applicable), plus any moderation review has +intended for you to receive with this package. If you are looking at a +remote source that uses the same url for updates, you will need to +ensure the package also stays updated in line with those remote +resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages) to help provide that functionality. -**NOTE:** To determine checksums, you can get that from the original -site if provided. You can also use the [checksum tool available on -the [community feed](https://chocolatey.org/packages)](https://chocolatey.org/packages/checksum) (`choco install checksum`) -and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you +**NOTE:** To determine checksums, you can get that from the original +site if provided. You can also use the [checksum tool available on +the [community feed](https://chocolatey.org/packages)](https://chocolatey.org/packages/checksum) (`choco install checksum`) +and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you provide checksums for all remote resources used. Property | Value diff --git a/docs/generated/HelpersInstallChocolateyVsixPackage.md b/docs/generated/HelpersInstallChocolateyVsixPackage.md index 6291a4b493..3181edf403 100644 --- a/docs/generated/HelpersInstallChocolateyVsixPackage.md +++ b/docs/generated/HelpersInstallChocolateyVsixPackage.md @@ -78,9 +78,11 @@ None The name of the package - while this is an arbitrary value, it's recommended that it matches the package id. +In 0.10.4+, `Name` is an alias for PackageName. + Property | Value ---------------------- | ----- -Aliases | +Aliases | name Required? | true Position? | 1 Default Value | @@ -91,23 +93,30 @@ The URL of the package to be installed. Prefer HTTPS when available. Can be HTTP, FTP, or File URIs. +In 0.10.4+, `Url` is an alias for VsixUrl. + Property | Value ---------------------- | ----- -Aliases | +Aliases | url Required? | false Position? | 2 Default Value | Accept Pipeline Input? | false ### -VsVersion [<Int32>] -The Major version number of Visual Studio where the +The major version number of Visual Studio where the package should be installed. This is optional. If not specified, the most recent Visual Studio installation will be targetted. +NOTE: For Visual Studio 2015, the VsVersion is 14. It can be determined +by looking at the folders under Program Files / Program Files (x86). + +In 0.10.4+, `VisualStudioVersion` is an alias for VsVersion. + Property | Value ----------------------- | ----- -Aliases | +---------------------- | ------------------- +Aliases | visualStudioVersion Required? | false Position? | 3 Default Value | 0 diff --git a/docs/generated/HelpersStartChocolateyProcessAsAdmin.md b/docs/generated/HelpersStartChocolateyProcessAsAdmin.md index e8dcf09858..e6346e606f 100644 --- a/docs/generated/HelpersStartChocolateyProcessAsAdmin.md +++ b/docs/generated/HelpersStartChocolateyProcessAsAdmin.md @@ -72,6 +72,17 @@ Start-ChocolateyProcessAsAdmin -Statements "$silentArgs" -ExeToRun $file -ValidE # Run PowerShell statements $psFile = Join-Path "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 'someInstall.ps1' Start-ChocolateyProcessAsAdmin "& `'$psFile`'" +~~~ + +**EXAMPLE 5** + +~~~powershell +# This also works for cmd and is required if you have any spaces in the paths within your command +$appPath = "$env:ProgramFiles\myapp" +$cmdBatch = "/c `"$appPath\bin\installmyappservice.bat`"" +Start-ChocolateyProcessAsAdmin $cmdBatch cmd +# or more explicitly +Start-ChocolateyProcessAsAdmin -Statements $cmdBatch -ExeToRun "cmd.exe" ~~~ ## Inputs From b97bf04538e4a5b1676d11984416a9768eb1e8be Mon Sep 17 00:00:00 2001 From: James Telfer Date: Wed, 28 Dec 2016 23:35:36 +1100 Subject: [PATCH 8/8] (GH-1098) Get-FtpFile - change int to long / improve error handling Previously, using integers in Get-FtpFile could result in integer stack overflows. Change to long to bring in line with `Get-WebFile` and avoid errors. Removed unnecessary catch block, shifted close of reader and writer to the enclosing finally block. The close calls are wrapped in an empty try/catch as an error here would mask an error thrown from the catch block. --- .../helpers/functions/Get-FtpFile.ps1 | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 b/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 index 2acf638e6d..766e20fc83 100644 --- a/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-FtpFile.ps1 @@ -140,7 +140,7 @@ param( try { # send the ftp request to the server $ftpresponse = $ftprequest.GetResponse() - [int]$goal = $ftpresponse.ContentLength + [long]$goal = $ftpresponse.ContentLength $goalFormatted = Format-FileSize $goal # get a download stream from the server response @@ -148,8 +148,9 @@ param( # create the target file on the local system and the download buffer $writer = New-Object IO.FileStream ($fileName,[IO.FileMode]::Create) + [byte[]]$buffer = New-Object byte[] 1024 - [int]$total = [int]$count = 0 + [long]$total = [long]$count = 0 $originalEAP = $ErrorActionPreference $ErrorActionPreference = 'Stop' @@ -174,17 +175,11 @@ param( } while ($count -ne 0) Write-Host "" Write-Host "Download of $([System.IO.Path]::GetFileName($fileName)) ($goalFormatted) completed." - } catch { - throw $_.Exception } finally { $ErrorActionPreference = $originalEAP } - $reader.Close() - if ($fileName) { - $writer.Flush() - $writer.Close() - } + $writer.Flush() # closed in finally block } catch { if ($ftprequest -ne $null) { @@ -203,8 +198,17 @@ param( throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message)" } } finally { + + if ($reader -ne $null) { + try { $reader.Close(); } catch {} + } + + if ($writer -ne $null) { + try { $writer.Close(); } catch {} + } + if ($ftpresponse -ne $null) { - $ftpresponse.Close() + try { $ftpresponse.Close(); } catch {} } Start-Sleep 1