alienator88 / Pearcleaner

A free, source-available and fair-code licensed mac app cleaner
https://itsalin.com/appInfo/?id=pearcleaner
Other
745 stars 18 forks source link

[BUG] App update doesn't work for non-admin users #38

Closed makoni closed 3 months ago

makoni commented 3 months ago

Describe the bug

Hi, thanks for the great app. I found that when the app tries to install an update after downloading it fails. The app in Applications folder has zero size.

I've tried on 2 different Macs running macOS 14.4.

Also it would be great it the app would be notarized so macOS wouldn't show you too many dialogs :)

To Reproduce Steps to reproduce the behavior:

  1. Install an old app version.
  2. Create a Standard macOS user account in System Settings -> Users & Groups
  3. Log in into that account
  4. Launch the app. It will tell about an update available
  5. Update the app. After clicking on restart button it doesn't relaunch and has zero size in Applications folder

Expected behavior

Update works

Desktop (please complete the following information):

Screenshots

Screenshot 2024-03-22 at 13 30 44

Additional context

alienator88 commented 3 months ago

Hey, thanks for submitting this. Does this only happen with non-admin user accounts from what you can tell? I can do some testing to see how it works on my end with a new profile as well.

As far as notarizing, I can't justify spending $100/year(yet) for a dev account when I just do this for fun/learning 😂. Usually right click and open the app the first time will normally whitelist it so gatekeeper doesn't complain.

alienator88 commented 3 months ago

Actually scratch that, I was able to reproduce it in my VM with a non-admin account. If you're a non-admin user and you put the app in the /Applications folder, it asks you for the password of an admin user to put it there. When you launch the app from there as the regular non-admin user, it has no privileges to update the app in place since you're not the admin who put the app there.

The usual spot non-admin users put apps is in their user Applications folder at /Users/USERNAME/Applications, instead of /Applications. If that folder doesn't exist, you can just create it and it will add the Applications icon over the folder automatically. This folder won't require any special permissions.

I just tested that out and it updated fine with non-user account. I will need to make some adjustments to the updater anyways though. Maybe I'll add a user type check to notify you that upgrading won't work as a non-admin user from the system Applications folder and to put the app in the user Applications folder instead.

Unfortunately there's nothing I can do about this, it's just how macOS accounts and security work.