Electron-builder: Build both 32 & 64 bit execuable file seperately.

Created on 6 Feb 2018  Â·  10Comments  Â·  Source: electron-userland/electron-builder


  • Version:
    ^19.19.1

  • Target:
    targets = Platform.WINDOWS.createTarget() &
      win: {
        icon: 'build/icons/icon.ico',
        target: [
          {
            target: 'nsis',
            arch: [
              'x64', 'ia32'
            ]
          }
        ]
      }


I want to build both 32 & 64 bit target nsis file seperately instead of one execuable nsis file. How to do that?

feature nsis

Most helpful comment

@peterdanis ${arch} doesn't work, just ignoring :(

All 10 comments

Please try:

win: {
  target: ['nsis:ia32', 'nsis:x64']
}

But I am afraid that the only way to build — build 2 times. Anyway — please explain why do you need this and why nsis-web is not a solution (if big size is an issue).

The two-in-one nsis file is almost 70MB while x64 is about 35MB. And I need to provide offline package for users so nsis-web do not fit me.

The workaround now is to create a ia32 task after x64 build finished and change the artifactName like bellow:

        {
          win: {
            icon: 'build/icons/icon.ico',
            artifactName: '${productName} Setup ${version}-ia32.${ext}',
            target: [
              {
                target: 'nsis',
                arch: [
                  'ia32'
                ]
              }
            ]
          }

This workaround can build ia32 exe file. But when appveyor publish the 2 exe file to github, the last ia32 exe file will overwrite the previous x64 file as their publish name is the same. I didn't find a way to change the upload file's name, so how to fix this problem?

You can set the artifactName to include ${arch} (e.g. ${productName}_v${version}_${arch}.${ext}) and run build process twice, first time with --ia32 and second time with --x64 argument.

I have mentioned this above, but the second one will overwrite the first one on github.

@peterdanis ${arch} doesn't work, just ignoring :(

Yes, I have tried ${arch} recently again, it not work. And another issue is the latest.yml will be overwrited at the second time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antonycourtney picture antonycourtney  Â·  3Comments

xingoxu picture xingoxu  Â·  3Comments

omarkilani picture omarkilani  Â·  3Comments

lbssousa picture lbssousa  Â·  3Comments

JohnWeisz picture JohnWeisz  Â·  3Comments