Electron-builder: Question - Build NSIS for both 32 and 64 bits

Created on 5 Aug 2017  Â·  17Comments  Â·  Source: electron-userland/electron-builder

With electron-builder v19.19.1, when I build for windows with defaults params build -w, I get a nsis installer who only works for 64 bits. Is it correct ?

In fact, I expected that by default, the nsis contain both 32 and 64 bits versions. What do you think to do this behaviour by default ?

And second, is there any way to define the build target arch for Windows only in the package.json ? Because, now I use build -wml --x64 --ia32 and it build 32 bits versions for linux too and I do not want that..

Thanks

question

Most helpful comment

"win": {
  "target": [
    {
      "target": "nsis",
      "arch": [
        "x64",
        "ia32"
      ]
    }
  ]
},
"linux": {
  "target": [
    {
      "target": "AppImage",
      "arch": [
        "x64"
      ]
    }
  ]
}

and use

$ build -wl

All 17 comments

"win": {
  "target": [
    {
      "target": "nsis",
      "arch": [
        "x64",
        "ia32"
      ]
    }
  ]
},
"linux": {
  "target": [
    {
      "target": "AppImage",
      "arch": [
        "x64"
      ]
    }
  ]
}

and use

$ build -wl

@cawa-93 Thank you! I've missed the "arch" options.. But the linux part is not necessary. By default only arch x64 is build.

And what about setting by default arch x64 and ia32 when target is "nsis" for Windows build ?

when target is "nsis" for Windows build ?

Currently, platformSpecific is respected, but not targetSpecific. Feel free to file feature request.

@develar I'm not sure that you have understand what I'm trying to say ^^

With electron-builder v19.19.1, when I build for windows with defaults params build -w, I get a nsis installer who only works on 64 bits systems. Is it correct ?

In fact, I expected that by default, the nsis contain both 32 and 64 bits versions. What do you think to set this by default ?

So, what do you think to change the current default build settings. And automatically build and include ia32 and x64 in nsis installer by default ?

Now to do this, we should do:

"win": {
  "target": [
    {
      "target": "nsis",
      "arch": [
        "x64",
        "ia32"
      ]
    }
  ]
},

But this would be more useful to only do that (I think all people who use nsis do that to support x64 and ia32 ?) :

"win": {
  "target": [
    "nsis"
  ]
},

I don't think that it is a good default. And ia32 must die.

Yes, I think like you, but many users always run Windows with ia32.. :( So this will be more interesting for developper to support this by default.

But this is only a "question/proposal".. This is not a problem for me to add this 2 more lines in package.json to config what I want.

@popod I think you are wrong. Regardless of the choice of OS or target, a single approach to the default parameters should be maintained. It is not a good idea to build NSIS somehow differently

@cawa-93 Okey, yes I understand. Thanks for reply ;)

(In case anyone else gets here from google)

It gives me the error configuration.win has an unknown property 'arch' with the above settings. I was able to build by using this in package.json instead:

"scripts": {
  "dist": "electron-builder --ia32 --x64 -w"
}

configuration.win has an unknown property 'arch'

Same. Shame.

It doesn't look like @cawa-93's configuration works anymore in v21.2.0, at least when using the programmatic API, what are we supposed to use now?

Can u solve problem ? @fabiospampinato

@Mhmetengineer I'm using electron-builder programmatically and I'm calling it like so:

builder.build ({
  ia32: true,
  x64: true,
  win: {
    target: [
      'dir',
      'nsis',
      'zip'
    ]
  }
})

↑ Error has occurred
configuration has an unknown property 'x64'.

This worked fine
https://github.com/electron-userland/electron-builder/issues/1897#issuecomment-401117712

if both architectures are built in, how can the user choose then? I'm on mac, trying to understand.
For me this does work to get both arch's:

"win": {
      "target": {
        "target": "nsis",
        "arch": [
          "ia32",
          "x64"
        ]
      },

I don't think that it is a good default. And ia32 must die.

Yes, but still today there exist problems with 64 bit that do not exist with 32bit.
A customer updated windows server version from 2012 to 2019, together with Citrix version I guess.
Now the x64 version does not render anymore (white screen opens, html not rendered), but with only --ia32, everything is fine.

So, @develar, yes, it should die, but the software should survive :)

Was this page helpful?
0 / 5 - 0 ratings