• electron-builder version=21.2.0 os=19.0.0
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist/builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=6.0.12 appOutDir=dist/win-unpacked
• signing file=dist/win-unpacked/BUZZ.exe certificateFile=/Users/xling/buzzcodesigning/dialogic2018.pfx
• building target=nsis file=dist/buzz-installer-4.1.0.exe archs=x64 oneClick=true perMachine=false
• signing file=dist/win-unpacked/resources/elevate.exe certificateFile=/Users/xling/buzzcodesigning/dialogic2018.pfx
⨯ Exit code: ENOENT. spawn prlctl ENOENT stackTrace=
Error: Exit code: ENOENT. spawn prlctl ENOENT
at /Users/xling/workspace/git_bit/main/buzz_desktop/electron_app/node_modules/builder-util/src/util.ts:125:16
at exithandler (child_process.js:295:5)
at ChildProcess.errorhandler (child_process.js:307:5)
at ChildProcess.emit (events.js:182:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:236:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
I think to build Windows app you need Window machine and to build mac app you need Mac machine.
it works on older macOS
@pashvin I have been able to build Windows apps on my macOS until the Catalina update.
Same here.. Worked fine till Catalina update, now throwing same error as above.
Catalina removed support for 32 bit apps (you can still create 64 bit builds).
I have to do my builds on a Window VM because of this.
@jsgv Can not build with 64 bit either.
electron-builder version=21.2.0 os=19.0.0
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist/builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=6.0.12 appOutDir=dist/win-unpacked
• signing file=dist/win-unpacked/BUZZ.exe certificateFile=/Users/xling/buzzcodesigning/dialogic2018.pfx
• building target=nsis file=dist/buzz-installer-4.1.0.exe archs=x64 oneClick=true perMachine=false
• signing file=dist/win-unpacked/resources/elevate.exe certificateFile=/Users/xling/buzzcodesigning/dialogic2018.pfx
⨯ Exit code: ENOENT. spawn prlctl ENOENT stackTrace=
Error: Exit code: ENOENT. spawn prlctl ENOENT
at /Users/xling/workspace/git_bit/main/buzz_desktop/electron_app/node_modules/builder-util/src/util.ts:125:16
at exithandler (child_process.js:295:5)
at ChildProcess.errorhandler (child_process.js:307:5)
at ChildProcess.emit (events.js:182:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:236:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
You are building for win64, but the the software used to emulate windows on mac is called wine, and wine is 32bit.
how to fix?
You are building for win64, but the the software used to emulate windows on mac is called wine, and wine is 32bit.
That's a real bummer. I hoped to at least be able to build Windows x64 releases from macOS. Wine itself comes in x64 variant but it must use some 32 bit libraries that are not working on Catalina anymore. I guess I have to get VirtualBox going again.
I was able to use Docker with the info provided in the docs to build a Windows (NSIS) release from my Mac (running Catalina). It was my first time using Docker. I am amazed.
For convenience, the Docker script provided in the docs is as follows:
docker run --rm -ti \
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}:/project \
-v ${PWD##*/}-node-modules:/project/node_modules \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine
For my use case, I decided to separate release scripts for each platform my app supports (Mac and Windows) because I ran into a problem building a DMG from the Docker container. Instead, I can use the image above just to build and publish my Windows builds.
After having previously relied upon 32-bit Wine, which always seemed less polished, I am thoroughly impressed with this new solution. For reference, my project is here.
UPDATE: Fixed the formatting issue. Thanks @agrublev
I was able to use Docker with the info provided in the docs to build a Windows (NSIS) release from my Mac (running Catalina). It was my first time using Docker. I am amazed.
For convenience, the Docker script provided in the docs is as follows:
docker run —rm -ti \ —env-file <(env | grep -iE ‘DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_’) \ —env ELECTRON_CACHE=“/root/.cache/electron” \ —env ELECTRON_BUILDER_CACHE=“/root/.cache/electron-builder” \ -v ${PWD}:/project \ -v ${PWD##*/}-node-modules:/project/node_modules \ -v ~/.cache/electron:/root/.cache/electron \ -v ~/.cache/electron-builder:/root/.cache/electron-builder \ electronuserland/builder:wine
For my use case, I decided to separate release scripts for each platform my app supports (Mac and Windows) because I ran into a problem building a DMG from the Docker container. Instead, I can use the image above just to build and publish my Windows builds.
After having previously relied upon 32-bit Wine, which always seemed less polished, I am thoroughly impressed with this new solution. For reference, my project is here.
For those who try to copy your improperly formatted comment
docker run --rm -ti \
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}:/project \
-v ${PWD##*/}-node-modules:/project/node_modules \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine
@thaddeusm
Hi I am new to docker and I have created an account and install the docker and all but can you please provide me the steps that I need to after that?
@rajjagani021
After installing Docker, you should run the application on your computer. Then, in your terminal, you can paste the script above. That will get a Docker container configured with the environment needed to package your Electron app. From there, you can run the script you have defined in your app's package.json file to build your application.
Electron Builder accepts flags to identify the target (e.g. "-w" as Windows).
when i went to the second step : yarn & yarn electron-builder -w
Why it pop up this error: Command "electron-builder" not found.
electron-builder 22.2.0
now includes a targeted workaround extracting the NSIS uninstaller without the need to spin up Parallels or wine. Can you give this a try and report if it works? Not just building the installer on Catalina but also if running uninstall on Windows works.
I need to say that it is miracle. I couldn't even imagine that it will be fixed (because Windows is not OS). Thanks to @lutzroeder .
electron-builder 22.2.0
now includes a targeted workaround extracting the NSIS uninstaller without the need to spin up Parallels or wine. Can you give this a try and report if it works? Not just building the installer on Catalina but also if running install and uninstall on Windows.
It works for me.
electron-builder 22.2.0
now includes a targeted workaround extracting the NSIS uninstaller without the need to spin up Parallels or wine. Can you give this a try and report if it works? Not just building the installer on Catalina but also if running install and uninstall on Windows works.
It works for me! Thank you!
electron-builder 22.2.0
now includes a targeted workaround extracting the NSIS uninstaller without the need to spin up Parallels or wine. Can you give this a try and report if it works? Not just building the installer on Catalina but also if running install and uninstall on Windows works.
It works for me too! Thank you
I downloaded 22.2.0 to build the Windows installer. My build script works but I am not able to install the built .exe.
Install gets hung up.
I have no trouble installing when downgrading back to 21.2.0.
@ttomaszewski this change should not impact how the installer is built.
./node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js
, replace _nsisUtil().UninstallerReader.exec(installerPath, uninstallerPath);
with throw new Error("Test");
and rebuild from scratch. This will always fall back to the Parallels code path.
electron-builder 22.2.0
now includes a targeted workaround extracting the NSIS uninstaller without the need to spin up Parallels or wine. Can you give this a try and report if it works? Not just building the installer on Catalina but also if running install and uninstall on Windows works.
you save my day
Worked for me, thanks!
Installer exe has doubled in size though, I wonder if that's related?
@HemalR I noticed exe doubled as well when running multi platform build (dmg and exe). I also still have issue where app fails to launch after installing exe. I mentioned in above comments. Running script to build mac and win separately resolves issue but would be nice to only have to run once.
The binary
~/Library/Caches/electron-builder/nsis/nsis-3.0.4.1/mac/makensis
from
https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.4.1/nsis-3.0.4.1.7z
doesn't work on my macOS 10.13, fails with:
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from: /Users/ccounterman/Library/Caches/electron-builder/nsis/nsis-3.0.4.1/mac/makensis (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
@HemalR @ttomaszewski can you try the steps mentioned above:
./node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js
_nsisUtil().UninstallerReader.exec(installerPath, uninstallerPath);
with throw new Error("Test");
This will always fall back to the Parallels code path on Catalina.
Try building with this change and without this change. If the binaries are not identical it might be related to uninstaller extraction and an actual repro project would be helpful...
@lutzroeder
Just did the test you've set out. It threw an error and failed to build entirely:
• packager.vm is used: Test
⨯ Exit code: ENOENT. spawn prlctl ENOENT stackTrace=
Error: Exit code: ENOENT. spawn prlctl ENOENT
at /Users/hemal/repos/mediref-desktop/node_modules/builder-util/src/util.ts:125:16
at exithandler (child_process.js:302:5)
at ChildProcess.errorhandler (child_process.js:314:5)
at ChildProcess.emit (events.js:210:5)
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] pack_windows: `electron-builder --win --x64 --ia32`
npm ERR! Exit status 1
Here is the repo in question: https://github.com/HemalR/mediref-desktop
Ps - Thanks for taking the time to help!
@HemalR Exit code: ENOENT. spawn prlctl ENOENT
is the error that started this thread. On Catalina, 32-bit apps like wine are no longer supported and to extract the Windows NSIS uninstaller in electron-builder
it is required to install a Windows VM in Parallels. The workaround added to resolve this is extracting the uninstaller without wine or Parallels. With the workaround removed, a Parallels VM, Windows machine or pre-Catalina macOS is required to build "the old way" for comparison.
git clone https://github.com/HemalR/mediref-desktop && cd mediref-desktop && npm install
npx electron-builder --win
~/Projects/mediref-desktop: ls -la ./dist/*.exe
[...] 44589377 [...] ./dist/Mediref Setup 0.2.5.exe
~45 MB is normal for an Electron app?
Doh! Let me take a crack at spinning up a Windows Machine on Azure and seeing how it builds on there
Test done:
Right, building the installer on Windows = 88MB
Same installer on Mac = 149MB
So the binaries are not identical. I'm happy to do any grunt work to help figure this out/do any further testing.
Regarding Electron size in general - I know electron apps are huge (a consequence of all the functionality shipped with them, whether used or not). My one has an additional pdf reader that bloats it by a further 25ish MB.
@HemalR I ran the 3 commands above on macOS and got a 45 MB installer?
I'm lost for explanations 😕
I set up a new project (using my own repo) and the instructions as you did and got the same results as you. Why the discrepancy with my original project, I have no idea. 😕
Edit - Did some more testing (on the new repo vs the old one)
The build command causing the big builds is:
electron-builder --win --x64 --ia32
Vs
electron-builder --win
I don't know what exactly the difference is nor its significance.
Another point of note is that on the new test repo, the 'bigger' build is 86.6MB vs 149MB on the original - and I don't even have a suspicion about why that would be.
@HemalR 7z l "Setup x.x.x.exe"
can help poking around. Guess would be that 86.6 MB contains both 32 and 64 bit files as it is ~ twice 45 MB. You should create a new ticket if this is not related to the Catalina uninstaller issue (which would only impact the size of the uninstaller).
Yup agreed, not related.
@lutzroeder Thanks a lot for the help (and for the Catalina fix). Much appreciated 👍
@lutzroeder Many thanks for the tips about electron-builder 22.2.0
! It works for me too but ONLY using NON programmatic-usage for building/signing an APPX. In April 2019, I had to use programmatic-usage for building apps instead of using the standard package.json
method because of this issue. So today I just moved back to the normal package.json
method and building my APPX from MacOS Catalina worked well thanks to electron-builder 22.2.0
. Thanks!
electron-builder 22.2.0
now includes a targeted workaround extracting the NSIS uninstaller without the need to spin up Parallels or wine. Can you give this a try and report if it works? Not just building the installer on Catalina but also if running uninstall on Windows works.
Good for me
I'm lost for explanations 😕
I set up a new project (using my own repo) and the instructions as you did and got the same results as you. Why the discrepancy with my original project, I have no idea. 😕
Edit - Did some more testing (on the new repo vs the old one)
The build command causing the big builds is:
electron-builder --win --x64 --ia32
Vs
electron-builder --win
I don't know what exactly the difference is nor its significance.
Another point of note is that on the new test repo, the 'bigger' build is 86.6MB vs 149MB on the original - and I don't even have a suspicion about why that would be.
Isn’t ia32 a separate architecture ?
Isn’t ia32 a separate architecture ?
I'm 99% sure that electron by default builds only x64, not ia32, so it's expected that build for two architectures will be around twice in size.
I build success in 22.6.1.
electron-builder build --win --x64
• electron-builder version=22.7.0 os=19.5.0
• loaded configuration file=package.json ("build" field)
• writing effective config file=release/builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=7.1.10 appOutDir=release/win-unpacked
• building target=MSI arch=x64 file=release/BenzDataMaker 1.0.0.msi
• building target=nsis file=release/BenzDataMaker Setup 1.0.0.exe archs=x64 oneClick=true perMachine=false
⨯ macOS Catalina doesn't support 32-bit executables and as result Wine cannot run Windows 32-bit applications too
Why?
Just delete "msi" from "target", it works.
@psiservices-ccounterman were you able to resolve this issue on your 10.13?
@psiservices-ccounterman were you able to resolve this issue on your 10.13?
Also waiting for that one
@pedro-surf
I guess I didn't resolve it: there's a branch version I still build only on 10.13 which uses electron-builder 20.34.0.
On 10.15 I'm building Windows with docker linux now, though I don't recall if this is related to why. I do think it was wine-related.
I installed the newest dev-build of wine and it supports 64-bit (wine64). Is here a dev-Version of electron-builder wich provide wine64?
I linked wine to wine64 but I got this error wine: '/Users/thhan/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/wine-home' is a 32-bit installation, it cannot support 64-bit applications.
.
I can create an nsis package (MyApp Setup.exe
) on macOS Catalina with the configuration:
"win": {
"icon": "build/icons/icon.ico",
"sign": "./electron/winsign.js",
"publisherName": "MyCompany Ltd"
},
"nsis": {
"perMachine": false
},
Using versions:
Electron Builder Version: 22.2.0
Electron Version: 6.0.10
Electron Updater version: 4.1.2
and this command:
electron-builder build --win -c.extraMetadata.main=build/electron/main.js --publish never
BUT
I cannot create an msi target. If I try with this configuration:
"win": {
"target": "msi",
"icon": "build/icons/icon.ico",
"sign": "./electron/winsign.js",
"publisherName": "MyCompany Ltd"
},
"nsis": {
"perMachine": false
},
I get this error:
⨯ macOS Catalina doesn't support 32-bit executables and as result Wine cannot run Windows 32-bit applications too
⨯ /Users/me/gitrepos/myapp/node_modules/app-builder-bin/mac/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
I cannot create an msi target. If I try with this configuration:
Same for me. Did you found any workaround?
@pavelustenko I'm having to do msi builds on a VirtualBox VM. 😢
Most helpful comment
electron-builder 22.2.0
now includes a targeted workaround extracting the NSIS uninstaller without the need to spin up Parallels or wine. Can you give this a try and report if it works? Not just building the installer on Catalina but also if running uninstall on Windows works.