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

Can not build the windows installer on macOS Catalina version 10.15 #4305

Closed
lingxf2002 opened this issue Oct 9, 2019 · 51 comments
Closed

Comments

@lingxf2002
Copy link

• 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)

@pashvin
Copy link

pashvin commented Oct 9, 2019

I think to build Windows app you need Window machine and to build mac app you need Mac machine.

@lingxf2002
Copy link
Author

it works on older macOS

@jsgv
Copy link

jsgv commented Oct 9, 2019

@pashvin I have been able to build Windows apps on my macOS until the Catalina update.

@ukmarn
Copy link

ukmarn commented Oct 10, 2019

Same here.. Worked fine till Catalina update, now throwing same error as above.

@jsgv
Copy link

jsgv commented Oct 10, 2019

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
Copy link

jsgv commented Oct 10, 2019

@lingxf2002
Copy link
Author

@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)

@stevenroussey-privicy
Copy link

You are building for win64, but the the software used to emulate windows on mac is called wine, and wine is 32bit.

@jianfenkezhan
Copy link

how to fix?

@wkoncki
Copy link

wkoncki commented Oct 11, 2019

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.

@thaddeusm
Copy link

thaddeusm commented Oct 11, 2019

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

@agrublev
Copy link

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

@rajjagani021
Copy link

@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?

@thaddeusm
Copy link

@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).

@mengyingdu
Copy link

when i went to the second step : yarn & yarn electron-builder -w

Why it pop up this error: Command "electron-builder" not found.

@lutzroeder
Copy link
Contributor

lutzroeder commented Nov 27, 2019

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.

@develar
Copy link
Member

develar commented Nov 27, 2019

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 .

@eliasaviatrix
Copy link

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.

@Zophyr
Copy link

Zophyr commented Nov 29, 2019

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!

@rajjagani021
Copy link

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

@lutzroeder
Copy link
Contributor

lutzroeder commented Dec 14, 2019

@HemalR I ran the 3 commands above on macOS and got a 45 MB installer?

@HemalR
Copy link

HemalR commented Dec 14, 2019

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.

@lutzroeder
Copy link
Contributor

lutzroeder commented Dec 14, 2019

@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).

@HemalR
Copy link

HemalR commented Dec 14, 2019

Yup agreed, not related.

@lutzroeder Thanks a lot for the help (and for the Catalina fix). Much appreciated 👍

@Faksprod
Copy link

@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!

@gudqs7
Copy link

gudqs7 commented Dec 17, 2019

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

@j-mcnally
Copy link

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 ?

@wkoncki
Copy link

wkoncki commented Dec 26, 2019

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.

@qiuxfeng1985
Copy link

I build success in 22.6.1.

@Holybasil
Copy link

Holybasil commented Jul 15, 2020

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.

@tlkiong
Copy link

tlkiong commented Jul 23, 2020

@psiservices-ccounterman were you able to resolve this issue on your 10.13?

@pedro-surf
Copy link

@psiservices-ccounterman were you able to resolve this issue on your 10.13?

Also waiting for that one

@psiservices-ccounterman
Copy link

@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.

@y4roc
Copy link

y4roc commented Oct 20, 2020

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..

@ndtreviv
Copy link

ndtreviv commented Oct 28, 2020

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

@pavelustenko
Copy link

I cannot create an msi target. If I try with this configuration:

Same for me. Did you found any workaround?

@ndtreviv
Copy link

@pavelustenko I'm having to do msi builds on a VirtualBox VM. 😢

@travis5491811
Copy link

How do i update if using npm i vue-cli-plugin-electron-builder? It's still using the older builder and simply installing the latest electron-builder doesn't stop the default from being called.

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 3, 2021

With yarn you can use "resolutions"
https://classic.yarnpkg.com/en/docs/selective-version-resolutions/

@travis5491811
Copy link

@mmaietta thanks for that. I looked it up after your post and found npm has the same thing https://www.npmjs.com/package/npm-force-resolutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests