Skip to content
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 should convert /I to /X for Msi Uninstalls #271

Closed
mrdima opened this issue May 5, 2015 · 8 comments
Closed

AutoUninstaller should convert /I to /X for Msi Uninstalls #271

mrdima opened this issue May 5, 2015 · 8 comments

Comments

@mrdima
Copy link

mrdima commented May 5, 2015

Many MSI's have an uninstallstring of /I{GUID}, including commercial MSI's, and not /X. Seems this is because it also adds the change/repair option if I can believe the story at:
http://stackoverflow.com/questions/10280952/uninstallstring-being-set-with-i-not-x-param
Add/Remove Programs or Programs and Features doesn't have a problem uninstalling those programs, neither should chocolatey.

There's a few issues causing the autoinstaller breaking for us in this case.

  1. It doesn't uninstall properly...see the output below, I would expect it to change /I to /X (and not just remove the / and leave the I). Now you get a popup from msiexec with the usage when the autouninstaller runs!
  2. If uninstall fails, why does chocolatey consider the package removed? I would expect that chocolatey keeps it as installed, which it is...there needs to be some way to force removal in chocolatey but that shouldn't be the default.

Running auto uninstaller...
Preparing uninstall key 'MsiExec.exe /I{50CB48BE-3DDC-4245-9E39-432C903336BE}'
Uninstaller path is 'C:\Windows\system32\MsiExec.exe'
Installer type is 'MsiInstaller'
Args are 'I{50CB48BE-3DDC-4245-9E39-432C903336BE} /qn /norestart '
Calling command ['"C:\Windows\system32\MsiExec.exe" I{50CB48BE-3DDC-4245-9E39-43
2C903336BE} /qn /norestart ']
Command ['"C:\Windows\system32\MsiExec.exe" I{50CB48BE-3DDC-4245-9E39-432C903336
BE} /qn /norestart '] exited with '1639'
Auto uninstaller failed. Please remove machine installation manually.
mypackage uninstall not successful.
Auto uninstaller failed. Please remove machine installation manually.
Removed file 'chocolateyinstall.ps1' to folder 'C:\Management\Programs\Chocolate
y\lib\mypackage\tools'.
Removed folder 'C:\Management\Programs\Chocolatey\lib\mypackage\tools'.
Removed file 'mypackage.nupkg' to folder 'C:\Management\Programs\Chocolatey\lib\mypackage'.
Removed folder 'C:\Management\Programs\Chocolatey\lib\mypackage'.
Successfully uninstalled 'mypackage 2.84'.
mypackage has been successfully uninstalled.

Tested on 0.9.9.5

@mrdima mrdima changed the title autouninstaller doesn't work properly autouninstaller doesn't work properly on msi's May 5, 2015
@ferventcoder
Copy link
Member

This is partially a dupe of #212

@ferventcoder
Copy link
Member

The second thing will need it's own issue.

@ferventcoder
Copy link
Member

We'll also need to ensure that /I gets switched to /X

@ferventcoder ferventcoder changed the title autouninstaller doesn't work properly on msi's AutoUninstaller should convert /I to /X for Msi Uninstalls May 5, 2015
@mrdima
Copy link
Author

mrdima commented May 5, 2015

Changing /I to /X seems to be the most common solution, keeping /I and adding REMOVE=ALL to the string actually does uninstall as well...but I opt for changing /I to /X

@ferventcoder
Copy link
Member

Of note, the autouninstaller is still in preview while we work the kinks out. For uninstalls - you may want to ensure you have a chocolateyUninstall.ps1 in the package as well.

@ferventcoder
Copy link
Member

This is completed and will be released with 0.9.9.6.

ferventcoder added a commit that referenced this issue May 16, 2015
Many times uninstall strings in the registry use /I instead of /X to
allow for repair or modification of the install. However when we want
to silently uninstall the application, we want it to be converted to /X
to ensure that it is removing that application.
@ferventcoder ferventcoder self-assigned this May 16, 2015
ferventcoder added a commit that referenced this issue May 16, 2015
* stable:
  (doc) update changelog / nuspec
  (GH-265) Mention how to auto confirm prompts
  (GH-279) Resolve packages on first feed found
  (maint) formatting
  (GH-271) Replace /I with /X on uninstall
@mrdima
Copy link
Author

mrdima commented May 20, 2015

Awesome, I can confirm this works for me now!

@ferventcoder
Copy link
Member

👍

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

No branches or pull requests

3 participants