electron-builder: Building for Windows on macOS creates broken builds.
- Electron-Builder Version: 25.0.0-alpha.13
- 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)
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
arm64executables 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--x64flag but @mmaietta 's doesSimply add
--x64to the build command to build a x64 executable to fix this.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