-
Notifications
You must be signed in to change notification settings - Fork 342
[Enhancement] Support Uninstalls #6
Comments
I just saw this. Precisely what I was thinking on the google board. Are there challenges you see with this, because I think I can build something around this pretty easily. I haven't worked with nuget long (or chocolatey more than a few days), but maybe this should ultimately address dependencies in nuspec. Like force removal, manual step through dependencies, or just the singleton specified. |
I should have a pull request by Tues for uninstall sometime this weekend. Just got it working! Awesomeness |
make it cuninst as the shortcut. Folks have expressed issues with the cunst (too close to another word) |
If there is only one version, it shouldn't prompt. |
Dependencies are not removed right now. That could get very tricky as multiple items in the repo could depend on the same package (application really) to be installed. Plus the dependency may not be a runtime dependency, only an install dependency. Consider ruby.devkit - it has dependencies on 7zip.commandline and ruby. Ruby is the hard dependency, 7zip is only so it can unpack the files. Which dependency would you remove? The proper answer is probably neither as I might still want ruby around. Thoughts? |
Agree on name for obvious reasons. |
Maybe as a first step, just tell people what the dependencies are so that they can remove manually... |
IIRC apt-get / aptitude has a special flag that marks a package as "installed as dependency" vs. "installed by a user". Dependencies would automatically be removed, once no other package requires its presence anymore. The flag will be turned into a "installed by user", if the user "installs" the package the normal way (i.e. not as a dependeny). I do think, chocolatey should (at some point) do it very similarly. right now, i think, uninstalling one package (just that one specified package) would be fine, too. |
Does chocolatey even know about dependencies or is this purely a nuget construct? |
IMHO the ideal uninstall command would remove the package XYZ and all packages that exist only in XYZ's dependency graph. If this is too complex or (from the end-user's perspective) too expensive, removing no dependencies is probably the way to go. The downside is that you could easily end up w/ a bloated system if you install/uninstall a lot. In that case, you might want some sort of "orphan-finding" command that will find orphaned packages. That said, it brings back the notion of a package being user-chosen vs. just a dependency, because otherwise every non-dependent package will show up as an orphan. |
strictly nuget handling for now- @ferventcoder https://github.com/chocolatey/chocolatey/blob/master/src/functions/Chocolatey-NuGet.ps1#26 is each $line here the packages and dependencies returned by nuget? We can check if $line is not match for $packagename (therefore it must be a dependency) to place a flag in \lib$dependency, like dependency_of.XYZ.ver That's trivial. The uninstaller then needs to do what? We instead save $nugetOutput L24 to \lib$packagefolder and reparse it at uninstall time. Further we can make L 29+ we can make it install/uninstall agnostic. |
👍 |
I think this is done-ish. New tickets will get added to choco regarding plussing up autouninstaller and registry name going into chocopackages. |
cuninst somepackage
gives the user a choice of what to remove
cuninst somepackage -version 1.23
removes just that version
This would reroute the batch link to the most up to date version. If there are no more versions, delete the batch file.
Look to see if there is an chocolateyUninstall.ps1 file. This file could actually remove applications from the computer. Of course the uninstaller would need to look at the version installed before running the uninstaller in case someone has upgraded.
Uninstall-ChocolateyPackage $packageName $possiblePathsToUninstaller
This may need helpers for the version
A link to help this idea: http://www.appdeploy.com/software/detail.asp?id=266176
Remove the stuff from lib folder as well.
The text was updated successfully, but these errors were encountered: