diff --git a/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 b/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 index 8994481dc2..39ee23dbd3 100644 --- a/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 +++ b/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 @@ -22,6 +22,7 @@ $Note = "Green" $version = $env:packageVersion $packageName = $env:packageName +$packageVersion = $env:packageVersion $packageFolder = $env:packageFolder $helpersPath = (Split-Path -parent $MyInvocation.MyCommand.Definition); diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyPackage.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyPackage.ps1 index c17fd1ab9a..bdda266f28 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyPackage.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyPackage.ps1 @@ -85,6 +85,7 @@ param( $chocTempDir = Join-Path $env:TEMP "chocolatey" $tempDir = Join-Path $chocTempDir "$packageName" + if ($env:packageVersion -ne $null) {$tempDir = Join-Path $tempDir "$env:packageVersion"; } if (![System.IO.Directory]::Exists($tempDir)) { [System.IO.Directory]::CreateDirectory($tempDir) | Out-Null } $file = Join-Path $tempDir "$($packageName)Install.$fileType" diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 index 6b7e2caf58..87d3543345 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 @@ -76,6 +76,8 @@ param( $chocTempDir = Join-Path $env:TEMP "chocolatey" $tempDir = Join-Path $chocTempDir "$packageName" + if ($env:packageVersion -ne $null) {$tempDir = Join-Path $tempDir "$env:packageVersion"; } + if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir) | Out-Null} $file = Join-Path $tempDir "$($packageName)Install.$fileType"