Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-1184) Upgrade to 7zip 16.04
  (maint) remove unused 7za
  (maint) update why 32-bit 7z is required
  (GH-676) Fix: Unzip specific folder feature is broken
  (maint) Additional version environment variables
  • Loading branch information
ferventcoder committed Mar 18, 2017
2 parents 628b4a7 + cb6f3c4 commit dec67a8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ param(
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
$zipfileFullPath=$fileFullPath
if ($specificfolder) {
$fileFullPath=join-path $fileFullPath $specificFolder
}

Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters

Expand Down Expand Up @@ -111,9 +108,10 @@ param(
$7zip = [System.IO.Path]::GetFullPath($7zip)
Write-Debug "7zip found at `'$7zip`'"

# 32-bit 7z.exe would not find C:\Windows\System32\config\systemprofile\AppData\Local\Temp,
# 32-bit 7z would not find C:\Windows\System32\config\systemprofile\AppData\Local\Temp,
# because it gets translated to C:\Windows\SysWOW64\... by the WOW redirection layer.
# 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')
$destinationNoRedirection = $destination -ireplace ([regex]::Escape([Environment]::GetFolderPath('System'))),(Join-Path $Env:SystemRoot 'SysNative')
Expand All @@ -123,6 +121,9 @@ param(
}

$params = "x -aoa -bd -bb1 -o`"$destinationNoRedirection`" -y `"$fileFullPathNoRedirection`""
if ($specificfolder) {
$params += " `"$specificfolder`""
}
Write-Debug "Executing command ['$7zip' $params]"

# Capture 7z's output into a StringBuilder and write it out in blocks, to improve I/O performance.
Expand Down
Binary file modified src/chocolatey.resources/tools/7z.dll
Binary file not shown.
Binary file modified src/chocolatey.resources/tools/7z.exe
Binary file not shown.
Binary file removed src/chocolatey.resources/tools/7za.exe
Binary file not shown.
Empty file.
11 changes: 0 additions & 11 deletions src/chocolatey.resources/tools/7za.exe.manifest

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ public void prepare_powershell_environment(IPackage package, ChocolateyConfigura
Environment.SetEnvironmentVariable("packageTitle", package.Title);
Environment.SetEnvironmentVariable("chocolateyPackageVersion", package.Version.to_string());
Environment.SetEnvironmentVariable("packageVersion", package.Version.to_string());
Environment.SetEnvironmentVariable("chocolateyPackageVersionPrerelease", package.Version.SpecialVersion.to_string());
Environment.SetEnvironmentVariable("chocolateyPackageVersionPackageRelease", package.Version.PackageReleaseVersion.to_string());

Environment.SetEnvironmentVariable("chocolateyPackageFolder", packageDirectory);
Environment.SetEnvironmentVariable("packageFolder", packageDirectory);

Expand Down

0 comments on commit dec67a8

Please sign in to comment.