From 56bf25cedd9dd9cae4594c3b96f4d8e3fd144199 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 22 Sep 2016 10:55:24 -0500 Subject: [PATCH] (GH-969) Remove double choco folder if file exists Only remove the file path from the double chocolatey folder in the temp directory when a file exists at that location. --- .../helpers/functions/Install-ChocolateyInstallPackage.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 {