electron-userland / electron-installer-dmg

Create DMG installers for your electron apps using appdmg.

Home Page:https://github.com/electron-userland/electron-installer-dmg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DMG maker on macOS 12.3 fails due to bless

WillNeill opened this issue · comments

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.0.0-beta.63

Electron version

17.1.2

Operating system

macOS 12.3

Last known working Electron Forge version

No response

Expected behavior

Running yarn make --platform=arm64 with a valid Forge configuration should build the application.

Actual behavior

🚩 This error relates specifically to M1 arm64 Macs running macOS 12.3.

Prior to upgrading to macOS 12.3, the yarn make command was working perfectly. Now, @electron-forge/maker-dmg is failing due to the following error:

bless: The 'openfolder' is not supported on Apple Silicon devices.

Full error output

✖ Making for target: dmg - On platform: darwin - For arch: arm64

An unhandled error has occurred inside Forge:
An error occured while making for target: dmg
Command failed: bless --folder /Volumes/AppName-arm64 --openfolder /Volumes/AppName-arm64
bless: The 'openfolder' is not supported on Apple Silicon devices.

Error: Command failed: bless --folder /Volumes/AppName-arm64 --openfolder /Volumes/AppName-arm64
bless: The 'openfolder' is not supported on Apple Silicon devices.

    at makeError (/Users/xxx/node_modules/appdmg/node_modules/execa/index.js:174:9)
    at /Users/xxx/node_modules/appdmg/node_modules/execa/index.js:278:16
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.

Steps to reproduce

  1. Create a valid DMG config
  2. Run yarn make
  3. See error relating to bless

Additional information

The issue is due to an outdated version of appdmg in electron-installer-dmg which @electron-forge/maker-dmg depends on.

appdmg was recently patched in version 0.6.3 with a fix for this issue.

Until electron-installer-dmg is updated to use a newer version of appdmg, it is possible to force a newer appdmg version and fix this issue using Yarn Resolutions or an NPM package called NPM Force Resolutions. It's not ideal, but it works.

Here is what needs to get added to your package.json file.

"resolutions": {
  "**/@electron-forge/maker-dmg/electron-installer-dmg/appdmg": "^0.6.4"
}

Hi @WillNeill thanks for the report! I've transferred the issue over to the electron-installer-dmg repo. I'll look into upgrading today.

Thanks @erickzhao. Would be nice to have that.