Closed gitmitch closed 7 years ago
Hmmm, I just found issue #284 in electron-packager:
This is because, as far as I know, there is no way to cross-compile native node modules. You would need to recreate a build environment entirely in Wine.
Maybe what I'm trying to do--build an Electron app for Windows on Mac that uses native modules--is impossible.
It's not impossible (Wine might help), but in my experience, getting macOS to compile windows binaries is a bigger pain than just to use a virtual machine (you can grab a free one over at modern.ie).
Follow-up: AppVeyor can also help.
I am using ember-electron 1.12.7 and electron 1.6.1. My app is cross-platform. My primary development environment is on Mac. Building, running, packaging and signing on Mac for a Mac app works beautifully. On Windows, I can build and run, but packaging a Windows app on Windows fails due to #130 .
In an effort to get a packaged Windows app, I installed Wine on my Mac and tried packaging for Windows on Mac. A directory was generated with a bunch of files in it, including an EXE. I copied the entire directory to my Windows machine, and ran the EXE.
The packaged app runs fine on Windows, except when it tries to call any code in a native dependency. The native dependency I am using is node-keytar. When I take an action in the app that uses node-keytar, I get this error in the console:
I understand #130 is going to be resolved in 2.0, so I'm fine waiting for that to be able to package a Windows app on Windows. But packaging for Windows on Mac should be working in 1.12.7, correct? Can someone suggest something in my configuration I might have wrong that would prevent native modules from being packaged correctly in the Windows app?
Here is the output of ember electron:package when packaging for Windows on Mac:
This is the command I run to package for Windows:
ember electron:package --platform=win32 --icon=icon-64x64.ico
This is my package.json:
Thank you for any help you can provide!