Packing under Windows for MacOS
Packing under Windows 10 for MacOS works fine, but fails to start on an Apple computer. If I Pack directly on the Mac it works as expected.
I took this Boilerplate and added electron-packager. Then packed with
electron-packager . Presentations --overwrite --asar --platform=darwin --arch=x64 --prune=true --out=dist --icon=./icon.icns
and copied to the Mac via USB-Stick.
The Issue has been addressed before but none of the given solutions (like using npm cache --force clean before building, or checking the access rights on MacOS) change anything.
The error on MacOS was the following:
Process: Presentations [1246]
Path: /Volumes/VOLUME//Presentations.app/Contents/MacOS/
Presentations
Identifier: com.electron.presentations
Version: 1.0.0 (1.0.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Presentations [1246]
User ID: 501
Date/Time: 2020-02-05 10:38:00.515 +0100
OS Version: Mac OS X 10.15.2 (19C57)
Report Version: 12
Anonymous UUID: XXXXXXXXXXXXXXXXXXXXX
Time Awake Since Boot: 13000 seconds
System Integrity Protection: disabled
Crashed Thread: 0
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD, [0x1] Library missing
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: @rpath/Electron Framework.framework/Electron
Framework
Referenced from: /Volumes/VOLUME//Presentations.app/Contents/MacOS/
Presentations
Reason: no suitable image found. Did find:
/Volumes/Macintosh HD /Presentations-darwin-x64/Presentations.app/
Contents/MacOS/../Frameworks/Electron Framework.framework/Electron
Framework: file too short
/Volumes/Macintosh HD /Presentations-darwin-x64/Presentations.app/
Contents/MacOS/../Frameworks/Electron Framework.framework/Electron
Framework: stat() failed with errno=1
It's probably because the filesystem on the USB stick does not support symlinks. My suggestion is to use WSL to bundle and zip up the app (via the zip command or the electron-installer-zip module) and then copy that to the USB stick.
@malept it is not USB stick that doesn' support symlinks (lmao), it's Windows that does not have a concept of symlinks, except for junctions, that are similar but different. Any package built on Windows is broken on Mac.
Seems correct. After I tried a couple of things to get the package alive to the Mac (installing Ubuntu WSL, using tar archives...) I gave up and started building under MacOS directly.
Maybe it would be a good Idea to mention that in the ReadMe...
Still a problem. Anybody know a possible workaround? I tried rebuilding all of the symlinks on the target machine, but then I got a "trace/bpt trap: 5" error that's related to not being able to load a .dylib file.