Skip to content

Commit

Permalink
(GH-51) install should catch unable to move
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Feb 3, 2015
1 parent c469718 commit 8e2ad66
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ param(
$chocoExe = Join-Path $chocolateyPath 'choco.exe'
if (Test-Path ($chocoExe)) {
Write-Debug "Renaming '$chocoExe' to '$chocoExe.old'"
Move-Item $chocoExe "$chocoExe.old" -force
try {
Move-Item $chocoExe "$chocoExe.old" -force
}
catch {
Write-Warning "Was not able to rename `'$chocoExe`' to `'$chocoExe.old`'."
}
}

$chocInstallFolder = Join-Path $thisScriptFolder "chocolateyInstall"
Expand Down

0 comments on commit 8e2ad66

Please sign in to comment.