choco icon indicating copy to clipboard operation
choco copied to clipboard

If ChocolateyPath is set incorrectly, updating to 0.9.9+ fails

Open chucker opened this issue 10 years ago • 0 comments

In my setup, the environment was set as follows (I'm not sure why):

ChocolateyInstall=C:\ProgramData\chocolatey // machine-level
ChocolateyPath=C:\Chocolatey // user-level

However, Chocolatey was always in %programdata%, so the second var was never correct. This wasn't a problem during the 0.9.9.x upgrades, but the update to 0.9.10-alpha1 (20150725) will try to remove what it believes to be the old path:

Attempting to upgrade 'C:\Chocolatey' to 'C:\ProgramData\chocolatey'.
 WARNING: Copying the contents of 'C:\Chocolatey' to 'C:\ProgramData\chocolatey'.
  This step may fail if you have anything in this folder running or locked.
 If it fails, just manually copy the rest of the items out and then delete the folder.
 !!!! ATTN: YOU WILL NEED TO CLOSE AND REOPEN YOUR SHELL !!!!
 Copy-Item : Cannot find path 'C:\Chocolatey\lib' because it does not exist.
 At C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateysetup.psm1:223 char:5
 +     Copy-Item "$chocolateyPathOld\lib\*" "$chocolateyPath\lib" -force ...
 +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : ObjectNotFound: (C:\Chocolatey\lib:String) [Copy-Item], ItemNotFoundException
     + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

Removing the ChocolateyPath variable apparently makes Chocolatey fall back to the (correctly set) ChocolateyInstall variable.

chucker avatar Jul 28 '15 14:07 chucker