-
Notifications
You must be signed in to change notification settings - Fork 905
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
AutoUninstaller - opt-out from packages #1257
Comments
That may break existing workflows that use the uninstall script to do other things (like remove/cleanup files) and rely on autouninstaller to remove the application. So option 1 is out.
This is likely the only way to handle this. |
Given there has been discussion on this before, I'm a bit surprised this doesn't already exist as an issue. |
I'm trying to package MATLAB and it seems to, even with the installer, leave itself partially installed. However, this isn't a problem (except for maybe it would be nice to have it removed from Programs and Features), so I agree that a package should be able to not run the autouninstaller if it has special cases |
This may eventually find its way into the nuspec, but for now, just drop a |
This seems useful especially as a tweak when you know the autouninstall won't find anything, i.e. all portable packages. Recommended location? Tools? |
Previously, AutoUninstaller alone made decisions on whether it should run based on the state of the uninstall script and environmental information surrounding it. In some cases, packages should have the ability to opt out of having Automatic Uninstaller from attempting to remove any files. Allow a package to contain a `.skipAutoUninstall` file to skip using Automatic Uninstaller.
* stable: (chocolateyGH-1386) Default Template - Overall help and todo (chocolateyGH-1257) AutoUninstaller: package opt-out (maint) tab - add pro list options (chocolateyGH-1383) Fix - no pkg args cause "value cannot be null" (chocolateyGH-1385) Template - do not treat binary as text file (maint) typo (maint) Do not package pdb w/exe (doc) update generated docs
@bcurran3 - for portables, it would be superfluous as portables never even run through this autouninstaller code. |
So you're saying that if an installer didn't run and the registry didn't get changed, the autouninstaller doesn't try to run? i.e. "Skipping auto uninstaller - No registry snapshot." - got it. |
Basically the above yes. 👍 choco/src/chocolatey/infrastructure.app/services/AutomaticUninstallerService.cs Lines 61 to 77 in abead50
|
Just as a side note to someone passing by. This file ( |
Additions for searchability: ".skipAutoUninstall", ".skipAutoUninstaller", ".skip", "autoUninstaller", "skip auto uninstall" |
@wget not in the tools directory, you just have to make sure that the nuspec "files" element accounts for the file. The tools directory is the default in the files element for the nuspec, so that's why it appears so. |
@ferventcoder Thanks for the clarification ;) |
Commit Notes: Add a
.skipAutoUninstall
and Chocolatey v0.10.8+ will automatically opt out of calling the Auto Uninstaller.Original Comments
Currently, the AutoUninstaller always runs, regardless of whether the package contains
chocolateyUninstall.ps1
or not. For many packages this is harmless. There are some packages, however, where the AutoUninstaller may break other applications. This will happen if a native installer installed a shared component, which is still needed even after uninstalling the package which originally installed it.Here is a concrete example.
Each of the Visual Studio 2017 product packages (
visualstudio2017professional
,visualstudio2017buildtools
and othervisualstudio2017xyz
packages) downloads and executes the Visual Studio setup bootstrapper, which performs the following actions:Therefore, the first installed Visual Studio product will install the Visual Studio Installer and all subsequent VS products will add themselves to the existing VS Installer instance.
Uninstalling the VS Installer removes all VS 2017 products installed on the machine. Because of that, the
chocolateyUninstall.ps1
scripts of VS 2017 product packages only invoke the VS Installer, telling it to uninstall the specific VS product. Uninstallation of the VS Installer is handled by a separate package,visualstudio2017-installer
, which is a dependency of all VS 2017 product packages.There is no documented way of installing just the VS Installer itself, so
visualstudio2017-installer
cannot do it and the Installer gets installed by the first installed VS 2017 product package. The Installer appears in Programs and Features and Chocolatey records that fact for the VS product package. Now, when the product package is uninstalled, its uninstall script leaves the VS Installer intact (because other VS product packages may require it), but the AutoUninstaller "helpfully" proceeds to uninstall it, removing all other VS products present on the machine. (This is slightly mitigated by the fact that Chocolatey does not recognize the uninstaller type and asks the user for permission to proceed, but most users will probably agree.)I see two solutions:
chocolateyUninstall.ps1
,chocolateyUninstall.ps1
).The text was updated successfully, but these errors were encountered: