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] MAS Uninstall #190

Closed
gkrawiec opened this issue Jan 16, 2025 · 12 comments
Closed

[BUG] MAS Uninstall #190

gkrawiec opened this issue Jan 16, 2025 · 12 comments

Comments

@gkrawiec
Copy link

Describe the bug:

I used pearcleaner to uninstall "VyprVPN" which is a MacAppStore app, but which was originally installed using hombrew MAS.
The uninstallation completed, but homebrew cask still believed it was installed. I thought you had solved this issue before, but maybe it was only on brew installed apps and not brew MAS apps?

https://github.com/mas-cli/mas

thank you.

@alienator88
Copy link
Owner

I'm not sure they are related.

If you have homebrew cleanup enabled, it will attempt to run these commands after uninstall to let homebrew know that the app was removed by something outside of the homebrew system:

brew uninstall --cask APPNAME --zap --force
brew cleanup

If MAS doesn't use that same uninstall mechanism, Pearcleaner wouldn't be able to uninstall it.
From what I see looking at the mas repo, it has it's own uninstall function built-in.

@alienator88 alienator88 changed the title [BUG] ENTER ISSUE TITLE HERE [BUG] MAS Uninstall Jan 16, 2025
@gkrawiec
Copy link
Author

brew cleanup was enabled when I uninstalled.
that command you wrote brew uninstall --cask APPNAME --zap --force is the command
I ran afterwards to "fix" the problem.

@alienator88
Copy link
Owner

I figured out the issue, it's because when I look for the cask identifier in the Caskroom directory, it would take the first .app bundle in the folder.
VyprVPN has 2 .app bundles and one is called Uninstall VyprVPN.app which came first before the actual VyprVPN.app bundle. Therefore it couldn't match the app name with the cask identifier correctly. I added some logic to exclude bundles with "uninstall" in the name.

Can you test this debug build and see if you still have issues?

Pearcleaner.zip

@gkrawiec
Copy link
Author

I just tested twice and it seems it did NOT work. Brew still believes vyprvpn is installed

I figured out the issue, it's because when I look for the cask identifier in the Caskroom directory, it would take the first .app bundle in the folder. VyprVPN has 2 .app bundles and one is called Uninstall VyprVPN.app which came first before the actual VyprVPN.app bundle. Therefore it couldn't match the app name with the cask identifier correctly. I added some logic to exclude bundles with "uninstall" in the name.

Can you test this debug build and see if you still have issues?

Pearcleaner.zip

@alienator88
Copy link
Owner

That's odd..I was seeing the issue you're describing before, but now after I applied this fix it worked and ran the cleanup in the terminal as expected.

If you go to this folder, what files do you see in there?
/opt/homebrew/Caskroom/vyprvpn/5.2.4.10748
That path is for apple silicon, if you have intel, it would be:
/usr/local/Caskroom/vyprvpn/5.2.4.10748

@alienator88
Copy link
Owner

Forgot to mention, right before clicking the Uninstall button in Pearcleaner, push CMD+D to open the debug window.
I'm curious if it says it can't find the cask as the error.

@gkrawiec
Copy link
Author

I tested following your new instructions.

  1. pearcleaner claims it deleted the app and no longer finds it in its search and neither does raycast search (it is not in the applications folder)
  2. the console logs are empty "No logs available to view" even after the uninstall using pearcleaner (the log window was open before I pressed the red delete button in pearcleaner)
  3. under the path you provided I see 2 apps. VyprVPN.app and Uninstall VyperVPN.app

hope this helps.

@alienator88
Copy link
Owner

Thanks for that.
How do you check on your end that the app is still seen as installed by mas or brew?

@gkrawiec
Copy link
Author

I run a brewfile install. Since it thinks it is still installed, it does NOT install it. Then I run the commands
brew uninstall --cask vyprvpn --zap --force
and then again brewfile install
brew bundle --file="~/Brewfile.txt"
and only then will it install it

Thanks for that. How do you check on your end that the app is still seen as installed by mas or brew?

@alienator88
Copy link
Owner

Man, I'm having a hard time reproducing your issue now after I added that fix 😂
Here's a video of me uninstalling the app and then Terminal pops up to cleanup the brew stuff.

Screen.Recording.2025-01-17.at.12.26.38.PM.mp4

And you used the Debug build of Pearcleaner I attached before? It says "DEBUG" at the top let of the app like it does in my video?

@gkrawiec
Copy link
Author

SORRY SORRY SORRY....yes, I am using the debug version, but in this version I forgot to activate brew cleanup in settings. I just remembered that when I saw your video.
Once I activated it it worked perfectly.
Again my apologies.
You can close this issue. The fix on the debug version works.
thank you

@alienator88
Copy link
Owner

Oh good, I'm glad we could get it sorted! It happens 😂
I'll have the fix out in the next release.

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

No branches or pull requests

2 participants