diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyInstallPackage.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyInstallPackage.ps1 index 66cb094ef7..7956ee9ebc 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyInstallPackage.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyInstallPackage.ps1 @@ -202,9 +202,13 @@ 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 + } $workingDirectory = Get-Location try {