Electron-builder: Macro "arch" does not work in artifactName for NSIS

Created on 26 Nov 2019  路  11Comments  路  Source: electron-userland/electron-builder

  • Version: 21.2.0

  • Target: Windows (NSIS)

I am using the command electron-builder --ia32 on Windows 10 to create a 32 bit installer for my app. The name of the produced .exe file ends up as Blockbench_3.0.0.exe, where the arch part is stripped from the name.

This is the defined artifactName: "${productName}_${arch}_${version}.${ext}"
Here is the relevant build section in my package.json: https://github.com/JannisX11/blockbench/blob/master/package.json#L62-L65

Note that this is an installer specifically for 32-bit Windows. It is not a combined installer. Using a combined installer would double the file size and the download time of the installer.

Related: #3574

All 11 comments

I have the same problem. Electron is already quite big and I don't want to include all native dependencies for both architectures in one installer, so I want to split 32 and 64 bit installers.

For now I used this workaround in electron-builder.js:

    artifactName: process.argv.includes('--ia32')
      ? '${productName}Setup_x86.${ext}'
      : '${productName}Setup.${ext}',

Same problem for a long time

Also ran into this

I have the same problem. Electron is already quite big and I don't want to include all native dependencies for both architectures in one installer, so I want to split 32 and 64 bit installers.

For now I used this workaround in electron-builder.js:

    artifactName: process.argv.includes('--ia32')
      ? '${productName}Setup_x86.${ext}'
      : '${productName}Setup.${ext}',

How to use electron-builder.js ?

I'd like to understand how to build arch dependent nsis installers. Documentation: https://www.electron.build/configuration/nsis#32-bit-64-bit

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Yes, still relevant in 2020.

Yes, still relevant because windows 32 bit still exists in the real world

I have the same problem!

${arch} does not take effect in artifactName.

e.g
conf:
artifactName: "${productName}-${version}-${os}-${arch}.${ext}"
output:
appname-0.0.1-win.exe

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

When passing the --ia32 switch, the packaging line shows arch=x64 and I see it temporarily appear in the artifact name when 7z'ing the installer executable in the dist directory.

Does electron-builder produce a combined arch installer or is the --ia32 switch disregarded?

Was this page helpful?
0 / 5 - 0 ratings