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

[question] When calling the relaunch method of the plugin-process, I encounter the error “Operation not permitted (os error 1).” Could you help me find a solution? #2273

Open
miro-ring opened this issue Jan 7, 2025 · 1 comment
Labels
bug Something isn't working platform: macos macOS specific issues plugin: process plugin: updater

Comments

@miro-ring
Copy link

miro-ring commented Jan 7, 2025

// src-tauri/capabilities/main.json
{
    // ...
    "updater:default",
    "updater:allow-check",
    "updater:allow-download",
    "updater:allow-install",
    "updater:allow-download-and-install",
    "process:default",
    "process:allow-restart",
    "dialog:default"
}
import { ask } from '@tauri-apps/plugin-dialog';
import { relaunch } from '@tauri-apps/plugin-process';
import { check } from '@tauri-apps/plugin-updater';

export async function checkForAppUpdates() {
  const update = await check();

  if (update?.available) {
    const yes = await ask(
      `
Update to ${update.version} is available!
Release notes: ${update.body}
        `,
      {
        title: 'Update Now!',
        kind: 'info',
        okLabel: 'Update',
        cancelLabel: 'Cancel'
      }
    );

    if (yes) {
      await update.downloadAndInstall();
      await relaunch();
    }
  }
}


//...

 useEffect(() => {
    (async () => {
      await checkForAppUpdates();
    })();
  }, []);
// tauri.conf.json
{
  "build": {
    "beforeBuildCommand": "yarn build",
    "beforeDevCommand": "yarn dev",
    "frontendDist": "../out",
    "devUrl": "http://localhost:3000"
  },

  "bundle": {
    "active": true,
    "category": "DeveloperTool",
    "icon": ["icons/icon.icns", "icons/icon.png"],
    "macOS": {
      "entitlements": "./entitlements.plist",
      "signingIdentity": "Developer ID Application"
    },
    "createUpdaterArtifacts": true
  },
  "plugins": {
    "updater": {
      "windows": {
        "installMode": "passive"
      },
      "pubkey": "~~~",
      "endpoints": ["~~~"]
    }
  }
}

When I call the relaunch method, I get the error “Operation not permitted (os error 1).” I believe I’ve configured everything correctly, but I’m wondering how I can resolve this issue.

@miro-ring miro-ring changed the title [questtion] When calling the relaunch method of the plugin-process, I encounter the error “Operation not permitted (os error 1).” Could you help me find a solution? [question] When calling the relaunch method of the plugin-process, I encounter the error “Operation not permitted (os error 1).” Could you help me find a solution? Jan 7, 2025
@FabianLars FabianLars added bug Something isn't working platform: macos macOS specific issues plugin: updater labels Jan 7, 2025
@FabianLars
Copy link
Member

FabianLars commented Jan 7, 2025

tauri-apps/tauri#8258 (no solution, just linking it for visibility)

Note that this is not an easy task as it will require a helper binary alongside the main app that will in turn update the app which is quite different from the current "app updates itself" approach.

Edit: That comment was meant for the linked issue, sorry. Anyway i didn't find much info about restarting sandboxed apps in general, i only saw that even electron hasn't solved this yet. I assume that even restarting would require an external helper service then 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: macos macOS specific issues plugin: process plugin: updater
Projects
None yet
Development

No branches or pull requests

2 participants