electron/node-rcedit

Wrong `rcredit` executable is resolved on Apple Silicon platforms (ARM64).

mn4367 opened this issue ยท 3 comments

I've seen this while using Electron Packager to build a Windows version of an Electron app with a custom app icon on a Mac with Apple Silicon (M1) . wine-stable is installed via Homebrew and works properly. The reason is that node-rcedit only checks for the x64 architecture to execute rcedit-x64.exe instead of rcedit.exe. This may also fail on other ARM64 platforms where Wine/node-rcedit is used.

To fix it, this line

const rceditExe = process.arch === 'x64' ? 'rcedit-x64.exe' : 'rcedit.exe'

should be

    const rceditExe = process.arch === 'x64' || process.arch === 'arm64' ? 'rcedit-x64.exe' : 'rcedit.exe'

Since node-rcedit now uses cross-spawn-windows-exe to run Wine a similar fix seems to be needed there (I think).


Maybe this should also be backported to v2.3.0 since this is the version Electron Packager currently uses. The changes there would be

let rcedit = path.resolve(__dirname, '..', 'bin', process.arch === 'x64' ? 'rcedit-x64.exe' : 'rcedit.exe')

to

      let rcedit = path.resolve(__dirname, '..', 'bin', process.arch === 'x64' || process.arch === 'arm64' ? 'rcedit-x64.exe' : 'rcedit.exe')

and

rcedit = process.arch === 'x64' ? 'wine64' : 'wine'

to

    rcedit = process.arch === 'x64' || process.arch === 'arm64' ? 'wine64' : 'wine'

That's correct, I also went down a similar route, changing x64 to arm64 for M1 macs.

๐ŸŽ‰ This issue has been resolved in version 3.0.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@malept thanks for fixing this!