-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't find choco.exe
after upgrading Chocolatey CLI using the MSI
#3286
Comments
The Chocolatey CLI MSI is for install only. Upgrades are not supported. The expectation is that you use the MSI to install Chocolatey CLI and then use Chocolatey CLI to upgrade Chocolatey CLI. |
Fair enough. But installing v2.2.0.0 over v2.1.0.0 should then either fail (exitcode != 0), or at least not break Chocolatey, don't you agree? |
I was about to update that previous comment when you replied 😄 I was going to say 'But those missing files doesn't seem right'. |
Ah, yeah I agree. :) It's easy to reproduce, either with Winget or msiexec directly, so it's hopefully possible to figure out what happens. Winget has no way to tell it that a package is not upgradable (as in a whether a newer version can be installed over an older version), as far as I know. I'll create an issue over at |
I confirm those files are missing on the upgrade from 2.1.0 to 2.2.0. The problem also appears going from 2.0.0 to 2.1.0 so this isn't new behaviour. |
The MSI previously included logic to remove *some* Chocolatey files. This would leave Chocolatey in a broken state, but not actually removed. This commit removes the entries from the MSI, so an "uninstall" of the MSI is merely a removal of the installer's entry from Add/Remove Programs.
Currently it's not possible to upgrade Chocolatey with the MSI. This commit adds functionality to the MSI that will error instead of blindly allowing an upgrade that doesn't do anything.
The MSI previously included logic to remove *some* Chocolatey files. This would leave Chocolatey in a broken state, but not actually removed. This commit removes the entries from the MSI, so an "uninstall" of the MSI is merely a removal of the installer's entry from Add/Remove Programs.
Currently it's not possible to upgrade Chocolatey with the MSI. This commit adds functionality to the MSI that will error instead of blindly allowing an upgrade that doesn't do anything.
The MSI previously included logic to remove *some* Chocolatey files. This would leave Chocolatey in a broken state, but not actually removed. This commit removes the entries from the MSI, so an "uninstall" of the MSI is merely a removal of the installer's entry from Add/Remove Programs.
Currently it's not possible to upgrade Chocolatey with the MSI. This commit adds functionality to the MSI that will error instead of blindly allowing an upgrade that doesn't do anything.
/quiet /norestart
choco.exe
after upgrading Chocolatey CLI using the MSI
🎉 This issue has been resolved in version 2.2.1 🎉 The release is available on: Your GitReleaseManager bot 📦🚀 |
Checklist
What You Are Seeing?
Seems upgrading Chocolatey with MSI breaks Chocolatey.
Installing Chocolatey with MSI using Winget =>
choco outdated
from CMD works fine.winget install --silent --id Chocolatey.Chocolatey --version 2.1.0
Upgrading Chocolatey with MSI using Winget =>
choco outdated
from CMD givesCannot find file at '../choco.exe' (C:\ProgramData\chocolatey\choco.exe). This usually indicates a missing or moved file.
.winget upgrade --silent --id Chocolatey.Chocolatey
What is Expected?
Chocolatey example command
choco outdated
should work just fine after upgrading Chocolatey with Winget / MSI.How Did You Get This To Happen?
Start fresh
Uninstall Chocolatey if present. Manually remove the directory
%ProgramData%\chocolatey
and environment variableChocolateyLastPathUpdate
which the MSI uninstaller leaves behind. And remove%ProgramData%\chocolatey\bin
from the PATH environment variable.Install a version of Chocolatey that can be upgraded.
From Winget logs I see that
chocolatey-2.1.0.0.msi
was installed with/quiet /norestart
.%ProgramData%\chocolatey
after installer is done.Test that choco works from CMD
Open a new CMD window, to get the changes in environmental variables after the installer finished.
Upgrade Chocolatey with Winget
From Winget logs I see that
chocolatey-2.2.0.0.msi
was installed with/quiet /norestart
.%ProgramData%\chocolatey
after installer is done:Test that choco works from CMD
Open a new CMD
System Details
Installed Packages
Output Log
Additional Context
No response
The text was updated successfully, but these errors were encountered: