Skip to content

[bug] [macOs] Tauri updater fails with "Tauri API error: Permission Denied (os error 13)" for standard (non-admin) users #8104

@0rvar

Description

@0rvar

Describe the bug

The built in Tauri updater (and the official updater plugin for v2) fails with a cryptic error message for "Standard" users, meaning users that are not administrators on their Mac.

Reproduction

Screen.Recording.2023-10-25.at.13.50.01.mp4
  1. Create and login to a standard user on mac (not an administrator user).
  2. Download the next-newest version from https://github.com/spacedriveapp/spacedrive/releases (or any other popular tauri app)
  3. Install the app to /Applications, type in an administrator username and password when prompted by the OS
  4. Run the app and accept the update prompt
  5. Updater fails with "Tauri API error: Permission Denied (os error 13)"

Expected behavior

The scenario should be a first-class citizen, first of all - less cryptic error message, documented.

I have a working, semi tested version of the updater function for mac (#[cfg(target_os = "macos")] fn copy_files_and_run) here:
0rvar@7c74051

Let me know if I should create a signed PR with this approach.

It prompts for elevated privileges if needed using Applescript. There are other approaches as well:

  • Using security_AuthorizationExecuteWithPrivileges, but this has been deprecated for a very long time
  • Using SMJobless. No idea how that works

Platform and versions

Mac, any version

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions