Electron-forge: Cannot package for win32 with wine

Created on 8 Aug 2019  路  5Comments  路  Source: electron-userland/electron-forge

  • [x] I have read the contribution documentation for this project.
  • [x] I agree to follow the code of conduct that this project follows, as appropriate.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:
Trying to build for win32 on a linux machine. Wine and Mono are both installed.
Always fails at the rcedit.exe stage, depending on the WINEARCH setting:

wine: Bad EXE format for Z:\my-projectnode_modules\rcedit\bin\rcedit.exe.

wine: '/root/.wine' is a 32-bit installation, it cannot support 64-bit applications.

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:async-ora Process Started: Checking your system +0ms
  electron-forge:check-system checking system, create ~/.skip-forge-system-check to stop doing this +0ms
  electron-forge:async-ora Process Succeeded: Checking your system -- after 333ms +334ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:async-ora Process Started: Preparing to Package Application for arch: x64 +0ms
  electron-forge:project-resolver searching for project in: /my-project +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /my-project/package.json +8ms
  electron-forge:packager packaging with options { asar: false,
  overwrite: true,
  appCopyright: '...',
  icon: './resources/img/logo.ico',
  dir: '/my-project',
  arch: 'x64',
  platform: 'win32',
  afterCopy: [ [Function] ],
  afterExtract: [ [Function] ],
  afterPrune: [ [Function] ],
  out: '/my-project/out',
  electronVersion: '5.0.7',
  quiet: true } +0ms
  electron-forge:async-ora Process Succeeded: Preparing to Package Application for arch: x64 -- after 10.7s +11s
  electron-forge:async-ora Process Started: Preparing native dependencies +0ms
  electron-forge:async-ora Process Succeeded: Preparing native dependencies -- after 119ms +119ms
  electron-forge:async-ora Process Started: Packaging Application +0ms

An unhandled rejection has occurred inside Forge:
Error: rcedit.exe failed with exit code 193. wine: Bad EXE format for Z:\my-project\node_modules\rcedit\bin\rcedit.exe.
    at ChildProcess.child.on.code (/my-project/node_modules/rcedit/lib/rcedit.js:69:16)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:198:13)
    at Pipe._handle.close (net.js:606:12)

Electron Forge was terminated. Location:
{}

What command line arguments are you passing?

electron-forge package --platform win32

What does your config.forge data in package.json look like?

{
  "packagerConfig": {
    "appCopyright": "...",
    "icon": "./resources/img/logo.ico"
  },
  "makers": [...]
}

Most helpful comment

I'm using electronuserland/builder:wine and running electron-forge make --platform=win32

any tips how to resolve?

An unhandled rejection has occurred inside Forge:
--
40 | Error: rcedit.exe failed with exit code 1. wine: '/root/.wine' is a 32-bit installation, it cannot support 64-bit applications.
41 | at ChildProcess.<anonymous> (/drone/src/desktop/node_modules/rcedit/lib/rcedit.js:69:16)
42 | at ChildProcess.emit (events.js:311:20)
43 | at ChildProcess.EventEmitter.emit (domain.js:482:12)
44 | at maybeClose (internal/child_process.js:1021:16)
45 | at Socket.<anonymous> (internal/child_process.js:443:11)
46 | at Socket.emit (events.js:311:20)
47 | at Socket.EventEmitter.emit (domain.js:482:12)
48 | at Pipe.<anonymous> (net.js:668:12)
49 |  
50 | Electron Forge was terminated. Location:
51 | {}
      "makers": [
        {
          "name": "@electron-forge/maker-squirrel",
          "platforms": [
            "win32"
          ],

I made it work with the image electronuserland/builder:wine-mono. I haven't tested the wine only variant, but I guess it could work.
To make it work I had to do a little bit of tweaking with the system:

# Removes the original 32-bit wine prefix from the generated image
rm -rf /root/.wine
# Creates a new 64-bit one
winecfg

After theses steps I could run electron-forge make --platform=win32 without problems.

Hope it helps.

All 5 comments

Same result on docker images based on node:10-slim and node:10-alpine.

By default, wine64 is installed. For rcedit, you need to install wine32 (or however you install 32-bit wine on Alpine Linux).

wine32 cannot be installed on a 64-bit Alpine Linux as far as I can tell (I got many musl conflicts).

On Debian, with dpkg --add-architecture i386 it can be installed, and the build does then work.
Probably worth mentioning that both wine32 (for rcedit.exe) and wine64 (for maker-squirrel) are required, not simply wine.

I'm using electronuserland/builder:wine and running electron-forge make --platform=win32

any tips how to resolve?

An unhandled rejection has occurred inside Forge:
--
40 | Error: rcedit.exe failed with exit code 1. wine: '/root/.wine' is a 32-bit installation, it cannot support 64-bit applications.
41 | at ChildProcess.<anonymous> (/drone/src/desktop/node_modules/rcedit/lib/rcedit.js:69:16)
42 | at ChildProcess.emit (events.js:311:20)
43 | at ChildProcess.EventEmitter.emit (domain.js:482:12)
44 | at maybeClose (internal/child_process.js:1021:16)
45 | at Socket.<anonymous> (internal/child_process.js:443:11)
46 | at Socket.emit (events.js:311:20)
47 | at Socket.EventEmitter.emit (domain.js:482:12)
48 | at Pipe.<anonymous> (net.js:668:12)
49 | 聽
50 | Electron Forge was terminated. Location:
51 | {}
      "makers": [
        {
          "name": "@electron-forge/maker-squirrel",
          "platforms": [
            "win32"
          ],

I'm using electronuserland/builder:wine and running electron-forge make --platform=win32

any tips how to resolve?

An unhandled rejection has occurred inside Forge:
--
40 | Error: rcedit.exe failed with exit code 1. wine: '/root/.wine' is a 32-bit installation, it cannot support 64-bit applications.
41 | at ChildProcess.<anonymous> (/drone/src/desktop/node_modules/rcedit/lib/rcedit.js:69:16)
42 | at ChildProcess.emit (events.js:311:20)
43 | at ChildProcess.EventEmitter.emit (domain.js:482:12)
44 | at maybeClose (internal/child_process.js:1021:16)
45 | at Socket.<anonymous> (internal/child_process.js:443:11)
46 | at Socket.emit (events.js:311:20)
47 | at Socket.EventEmitter.emit (domain.js:482:12)
48 | at Pipe.<anonymous> (net.js:668:12)
49 |  
50 | Electron Forge was terminated. Location:
51 | {}
      "makers": [
        {
          "name": "@electron-forge/maker-squirrel",
          "platforms": [
            "win32"
          ],

I made it work with the image electronuserland/builder:wine-mono. I haven't tested the wine only variant, but I guess it could work.
To make it work I had to do a little bit of tweaking with the system:

# Removes the original 32-bit wine prefix from the generated image
rm -rf /root/.wine
# Creates a new 64-bit one
winecfg

After theses steps I could run electron-forge make --platform=win32 without problems.

Hope it helps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

damianesteban picture damianesteban  路  3Comments

liamdawson picture liamdawson  路  4Comments

Skizu picture Skizu  路  5Comments

kzimny picture kzimny  路  3Comments

Andreybest picture Andreybest  路  3Comments