electron-builder: Building for Windows on macOS creates broken builds.

  • Node Version: v20.11.1
  • Electron Version: 31.1.0
  • Electron Type (current, beta, nightly):
  • Electron Updater: 6.3.0-alpha.6
  • Target: Windows

I am having the same issue as the user in this StackOverflow thread: https://stackoverflow.com/questions/74060787/electron-application-built-on-macos-for-windows-is-not-working-on-installation

It appears that builds for Windows on macOS do not actually work. The installer exists. But when I go and run the installer on Windows, it creates a nearly-empty folder in %LocalAppData%\Programs. The only file contained within is the uninstaller executable. Why does this happen?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (4 by maintainers)

Most upvoted comments

To anyone running into this, the problem is that electron-builder builds for the architecture of the local machine, by default. In my case I was building on an apple M1 chip which would create arm64 executables both for mac AND win, which caused the windows executable to not run at all. This is likely to be the issue with the OP as well since their build command does not include the --x64 flag but @mmaietta 's does

Simply add --x64 to the build command to build a x64 executable to fix this.

Correct. On my test project, I built for windows x64 on my arm64 mac and installed it on my arm64 windows VM and my x64 Windows PC. App runs correctly on both. Built using electron-builder 25.1.3 using my local test project based off electron-quick-start Screenshot 2024-10-01 at 8 44 42 AM image

Interesting. I’ll have to see what is different on my end. I have a lot going on, but I’ll try to be back at this thread soon with a minimal example.

I have the same problem, but I’m running on windows 64 for windows 64. Before that, the application (Setup) was assembled normally, and suddenly it suddenly stopped assembling at

When unpacked, the application works fine, but if you create an installer, then after installation it creates only uninstall.exe So far, all we’ve been able to figure out is that it creates a broken archive in Setup.exe

Image

Image

Image