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

MSIexec syntax - auto uninstall #438

Closed
AeliusSaionji opened this issue Sep 30, 2015 · 14 comments
Closed

MSIexec syntax - auto uninstall #438

AeliusSaionji opened this issue Sep 30, 2015 · 14 comments

Comments

@AeliusSaionji
Copy link

Uninstall-ChocolateyPackage calls msiexec in this fashion:
[ERROR] Running msiexec with /x {DF3A46D9-67B3-44B2-9D01-25C8BA772C8A} /qn /norestart was not successful. Exit code was '1603'

On my machine, msiexec will not run with this syntax. Registry entries have shown me the correct UninstallString:

  1. There can be no space between /X and the msiguid- on my PC (Windows 10) it needs to be msiexec "/x{DF3A46D9-67B3-44B2-9D01-25C8BA772C8A}"
  2. The guid must be enclosed in quotations, separate from other switches.

By calling msiexec directly from the command line, I've determined that the full working command is msiexec "/x{DF3A46D9-67B3-44B2-9D01-25C8BA772C8A}" /qn /norestart

Here's the relevant error from the log, which indicates this might be related to me running a user account (mentioned here #434)

 [ERROR] Running msiexec with /x {DF3A46D9-67B3-44B2-9D01-25C8BA772C8A} /qn /norestart  was not successful. Exit code was '1603' Error Message:
 .
 At C:\ProgramData\chocolatey\helpers\functions\Start-ChocolateyProcessAsAdmin.ps1:92 char:5
 +     throw $errorMessage
 +     ~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : OperationStopped: ([ERROR] Running...or Message:
 .:String) [], RuntimeException
     + FullyQualifiedErrorId : [ERROR] Running msiexec with /x {DF3A46D9-67B3-44B2-9D01-25C8BA772C8A} /qn /norestart  was not successful. Exit code was '1603' Error Message:
paint.net uninstall not successful.
 .
Error while running 'C:\ProgramData\chocolatey\lib\paint.net\tools\chocolateyuninstall.ps1'.
 See log for details.
paint.net not uninstalled. An error occurred during uninstall:
 paint.net uninstall not successful.
@AeliusSaionji AeliusSaionji changed the title MSIexec synxtax MSIexec syntax Sep 30, 2015
@AeliusSaionji
Copy link
Author

OK, I don't know why but 2) is not strictly necessary. In fact, when using Start-Process, if you try 2) it will not work.

Edit- here's what works in an uninstaller script

$msiProductCodeGuid = '{DF3A46D9-67B3-44B2-9D01-25C8BA772C8A}'
$silentArgs = "$msiProductCodeGuid /qn /norestart"
Start-Process -FilePath 'msiexec.exe' -ArgumentList "/X$silentArgs" -Verb RunAs

@ferventcoder
Copy link
Member

Windows 10 as well here?

@AeliusSaionji
Copy link
Author

Yep

@ferventcoder
Copy link
Member

Do me a favor. Flip on autouninstaller and see if it behaves correctly without an uninstall script.

choco feature enable -n autouninstaller

@AeliusSaionji
Copy link
Author

Skipping auto uninstaller - No registry snapshot.
Is there something I can do to get a registry snapshot?

@ferventcoder
Copy link
Member

Yes, install it with at least it installing a different version that what is already installed. You may need to uninstall it manually first if the versions match.

@AeliusSaionji
Copy link
Author

paint.net v4.0.6
 Running auto uninstaller...
Sleeping for 2 seconds to allow Windows to finish cleaning up.
 Preparing uninstall key 'MsiExec.exe /X{DF3A46D9-67B3-44B2-9D01-25C8BA772C8A}'
 Uninstaller path is 'MsiExec.exe'
 Installer type is 'MsiInstaller'
 Setting up uninstall logging directory at C:\Users\Link\AppData\Local\Temp\chocolatey\paint.net\4.0.6
 Args are ' /X{DF3A46D9-67B3-44B2-9D01-25C8BA772C8A} /qn /norestart '
Calling command ['"MsiExec.exe" /X{DF3A46D9-67B3-44B2-9D01-25C8BA772C8A} /qn /norestart']
Command ['"MsiExec.exe" /X{DF3A46D9-67B3-44B2-9D01-25C8BA772C8A} /qn /norestart'] exited with '1603'
 Auto uninstaller failed. Please remove machine installation manually.
 Exit code was 1603

The auto uninstaller works when run from an administrative powershell. Otherwise, this is the result.

@ferventcoder
Copy link
Member

Interesting. SO quotes are necessary then??!

@ferventcoder
Copy link
Member

Oh, wait. ALWAYS run choco from administrative command shells. Unless you've installed it somewhere specific that doesn't require admin permissions to write to.

@AeliusSaionji
Copy link
Author

ALWAYS run choco from administrative command shells

I've followed this advice and run into a fundamental problem- look at the chromium package. It installs into %APPDATA%, and is therefore entirely inaccessible to my user account.

@ferventcoder ferventcoder added this to the 0.9.10 milestone Jan 11, 2016
@ferventcoder ferventcoder changed the title MSIexec syntax MSIexec syntax - auto uninstall Jan 30, 2016
@ferventcoder ferventcoder modified the milestones: 0.9.10, 0.9.10.1 May 1, 2016
@ferventcoder ferventcoder modified the milestones: 0.9.10.1, 0.9.10.2, 0.9.10.3 Jun 17, 2016
@ferventcoder ferventcoder modified the milestones: 0.10.4, 0.10.5 Jan 6, 2017
@ferventcoder ferventcoder modified the milestones: 0.10.5, 0.10.6, 0.10.7 Mar 30, 2017
@ferventcoder ferventcoder modified the milestones: 0.10.7, 0.10.8 Jun 6, 2017
@pauby
Copy link
Member

pauby commented Feb 2, 2024

I'm unsure what we need to do here given the comment above. It feels like Chocolatey CLI is being used in a non-admin context, which is causing the issue.

This is 8 and a half years old at this point but I'll ask - @AeliusSaionji can you provide any more information here?

@AeliusSaionji
Copy link
Author

I have no memory of this, unfortunately.

Seems possible that this could affect portable choco installs, which are definitionally non-admin.

Copy link

github-actions bot commented Mar 6, 2024

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue will be closed in 14 days if it continues to be inactive.

@github-actions github-actions bot added the Pending Closure This issue has been marked as having no response or is stale and will soon be closed. label Mar 6, 2024
Copy link

Dear contributor,

As this issue seems to have been inactive for quite some time now, it has been automatically closed.
If you feel this is a valid issue, please feel free to re-open the issue if / when a pull request
has been added.
Thank you for your contribution.

@pauby pauby removed Bug 0 - Waiting on User Pending Closure This issue has been marked as having no response or is stale and will soon be closed. labels Mar 20, 2024
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