Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

[Enhancement] Support Uninstalls #6

Closed
ferventcoder opened this issue Sep 10, 2011 · 14 comments
Closed

[Enhancement] Support Uninstalls #6

ferventcoder opened this issue Sep 10, 2011 · 14 comments

Comments

@ferventcoder
Copy link
Contributor

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.

@rismoney
Copy link
Contributor

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.

@rismoney
Copy link
Contributor

I should have a pull request by Tues for uninstall sometime this weekend. Just got it working! Awesomeness

@ferventcoder
Copy link
Contributor Author

make it cuninst as the shortcut. Folks have expressed issues with the cunst (too close to another word)

@ferventcoder
Copy link
Contributor Author

If there is only one version, it shouldn't prompt.

@ferventcoder
Copy link
Contributor Author

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?

@rismoney
Copy link
Contributor

Agree on name for obvious reasons.
I am not up to dependencies. Have a few ideas, but all rely on persisting a dependency.file in some form. Only until last dependency is removed can underlying be removed, unless forced.
Agree on not prompting

@mika76
Copy link

mika76 commented May 28, 2012

Maybe as a first step, just tell people what the dependencies are so that they can remove manually...

@ccoenen
Copy link

ccoenen commented Feb 17, 2013

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.

@rismoney
Copy link
Contributor

Does chocolatey even know about dependencies or is this purely a nuget construct?

@smarts
Copy link

smarts commented Mar 12, 2013

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.

@rismoney
Copy link
Contributor

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.

@rryk
Copy link

rryk commented Nov 28, 2013

👍

@ferventcoder
Copy link
Contributor Author

#389 & #295
#187

@ferventcoder
Copy link
Contributor Author

I think this is done-ish. New tickets will get added to choco regarding plussing up autouninstaller and registry name going into chocopackages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants