-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Error "is not Win32 application" when use electron-builder #2619
Comments
I am facing the same error - is there a solution already? |
Solution is to build in a windows machine. Had the same issue developing in a Mac, the build in a Win VM ran with no issue. |
Not a good solution for automated builds... |
We can suppose you got a better/working one, illuminate us! |
Not really, stumbled on this today and also stuck on it, testing everything I can |
I'm afraid that while the error code is very similar, the closed issue you reference is very unlikely to be related as the root cause of that was broken inbound dependency which was entirely stripped out as part of serialport v10. So I don't think that will allow us to trace the problem. In trying to replicate your issue I think this comes down to an electron-builder issue which affect cross build for both Mac and Linux targeting windows. With a very simple project (based on the electron-serialport example) compiling on Linux (ubuntu) and Windows I experience the same problems as described in electron-userland/electron-builder#7574 Even before the application is packaged, the unpackaged output from electron-builder is inconsistent. On Windows it places all of the required data in the I'll continue to dig, but I'm not sure if I will find a fix quickly. In the meantime I would echo the suggestion to build on a windows instance if you can. Per your comment about concerns with automated builds, one option to enable to build via your Linux machine would be to use Windows in a VM or container. |
Thanks for the reply, I too noted this |
Only reason for using electron to me is option to quickly build project on Linux for windows. If I need windows I would prefer any other native technology. |
I'll continue to investigate the issue with the cross build via electron-builder, but will keep those investigations in the electron-builder repository to minimise confusion (check out that issue if you want to help with the investigations). While those investigations progress I might see if the process is any better in electron forge or if it suffers from the same problems |
Please refer to electron-userland/electron-builder#7574 for potential fix / workaround If this proves to work for people (and not break anything else) then I'll see about adding it into the documentation website |
Thanks to the electron-builder team this should now be fixed in their new version 24.5.1 |
@GazHank riveting investigation! |
Hello @GazHank sorry to be bothering you again but this error is still happening to me. I've updated my electron-builder to 24.5.2, but my electron is still version 17. I have some screenshots of my ci running the build, but I could't determine why only updating electron-builder didn't fix it. What test did you ran? |
I know this is an old issue, but I just ran into it and it's still not working for me. I'm using electron 28.0.0, electron-builder 24.9.1, and serialport 12.0.0, so I have up-to-date versions of everything. When I try to build it in Linux, the build log looks like it should be building @serialport/bindings-cpp for Windows:
But the generated binary is in ELF format:
|
Hey @pjreed I had the same issue. I set buildDependenciesFromSource to true in the build options and now it works. |
That doesn't work for me, and I'm not sure how it could possibly work. When setting that, I see this in the output:
|
I'm using docker (electronuserland/builder:18-wine-mono) and targeting to windows. My build command is:
electron-builder-dev.yml
Without the DockerFile
|
Also experiencing this. Did you find a solution? |
hi~ Did you find a solution? |
Unfortunately, just for the record, I have still not found a solution other than "build it in a Windows VM" |
edited:
origin answer
patch_serial_window_file is
|
VM is your choice. I had some problem and solved it by creating different OCs inside the VM. Initially my application was built for Windows 10/11, Linux, Ubuntu. But now I need to build it for Windows 7, and this turned out to be a problem..... When I run this built application in Win7x32, I get an error: app.exe is not a valid Win32 application. |
SerialPort Version
10.5.0
Node Version
v16.14.2
Electron Version
23.2.0
Platform
Microsoft Windows NT 10.0.19045.0
Architecture
x64
Hardware or chipset of serialport
No response
What steps will reproduce the bug?
Dev machine: Linux zivlak 6.1.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 21 Dec 2022 22:27:55 +0000 x86_64 GNU/Linux
Test machine: Microsoft Windows NT 10.0.19045.
Electron builder version: 23.6.0
Electron builder target: portable x64
What happens?
What should have happened?
Program should list all available ports on machine, but it's crash on importing SerialPort module.
Additional information
No response
The text was updated successfully, but these errors were encountered: