build --x64 --win --publish always (so it's using the default NSIS target)I've noticed that when building my windows target, the name is always of the form MyApplication-1.0.0.exe, even though I explicitly specified an artifactName like this:
"build": {
"win": {
"artifactName": "${productName}-${version}-${arch}.${ext}"
},
}
I saw the comment here, where is says "If no arch, macro will be removed from your pattern with leading space, - and _". I haven't been able to figure out in which circumstances there is or isn't an arch, though. I'm assuming that the generated .exe works on both ia32 and x64?
If so, this is all well and good, but I really do need to product artifacts with different names like MyApplication-1.0.0-ia32.exe and MyApplication-1.0.0-x64.exe, because I need to include special architecture-specific binary resources via extraResources, like this:
"extraResources": [{
"from": "binaries/${os}/${arch}",
"to": "."
}]
Is it just not possible to create Windows installer .exe files with the ${arch} variable in them?
(I realize that I could just rename my installers after building, but I would like to be able to directly publish them using the --publish flag)
Note: I was able to work around this using an environment variable and ${env.ENV_NAME}
Please see https://github.com/electron-userland/electron-builder/issues/1389#issuecomment-288632585
I really do need to product artifacts with different names like MyApplication-1.0.0-ia32.exe and MyApplication-1.0.0-x64.exe, because I need to include special architecture-specific binary resources via extraResources
Doesn't matter. "Nsis installer contains both archs."
Ah, thanks for the pointer. Follow-up question--so the extraResources from both architectures are included in the final artifact? That doesn't seem too good if they're large...
@develar, still confused here -- I confirmed that the dist/win-unpacked/resources and dist/win-ia32-unpacked/resources have different stuff in them. (For example, I put the 64-bit version of the Visual C++ Redistributable package in one of them, and 32-bit in the other.)
I also used 7-Zip to extract the NSIS .exe file, and I only found one set of resources. So I really don't understand what you mean by "Nsis installer contains both archs." Could you explain?
(I used the workaround I mentioned above to solve the problem with producing the artifacts, but I still have a problem with auto-update, because the latest.yml file doesn't make a distinction between ia32 and x64.)
You need to build both archs — build --x64 --ia32 --win --publish always to get installer with both archs.
Oh okay. That's going to make my installer like 50MB bigger than it needs to be, is it ever going to be possible to do separate installers?
is it ever going to be possible to do separate installers?
Well. If will be request. Maybe web installer will suit your needs (#1207)?
That looks promising, I will try it out! Thanks
I am configuring my Target to generate the 2 x64 and ia32 versions, but the installer only generates one and does not match the version in the final file.
"win": {
"icon": "artifacts/distribution/256x256.png",
"publisherName": "Temainfo Software, LTDA",
"artifactName": "${productName} Installer-${arch}-${version}.${ext}",
"target": [
{
"target": "nsis",
"arch": [
"x64",
"ia32"
]
}
],

Most helpful comment
Oh okay. That's going to make my installer like 50MB bigger than it needs to be, is it ever going to be possible to do separate installers?