From 4b66a025ee76a8054cd9225bb5e2cd3fe398283c Mon Sep 17 00:00:00 2001 From: DarwinJS Date: Wed, 19 Oct 2016 05:15:11 -0400 Subject: [PATCH] (GH 676) SpecificFolder feature fixed Tested with Install-ChocolateyZipPackage $packageName $url $toolsDir $url64 -checksum $checksum -checksumType $checksumType -checksum64 $checksum64 -checksumType64 $checksumType64 -SpecificFolder 'x64' against http://www.zezula.net/download/bellavista_en.zip --- .../helpers/functions/Get-ChocolateyUnzip.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 b/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 index d5ec1751a9..9e5b0f02ed 100644 --- a/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1 @@ -80,17 +80,11 @@ param( [parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments ) $zipfileFullPath=$fileFullPath - if ($specificfolder) { - $fileFullPath=join-path $fileFullPath $specificFolder - } Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters if ($packageName) { $packagelibPath = $env:ChocolateyPackageFolder - if (!(Test-Path -path $packagelibPath)) { - New-Item $packagelibPath -type directory - } $zipFilename=split-path $zipfileFullPath -Leaf $zipExtractLogFullPath= Join-Path $packagelibPath $zipFilename`.txt @@ -122,7 +116,13 @@ param( $destinationNoRedirection = $destination } - $params = "x -aoa -bd -bb1 -o`"$destinationNoRedirection`" -y `"$fileFullPathNoRedirection`"" + if ($specificfolder) { + $params = "x -aoa -bd -bb1 -o`"$destinationNoRedirection`" -y `"$fileFullPathNoRedirection`" `"$specificfolder`"" + } + else + { + $params = "x -aoa -bd -bb1 -o`"$destinationNoRedirection`" -y `"$fileFullPathNoRedirection`"" + } Write-Debug "Executing command ['$7zip' $params]" # Capture 7z's output into a StringBuilder and write it out in blocks, to improve I/O performance.