Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (version) 0.10.2
  (doc) update CHANGELOG/nuspec
  (GH-992) allow uninstall scripts for side by side
  (GH-992) search for sidebyside install first
  (GH-992) Uninstall should always work with version
  (maint) RefreshEnv.cmd mentions cmd.exe
  (maint) fix message
  (spec) support no prompting
  (GH-986) Remove extra forward slashes in url
  (GH-573) Explain Failing Uninstall Options
  (GH-985) rollback automatically on user cancel
  (GH-984) Detect licensed options in FOSS
  (GH-983) Do not add unparsed options to package names
  (GH-982) Note AutoUninstaller in uninstall template
  (docs) clean up messaging for logo use policy
  • Loading branch information
ferventcoder committed Sep 30, 2016
2 parents c798ae3 + dc6c1f7 commit 2c4dc5b
Show file tree
Hide file tree
Showing 17 changed files with 189 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .uppercut
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<property name="version.use_semanticversioning" value="true" overwrite="false" />
<property name="version.major" value="0" overwrite="false" />
<property name="version.minor" value="10" overwrite="false" />
<property name="version.patch" value="1" overwrite="false" />
<property name="version.patch" value="2" overwrite="false" />
<property name="version.fix" value="0" overwrite="false" />
<property name="version.nuget.prerelease" value="" overwrite="false" />
<property name="version.use.build_date" value="false" overwrite="false" />
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ This covers changes for the "chocolatey" and "chocolatey.lib" packages, which ar

**NOTE**: If you have a licensed edition of Chocolatey ("chocolatey.extension"), refer to this in tandem with [Chocolatey Licensed CHANGELOG](https://github.com/chocolatey/choco/blob/master/CHANGELOG_LICENSED.md).

## [0.10.2](https://github.com/chocolatey/choco/issues?q=milestone%3A0.10.2+is%3Aclosed) (September 30, 2016)

We're dubbing this the "Every Joe" release in honor of a friend that just lost his fight with brain cancer. If you want to help further research, please make a donation to a cancer research association of your choosing (e.g. the [American Brain Tumor Assocation](http://www.abta.org/thank-you.html)).

A couple of important fixes/enhancements in this release. Most of the improvements are about providing better feedback to you and fixing minor issues. The big one surrounds when packages set a download path for a file using `$env:TEMP`, choco will ensure that the file can still be found for later use.

### BUG FIXES

* Fix - Downloaded file is at old `$env:TEMP\chocolatey\chocolatey` location, but install calls with just `$env:TEMP\chocolatey\` location - see [#969](https://github.com/chocolatey/choco/issues/969)
* Fix - [Pro/Business] UseOriginalLocation fails when there is no 64bit file - see [#972](https://github.com/chocolatey/choco/issues/972)
* Fix - Do not use unparsed options as package names - see [#983](https://github.com/chocolatey/choco/issues/983)

### IMPROVEMENTS

* Start-ChocolateyProcessAsAdmin enhancements - see [#977](https://github.com/chocolatey/choco/issues/977)
* Log PowerShell function calls better - see [#976](https://github.com/chocolatey/choco/issues/976)
* Allow environment variables in some config settings - see [#971](https://github.com/chocolatey/choco/issues/971)
* [Pro/Business] Provide license type to environment variables - see [#968](https://github.com/chocolatey/choco/issues/968)
* Note that chocolateyUninstall.ps1 may no longer required in template - see [#982](https://github.com/chocolatey/choco/issues/982)
* Provide guidance when licensed only options are passed to FOSS - see [#984](https://github.com/chocolatey/choco/issues/984)
* Rollback automatically when a user cancels an operation - see [#985](https://github.com/chocolatey/choco/issues/985)
* Explain how to workaround a failing uninstall - see [#573](https://github.com/chocolatey/choco/issues/573)
* Remove extra forward slashes in url - see [#986](https://github.com/chocolatey/choco/issues/986)
* Side by side uninstall enhancements - see [#992](https://github.com/chocolatey/choco/issues/992)


## [0.10.1](https://github.com/chocolatey/choco/issues?q=milestone%3A0.10.1+is%3Aclosed) (September 19, 2016)

We're dubbing this the "Shhh! Keep that secret please" release. We've found that when passing in passwords and other sensitive arguments, those items can end up in the logs in clear text. We've addressed this in [#948](https://github.com/chocolatey/choco/issues/948) and [#953](https://github.com/chocolatey/choco/issues/953). When it comes to passing sensitive arguments through to native installers, you can set up environment variables with those sensitive args and pass those arguments directly through to `Start-ChocolateyProcessAsAdmin`. If you prefer a better experience, the licensed version allows passing sensitive options directly through choco.exe as `--install-arguments-sensitive` and `--package-parameters-sensitive`. Read more in the [Licensed CHANGELOG](https://github.com/chocolatey/choco/blob/master/CHANGELOG_LICENSED.md).
Expand Down
8 changes: 5 additions & 3 deletions docs/logo/LogoUsePolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ The Apache 2.0 license does not apply for the logos/marks.

Chocolatey open source code falls under the Apache 2.0 license, which permits third parties to copy and redistribute the underlying software under the terms of the license. However, the Apache 2.0 license does not provide any license or right to use any of the Chocolatey marks, including logos. You may redistribute the applicable Chocolatey open source software under the terms of the Apache 2.0 license, but you may not use the Chocolatey marks in doing so without express written permission from RealDimensions Software, LLC.

# Chocolatey Marks / Logo

You must obtain written permission from RealDimensions Software, LLC, to use the Chocolatey marks for any use, including but not limited to; (i) merchandising purposes (e.g. T-shirts, mugs); (ii) on or in relation to a software product that includes or is built on top of any Chocolatey product, including Chocolatey's open source projects; or (iii) in an attention-getting or branding manner. Without the express prior written consent of RealDimensions Software, LLC, no Chocolatey Marks may be used in a manner that implies an affiliation with, approval by, endorsement of or sponsorship by RealDimensions Software, LLC.

### General Use
## General Use

You may use Chocolatey marks/logos, without a license, provided such use complies with the following requirements: (i) the Chocolatey mark is used only to refer to the Chocolatey project, framework, and/or technology; (ii) the Chocolatey mark is not used as part of your product, brand, domain, URL, or service name; (iii) the Chocolatey mark appears less prominent than your company or product name; (iv) the reference to Chocolatey does not create a sense of endorsement, sponsorship, or ownership by Chocolatey and/or RealDimensions Software, LLC; and/or (v) your use of the Chocolatey mark is necessary to fully describe your services or products and is limited to as much of the Chocolatey Mark as is necessary for such identification ("Nominative Use"). NO OTHER USE OF THE CHOCOLATEY MARK IS PERMITTED WITHOUT A WRITTEN LICENSE AGREEMENT.

### Plain Speak
## Plain Speak

**NOTE**: This section ("Plain Speak") in no way changes what is written in the rest of this document. This only attempts to provide some clarity. If there is a conflict with another section, the other section applies.

Without an express written agreement, you cannot use the Chocolatey logos as part of your brand/product.
Without an express written agreement, you cannot use the Chocolatey logos as part of your brand/product.
26 changes: 26 additions & 0 deletions nuget/chocolatey/chocolatey.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ In that mess there is a link to the [PowerShell Chocolatey module reference](htt
<releaseNotes>
See all - https://github.com/chocolatey/choco/blob/stable/CHANGELOG.md

## 0.10.2

We're dubbing this the "Every Joe" release in honor of a friend that just lost his fight with brain cancer. If you want to help further research, please make a donation to a cancer research association of your choosing (e.g. the [American Brain Tumor Assocation](http://www.abta.org/thank-you.html)).

A couple of important fixes/enhancements in this release. Most of the improvements are about providing better feedback to you and fixing minor issues. The big one surrounds when packages set a download path for a file using `$env:TEMP`, choco will ensure that the file can still be found for later use.

### BUG FIXES

* Fix - Downloaded file is at old `$env:TEMP\chocolatey\chocolatey` location, but install calls with just `$env:TEMP\chocolatey\` location - see [#969](https://github.com/chocolatey/choco/issues/969)
* Fix - [Pro/Business] UseOriginalLocation fails when there is no 64bit file - see [#972](https://github.com/chocolatey/choco/issues/972)
* Fix - Do not use unparsed options as package names - see [#983](https://github.com/chocolatey/choco/issues/983)

### IMPROVEMENTS

* Start-ChocolateyProcessAsAdmin enhancements - see [#977](https://github.com/chocolatey/choco/issues/977)
* Log PowerShell function calls better - see [#976](https://github.com/chocolatey/choco/issues/976)
* Allow environment variables in some config settings - see [#971](https://github.com/chocolatey/choco/issues/971)
* [Pro/Business] Provide license type to environment variables - see [#968](https://github.com/chocolatey/choco/issues/968)
* Note that chocolateyUninstall.ps1 may no longer required in template - see [#982](https://github.com/chocolatey/choco/issues/982)
* Provide guidance when licensed only options are passed to FOSS - see [#984](https://github.com/chocolatey/choco/issues/984)
* Rollback automatically when a user cancels an operation - see [#985](https://github.com/chocolatey/choco/issues/985)
* Explain how to workaround a failing uninstall - see [#573](https://github.com/chocolatey/choco/issues/573)
* Remove extra forward slashes in url - see [#986](https://github.com/chocolatey/choco/issues/986)
* Side by side uninstall enhancements - see [#992](https://github.com/chocolatey/choco/issues/992)


## 0.10.1

We're dubbing this the "Shhh! Keep that secret please" release. We've found that when passing in passwords and other sensitive arguments, those items can end up in the logs in clear text. We've addressed this in [#948](https://github.com/chocolatey/choco/issues/948) and [#953](https://github.com/chocolatey/choco/issues/953). When it comes to passing sensitive arguments through to native installers, you can set up environment variables with those sensitive args and pass those arguments directly through to `Start-ChocolateyProcessAsAdmin`. If you prefer a better experience, the licensed version allows passing sensitive options directly through choco.exe as `--install-arguments-sensitive` and `--package-parameters-sensitive`. Read more in the [Licensed CHANGELOG](https://github.com/chocolatey/choco/blob/master/CHANGELOG_LICENSED.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ param(

Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters

if ($url -ne $null) { $url = $url.Replace("//","/").Replace(":/","://") }
if ($url64bit -ne $null) { $url64bit = $url64bit.Replace("//","/").Replace(":/","://") }

$url32bit = $url

# allow user provided values for checksumming
Expand Down
3 changes: 2 additions & 1 deletion src/chocolatey.resources/redirects/RefreshEnv.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
:: With this batch file, there should be no need to reload command
:: environment every time you want environment changes to propagate

echo | set /p dummy="Reading environment variables from registry. Please wait... "
::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell"
echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait... "

goto main

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public override void Context()
fileSystem.Setup(f => f.directory_exists(registryKeys.FirstOrDefault().InstallLocation)).Returns(true);
registryService.Setup(r => r.installer_value_exists(registryKeys.FirstOrDefault().KeyPath, ApplicationParameters.RegistryValueInstallLocation)).Returns(true);
fileSystem.Setup(f => f.get_full_path(expectedUninstallString)).Returns(expectedUninstallString);

var field = typeof(ApplicationParameters).GetField("AllowPrompts");
field.SetValue(null, false);
}
}

Expand Down
10 changes: 9 additions & 1 deletion src/chocolatey/infrastructure.app/ApplicationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,18 @@ public static class Environment

public static readonly string HashProviderFileTooBig = "UnableToDetectChanges_FileTooBig";
public static readonly string HashProviderFileLocked = "UnableToDetectChanges_FileLocked";


/// <summary>
/// This is a readonly bool set to true. It is only shifted for specs.
/// </summary>
public static readonly bool LockTransactionalInstallFiles = true;
public static readonly string PackagePendingFileName = ".chocolateyPending";

/// <summary>
/// This is a readonly bool set to true. It is only shifted for specs.
/// </summary>
public static readonly bool AllowPrompts = true;

public static class Tools
{
//public static readonly string WebPiCmdExe = _fileSystem.combine_paths(InstallLocation, "nuget.exe");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace chocolatey.infrastructure.app.commands
{
using System;
using System.Collections.Generic;
using System.Linq;
using attributes;
using commandline;
using configuration;
Expand Down Expand Up @@ -157,7 +158,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon
public virtual void handle_additional_argument_parsing(IList<string> unparsedArguments, ChocolateyConfiguration configuration)
{
configuration.Input = string.Join(" ", unparsedArguments);
configuration.PackageNames = string.Join(ApplicationParameters.PackageNamesSeparator.to_string(), unparsedArguments);
configuration.PackageNames = string.Join(ApplicationParameters.PackageNamesSeparator.to_string(), unparsedArguments.Where(arg => !arg.StartsWith("-")));
}

public virtual void handle_validation(ChocolateyConfiguration configuration)
Expand All @@ -177,6 +178,22 @@ public virtual void handle_validation(ChocolateyConfiguration configuration)
{
throw new ApplicationException("Force dependencies can only be used with force also turned on.");
}

if (!string.IsNullOrWhiteSpace(configuration.Input))
{
var unparsedOptionsAndPackages = configuration.Input.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (!configuration.Information.IsLicensedVersion)
{
foreach (var argument in unparsedOptionsAndPackages.or_empty_list_if_null())
{
var arg = argument.to_lower();
if (arg.StartsWith("-dir") || arg.StartsWith("--dir") || arg.StartsWith("-install") || arg.StartsWith("--install"))
{
throw new ApplicationException("It appears you are attempting to use options that may be only available in licensed versions of Chocolatey ('{0}'). Please remove and consult the documentation.".format_with(arg));
}
}
}
}
}

public virtual void help_message(ChocolateyConfiguration configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace chocolatey.infrastructure.app.commands
{
using System;
using System.Collections.Generic;
using System.Linq;
using attributes;
using commandline;
using configuration;
Expand Down Expand Up @@ -118,7 +119,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon
public virtual void handle_additional_argument_parsing(IList<string> unparsedArguments, ChocolateyConfiguration configuration)
{
configuration.Input = string.Join(" ", unparsedArguments);
configuration.PackageNames = string.Join(ApplicationParameters.PackageNamesSeparator.to_string(), unparsedArguments);
configuration.PackageNames = string.Join(ApplicationParameters.PackageNamesSeparator.to_string(), unparsedArguments.Where(arg => !arg.StartsWith("-")));
}

public virtual void handle_validation(ChocolateyConfiguration configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace chocolatey.infrastructure.app.commands
{
using System;
using System.Collections.Generic;
using System.Linq;
using attributes;
using commandline;
using configuration;
Expand Down Expand Up @@ -162,7 +163,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon
public virtual void handle_additional_argument_parsing(IList<string> unparsedArguments, ChocolateyConfiguration configuration)
{
configuration.Input = string.Join(" ", unparsedArguments);
configuration.PackageNames = string.Join(ApplicationParameters.PackageNamesSeparator.to_string(), unparsedArguments);
configuration.PackageNames = string.Join(ApplicationParameters.PackageNamesSeparator.to_string(), unparsedArguments.Where(arg => !arg.StartsWith("-")));
}

public virtual void handle_validation(ChocolateyConfiguration configuration)
Expand All @@ -171,6 +172,28 @@ public virtual void handle_validation(ChocolateyConfiguration configuration)
{
throw new ApplicationException("Package name is required. Please pass at least one package name to upgrade.");
}

if (configuration.ForceDependencies && !configuration.Force)
{
throw new ApplicationException("Force dependencies can only be used with force also turned on.");
}

if (!string.IsNullOrWhiteSpace(configuration.Input))
{
var unparsedOptionsAndPackages = configuration.Input.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (!configuration.Information.IsLicensedVersion)
{
foreach (var argument in unparsedOptionsAndPackages.or_empty_list_if_null())
{
var arg = argument.to_lower();
if (arg.StartsWith("-dir") || arg.StartsWith("--dir") || arg.StartsWith("-install") || arg.StartsWith("--install"))
{
throw new ApplicationException(
"It appears you are attempting to use options that may be only available in licensed versions of Chocolatey ('{0}'). Please remove and consult the documentation.".format_with(arg));
}
}
}
}
}

public virtual void help_message(ChocolateyConfiguration configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,26 @@ public ChocolateyPackagePathResolver(IFileSystem nugetFileSystem, bool useSideBy

public override string GetInstallPath(IPackage package)
{
return Path.Combine(_nugetFileSystem.Root, GetPackageDirectory(package));
var packageVersionPath = Path.Combine(_nugetFileSystem.Root, GetPackageDirectory(package.Id,package.Version,useVersionInPath:true));
if (_nugetFileSystem.DirectoryExists(packageVersionPath)) return packageVersionPath;


return Path.Combine(_nugetFileSystem.Root, GetPackageDirectory(package.Id, package.Version));
}

public override string GetPackageDirectory(string packageId, SemanticVersion version)
{
return GetPackageDirectory(packageId, version, UseSideBySidePaths);
}

public string GetPackageDirectory(string packageId, SemanticVersion version, bool useVersionInPath)
{
string directory = packageId;
if (UseSideBySidePaths)
if (useVersionInPath)
{
directory += "." + version.to_string();
}

return directory;
}

Expand Down
Loading

0 comments on commit 2c4dc5b

Please sign in to comment.