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

Feature uninstall #96

Closed
wants to merge 16 commits into from

Conversation

rismoney
Copy link
Contributor

This will provide preliminary uninstall functionality. It does require pull 92 and 94 to return versions properly.

This is not a feature rich implementation yet. A refactoring needs to happen and code reuse, since install and uninstall should leverage the same code base with just some easy param logic.

A file called chocolateyuninstall.ps1 will need to exist in the tools folder for packages for this to work.

The contents should look like this
Uninstall-ChocolateyPackage 'windirstat1.1.2.1' 'exe' '/S' 'C:\Program Files (x86)\WinDirStat\Uninstall.exe'

@ferventcoder
Copy link
Contributor

This is a good start. Very highly appreciated!!!

@ferventcoder
Copy link
Contributor

We'll have to figure out the uninstall path (I was thinking hints to program files locations [x86 versus not] for the longest time) for the most common scenarios.

@rismoney
Copy link
Contributor Author

I think by default if no uninstall path is provided, it tries to find it automatically perhaps via reglookup or similar wmi query.

2 relevant links
http://community.spiceworks.com/how_to/show/2238
http://www.vbforums.com/showthread.php?t=598355

$overrideArguments = $env:chocolateyInstallOverride;

if ($fileType -like 'msi') {
$msiArgs = "/x `"$file`""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i need to fix this line because no file name is specified for uninstalling an msi. it should just be $msiArgs = "/x"

right now this version requires obtain a guid from a call like:
Get-WmiObject -Class Win32_Product |Where-Object {$_.Name -like "Notepad*"}

i'd like to fix this in a separate release with a helper so that you can either specify a guid if you know it, or have it try to find one based on a wmi call like the one above.

Win32Reg_AddRemovePrograms might be faster...not sure if every machine has that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I was thinking the GUID because you can search for the installed application as well

@ferventcoder
Copy link
Contributor

This is in. Please delete your branch and pull from there to work on additional pieces...

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

Successfully merging this pull request may close these issues.

None yet

2 participants