Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-969) Generate ignore after $file location
  (GH-969) Remove double choco folder if file exists
  (GH-969) Ensure replacement of double chocolatey
  (doc) update CHANGELOG_LICENSED
  (GH-971) Expand Env Variables for Config Settings
  (GH-971) IEnvironment.ExpandEnvironmentVariables
  (GH-972) Fix - UseOriginalLocation fails w/no 64bit file
  • Loading branch information
ferventcoder committed Sep 22, 2016
2 parents 047f0bc + 15deb12 commit 384c2e1
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 39 deletions.
72 changes: 43 additions & 29 deletions CHANGELOG_LICENSED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ This covers changes for the "chocolatey.extension" package, where the licensed e

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

## 1.7.0 (unreleased)
## 1.7.0 (Sep 22, 2016)

### BUG FIXES

* Package Internalizer (Choco Download) - ensure logging does not incur log format exceptions
* install/upgrade - Look for downloaded file at old path if replaced 'chocolatey\chocolatey' path does not exist - see [#969](https://github.com/chocolatey/choco/issues/969)

### IMPROVEMENTS

* Package Builder (Choco New):
* `--build-package` to build a package after Package Builder creates the package all in one go.
* `--pause-on-error` to pause the output when there are errors for closer inspection (useful when run from a batch file).
* Specify checksum and type - checksum will be verified against files/downloaded files.

* `--build-package` to build a package after Package Builder creates the package all in one go.
* `--pause-on-error` to pause the output when there are errors for closer inspection (useful when run from a batch file).
* Specify checksum and type - checksum will be verified against files/downloaded files.
* Loads of improvements in how package id and title are determined and cleaned up.
* Product versions and portions of product versions are removed from package id/title.
* Package Internalizer (Choco Download):
* Add `--internalize` as alias to `--recompile`.
* Warn of issue with `-UseOriginalLocation` when only using one file.
* Add `--append-useoriginallocation` and feature internalizeAppendUseOriginalLocation that makes the determination to add to the end of `Install-ChocolateyPackage` when using local resources.

## 1.6.3 (Sep 20, 2016)

Expand All @@ -35,11 +45,11 @@ This covers changes for the "chocolatey.extension" package, where the licensed e

## 1.6.1 (Sep 8, 2016)

### BUG FIXESs
### BUG FIXES

* Package Builder (Choco New):
* Fix - Do not error on missing appsearch table in MSI.
* Fix - Do not add similarly named items from AppSearch table to template properties more than once
* Fix - Do not error on missing appsearch table in MSI.
* Fix - Do not add similarly named items from AppSearch table to template properties more than once


## 1.6.0 (Sep 8, 2016)
Expand All @@ -49,41 +59,41 @@ Some really big improvements are now available in v1.6.0. We are excited to shar
### FEATURES

* Licensed Enhancements:
* install/upgrade - pass sensitive arguments that are not shown/logged in Chocolatey to an installer - useful when you want to pass passwords but don't want them logged. Need Chocolatey v0.10.1+.
* AutoUninstaller - determine type from original executable when FOSS is not able to detect installer type.
* install/upgrade - pass sensitive arguments that are not shown/logged in Chocolatey to an installer - useful when you want to pass passwords but don't want them logged. Need Chocolatey v0.10.1+.
* AutoUninstaller - determine type from original executable when FOSS is not able to detect installer type.
* Package Builder (Choco New):
* Now supports downloading from url/url64 and determining whether to keep those files remote.
* Switch to use original file location instead of copying into package
* Specify both 32-bit/64-bit file
* Work with zip files
* Now supports downloading from url/url64 and determining whether to keep those files remote.
* Switch to use original file location instead of copying into package
* Specify both 32-bit/64-bit file
* Work with zip files

### BUG FIXES

* Fix - changes related to working directory fixes for [#937](https://github.com/chocolatey/choco/issues/937)
* Fix - double chocolatey folder name is not also applied to the passed in file name - see [#908](https://github.com/chocolatey/choco/issues/908)
* Package Builder (Choco New):
* Fix - remove parentheses from package names
* Fix - keep template updated
* Fix - remove parentheses from package names
* Fix - keep template updated
* Package Internalizer (Choco Download):
* Fix - handle downloaded files with the same name Sometimes the file name is the same when the architecture is different. Handle that by using the url counter for all additional files with the same name.
* Fix - handle downloaded files with the same name Sometimes the file name is the same when the architecture is different. Handle that by using the url counter for all additional files with the same name.

### IMPROVEMENTS

* Remind About Upcoming Expiration - when the license is expiring within a month's time, remind the user about renewal
* Package Builder (Choco New):
* Handle -forcex86 with package creation
* Add shimgen ignore for exes
* Use ProductVersion when version 0.0.0.0
* Remove the word "installer" from package name
* Allow specifying name of the package
* Allow template override with warning
* Show MSI properties in install script (commented)
* Ensure `ALLUSERS=1` when an MSI is set to per user by default
* Automatically checksum files
* Allow files to stay remote - use remote helpers when files stay remote
* Handle -forcex86 with package creation
* Add shimgen ignore for exes
* Use ProductVersion when version 0.0.0.0
* Remove the word "installer" from package name
* Allow specifying name of the package
* Allow template override with warning
* Show MSI properties in install script (commented)
* Ensure `ALLUSERS=1` when an MSI is set to per user by default
* Automatically checksum files
* Allow files to stay remote - use remote helpers when files stay remote
* Package Internalizer (Choco Download):
* handle variables in urls set like ${word}
* Append `-UseOriginalLocation` to the end of the arguments passed to Install-ChocolateyPackage. Work with splatting properly as well
* handle variables in urls set like ${word}
* Append `-UseOriginalLocation` to the end of the arguments passed to Install-ChocolateyPackage. Work with splatting properly as well


## 1.5.1 (Aug 9, 2016)
Expand Down Expand Up @@ -192,6 +202,7 @@ Some really big improvements are now available in v1.6.0. We are excited to shar

* Virus scanning for Pro users! See the [post](https://www.kickstarter.com/projects/ferventcoder/chocolatey-the-alternative-windows-store-like-yum/posts/1518468) for details!


## 1.1.0 (February 12, 2016)

### IMPROVEMENTS
Expand All @@ -206,18 +217,21 @@ Some really big improvements are now available in v1.6.0. We are excited to shar
* Messaging is clarified
* Skip or run virus check with command options - see `choco install -h` for details.


## 1.0.2 (February 5, 2016)

### BUG FIXES

* Fix - PowerShell 5 respects Cmdlet aliases, causing overrides on functions not ready (Install-ChocolateyPackage). See the [post](https://www.kickstarter.com/projects/ferventcoder/chocolatey-the-alternative-windows-store-like-yum/posts/1484093) for details.


## 1.0.1 (February 2, 2016)

### BUG FIXES

* Fix - License location validation is incorrect.


## 1.0.0 (February 1, 2016)

### FEATURES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ param(

if ($getOriginalFileName) {
try {
$fileFullPath = $fileFullPath -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
$fileDirectory = [System.IO.Path]::GetDirectoryName($fileFullPath)
$originalFileName = [System.IO.Path]::GetFileName($fileFullPath)
$fileFullPath = Get-WebFileName -Url $url -DefaultName $originalFileName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,6 @@ param(
$fileType = 'exe'
}

$ignoreFile = $file + '.ignore'
try {
'' | out-file $ignoreFile
} catch {
Write-Warning "Unable to generate `'$ignoreFile`'"
}

$env:ChocolateyInstallerType = $fileType

$additionalInstallArgs = $env:chocolateyInstallArguments;
Expand All @@ -202,9 +195,20 @@ Pro / Business supports a single, ubiquitous install directory option.
$overrideArguments = $env:chocolateyInstallOverride;

# remove \chocolatey\chocolatey\
# might be a slight issue here if the download path is the older
$silentArgs = $silentArgs -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
$additionalInstallArgs = $additionalInstallArgs -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
$file = $file -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
$updatedFilePath = $file -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
if ([System.IO.File]::Exists($updatedFilePath)) {
$file = $updatedFilePath
}

$ignoreFile = $file + '.ignore'
try {
'' | out-file $ignoreFile
} catch {
Write-Warning "Unable to generate `'$ignoreFile`'"
}

$workingDirectory = Get-Location
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ param(
$chocTempDir = $env:TEMP
$tempDir = Join-Path $chocTempDir "$($env:chocolateyPackageName)"
if ($env:chocolateyPackageVersion -ne $null) {$tempDir = Join-Path $tempDir "$($env:chocolateyPackageVersion)"; }
$tempDir = $tempDir -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'

if (![System.IO.Directory]::Exists($tempDir)) { [System.IO.Directory]::CreateDirectory($tempDir) | Out-Null }
$file = Join-Path $tempDir "$($packageName)Install.$fileType"
Expand All @@ -292,7 +293,9 @@ param(
if ($forceX86) {
Write-Debug "User specified '-x86' so forcing 32-bit"
} else {
$filePath = $url64bit
if ($url64bit -ne $null -and $url64bit -ne '') {
$filePath = $url64bit
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ param(
$chocTempDir = $env:TEMP
$tempDir = Join-Path $chocTempDir "$($env:chocolateyPackageName)"
if ($env:chocolateyPackageVersion -ne $null) {$tempDir = Join-Path $tempDir "$($env:chocolateyPackageVersion)"; }
$tempDir = $tempDir -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'

if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir) | Out-Null}
$file = Join-Path $tempDir "$($packageName)Install.$fileType"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static void set_machine_sources(ChocolateyConfiguration config, ConfigFi
private static void set_config_items(ChocolateyConfiguration config, ConfigFileSettings configFileSettings, IFileSystem fileSystem)
{
var cacheLocation = set_config_item(ApplicationParameters.ConfigSettings.CacheLocation, configFileSettings, string.IsNullOrWhiteSpace(configFileSettings.CacheLocation) ? string.Empty : configFileSettings.CacheLocation, "Cache location if not TEMP folder.");
config.CacheLocation = !string.IsNullOrWhiteSpace(cacheLocation) ? cacheLocation : fileSystem.combine_paths(fileSystem.get_temp_path(), "chocolatey"); // System.Environment.GetEnvironmentVariable("TEMP");
config.CacheLocation = !string.IsNullOrWhiteSpace(cacheLocation) ? Environment.ExpandEnvironmentVariables(cacheLocation) : fileSystem.combine_paths(fileSystem.get_temp_path(), "chocolatey"); // System.Environment.GetEnvironmentVariable("TEMP");
if (string.IsNullOrWhiteSpace(config.CacheLocation))
{
config.CacheLocation = fileSystem.combine_paths(ApplicationParameters.InstallLocation, "temp");
Expand Down
7 changes: 7 additions & 0 deletions src/chocolatey/infrastructure/adapters/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ public string NewLine
get { return System.Environment.NewLine; }
}

public string ExpandEnvironmentVariables(string name)
{
if (string.IsNullOrWhiteSpace(name)) return name;

return System.Environment.ExpandEnvironmentVariables(name);
}

public string GetEnvironmentVariable(string variable)
{
return System.Environment.GetEnvironmentVariable(variable);
Expand Down
13 changes: 13 additions & 0 deletions src/chocolatey/infrastructure/adapters/IEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ public interface IEnvironment
/// <filterpriority>1</filterpriority>
string NewLine { get; }

/// <summary>
/// Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string.
///
/// </summary>
///
/// <returns>
/// A string with each environment variable replaced by its value.
/// </returns>
/// <param name="name">A string containing the names of zero or more environment variables. Each environment variable is quoted with the percent sign character (%).</param>
/// <exception cref="T:System.ArgumentNullException"><paramref name="name"/> is null.
/// </exception><filterpriority>1</filterpriority><PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/></PermissionSet>
string ExpandEnvironmentVariables(string name);

/// <summary>
/// Gets the environment variable.
/// </summary>
Expand Down

0 comments on commit 384c2e1

Please sign in to comment.