chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.24k stars 896 forks source link

AutoUninstaller: captures registry snapshot for all previous installs in same run #1499

Open miyoyo opened 6 years ago

miyoyo commented 6 years ago

What You Are Seeing?

Uninstalling one failed upgraded package (golang) makes the auto-uninstaller remove other packages that have nothing in common (Visual Studio Code, ConEmu), but it doesn't update the package list, so they appear as already installed

What is Expected?

Golang is removed, nothing else is affected

(And if the auto-uninstaller has to remove another package, update the package list)

How Did You Get This To Happen? (Steps to Reproduce)

Install golang 1.9 Upgrade golang, fail because unzipping takes too long Try to uninstall golang, end up losing visual studio code and ConEmu Try to reinstall visual studio code without --force, and choco reports it as installed

Output Log

Upgrade - https://gist.github.com/miyoyo/96e012ce3a391c3a53e7771d811ecaff Uninstall golang - https://gist.github.com/miyoyo/09e547a968807f964e73ebb7ff4f4ac2 Install golang, visualstudiocode - https://gist.github.com/miyoyo/eb5bfb049f4e2765327851691d095441

ferventcoder commented 6 years ago

So as long as you are not running things together, this shouldn't happen. What I think is occurring though, is that the registry snapshot is not getting cleared. That could potentially cause some big issues at uninstall time with auto uninstaller.

ferventcoder commented 6 years ago

@miyoyo to adjust your terminology (which will better help you understand Chocolatey) - in Chocolatey-speak a package is a nupkg file only. Some packages manage software installations into Programs and Features, those are called installer packages. Read more at https://chocolatey.org/docs/getting-started#terminology.

As you are noticing, there can be a disconnect when the software is uninstalled or the package is removed and the other is not. So the note of updating the package list is technically correct, the packages are still installed even if the software has been uninstalled.

NOTE: Auto-sync in commercial editions fixes this as it allows Chocolatey to do more than a package manager, and see changes happening outside of Chocolatey (or in this case because of a bug in Chocolatey) to fix them, which would have removed the packages where the software was uninstalled.