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

Bug: Unable to uninstall Chrome (except as admin) (winget version) #198

Closed
ppvnf opened this issue Oct 4, 2022 · 16 comments
Closed

Bug: Unable to uninstall Chrome (except as admin) (winget version) #198

ppvnf opened this issue Oct 4, 2022 · 16 comments
Labels
bug Something isn't working ready-to-go

Comments

@ppvnf
Copy link
Contributor

ppvnf commented Oct 4, 2022

Uninstalling as admin works. It's also possible to uninstall it using unelevated Powershell (this issue also applies to Chrome dev, beta, etc.):

Captura de tela 2022-10-04 101953
Captura de tela 2022-10-04 135222

I believe the scoop version isn't affected by this.

@marticliment marticliment added bug Something isn't working needs-further-study labels Oct 4, 2022
@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 4, 2022

I did a few tests. Updating is working and interactive uninstall is also working, however WingetUI is detecting the package (at least for Chrome dev) as not being installed by Winget, which is false as you can see it the shell:

Captura de tela 2022-10-04 154406

@marticliment
Copy link
Owner

as not being installed by Winget, which is false as you can see it the shell

However, this won't change the uninstall command (local pc and winget are handled in the same way)

@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 5, 2022

as not being installed by Winget, which is false as you can see it the shell

However, this won't change the uninstall command (local pc and winget are handled in the same way)

I see... I thought not being able to uninstall was because of the package not being correctly identified by Winget. I just remembered that I had the same problem with Microsoft Visual C++ Redistributable packages a few days ago. I believe the cause was the manifests being changed. I am gonna open a new one not bloat this one, but feel free to unify them if you wish.

@marticliment
Copy link
Owner

What would happen if you ran winget uninstall --id Google.Chrome -e --silent?

@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 6, 2022

What would happen if you ran winget uninstall --id Google.Chrome -e --silent?

I am also getting error 1603 on Winget-cli. So, this isn't a problem with WingetUI after all?
What about as a workaround automatically trying to uninstall without silent parameter when this error appears?

@marticliment
Copy link
Owner

I don't think.

What i suspect is happening is that the --silent flag in winget prevents msi installers (chrome and some older vcredist) from showing the UAC prompt, failing with oc 1603. Running as admin already gratns needed provoleges so it works ok.

I reckon this is an issue with winget-cli, though

@marticliment
Copy link
Owner

I can try to create some kind of fallback, that when uninstalls fail they'll be ran without the --silent flag, what do you think?

@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 6, 2022

I can try to create some kind of fallback, that when uninstalls fail they'll be ran without the --silent flag, what do you think?

I don't see any downside for doing that

@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 7, 2022

There's an issue about this error on microsoft/winget-cli#248, but it's about installs and not related to Chrome so I am gonna open a new one

@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 7, 2022

I've just tested winget uninstall --id Google.Chrome -e --silent today and somehow it worked fine on Winget-CLI, but WingetUI still fails with error 1603

@marticliment
Copy link
Owner

can you please test that same command but with the winget versio bundled in WingetUI? %localappdata%\programs\WingetUI\winget-cli\winget.exe

@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 7, 2022

can you please test that same command but with the winget versio bundled in WingetUI? %localappdata%\programs\WingetUI\winget-cli\winget.exe

Never mind, I think I accidentally opened Powershell as admin before. I've tried again and winget uninstall --id Google.Chrome -e --silent fails on both bundled and system PowerShell. I've opened an issue about this there: microsoft/winget-pkgs#82692
I believe this is a good idea. It would be even better if Microsoft implemented it on Winget-cli though

@ppvnf
Copy link
Contributor Author

ppvnf commented Oct 14, 2022

I got an answer here:

One of our key design criteria has been supporting "unattended" installations to support things like winget import packages.json. We might consider a fallback approach to "non-silent" installs once we have some user driven settings or arguments to allow users to select that behavior.

@marticliment
Copy link
Owner

Well, they are not going to fix it, we'll need to do it ourselves.

@marticliment
Copy link
Owner

Fixed!

@marticliment
Copy link
Owner

Now when the error occurs it immediately re-runs the uninstall command with administrator rights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-to-go
Projects
None yet
Development

No branches or pull requests

2 participants