Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - Build NSIS for both 32 and 64 bits #1897

Closed
popod opened this issue Aug 5, 2017 · 20 comments
Closed

Question - Build NSIS for both 32 and 64 bits #1897

popod opened this issue Aug 5, 2017 · 20 comments
Labels

Comments

@popod
Copy link
Contributor

popod commented Aug 5, 2017

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

@cawa-93
Copy link
Contributor

cawa-93 commented Aug 5, 2017

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

and use

$ build -wl

@popod
Copy link
Contributor Author

popod commented Aug 5, 2017

@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 ?

@cawa-93
Copy link
Contributor

cawa-93 commented Aug 5, 2017

What do you have in mind?
You can see #1314

@develar
Copy link
Member

develar commented Aug 7, 2017

when target is "nsis" for Windows build ?

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

@popod
Copy link
Contributor Author

popod commented Aug 7, 2017

@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"
  ]
},

@develar
Copy link
Member

develar commented Aug 7, 2017

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

@popod
Copy link
Contributor Author

popod commented Aug 7, 2017

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.

@cawa-93
Copy link
Contributor

cawa-93 commented Aug 7, 2017

@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

@popod
Copy link
Contributor Author

popod commented Aug 7, 2017

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

@GammaGames
Copy link

(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"
}

@hypnoboutique
Copy link

configuration.win has an unknown property 'arch'

Same. Shame.

@fabiospampinato
Copy link

fabiospampinato commented Aug 26, 2019

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?

@Mhmetengineer
Copy link

Can u solve problem ? @fabiospampinato

@fabiospampinato
Copy link

fabiospampinato commented Nov 27, 2019

@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'
    ]
  }
})

@umamichi
Copy link

umamichi commented Feb 5, 2020

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

This worked fine
#1897 (comment)

@flaushi
Copy link

flaushi commented Mar 18, 2020

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"
        ]
      },

@flaushi
Copy link

flaushi commented Mar 18, 2020

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 :)

@m4heshd
Copy link

m4heshd commented Mar 18, 2021

(In case anyone else gets here from google)

It gives me the error configuration.win has an unknown property 'arch' with the above settings.

That's because It belongs inside the config property of rawConfig. You must've added it in the root of rawConfig.

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

I think you must've done the opposite of above. Try it inside the the config.

@yeefun
Copy link

yeefun commented Oct 19, 2021

It works:

"scripts": {
  "release-win": "electron-builder --win --publish always"
},
"build": {
  "win": {
    "artifactName": "${productName} Setup ${version} ${arch}.${ext}",
    "target": [
      {
        "target": "nsis",
        "arch": [
          "x64",
          "ia32"
        ]
      }
    ]
  }
}

@0100Light
Copy link

0100Light commented Mar 21, 2024

For configuration.win has an unknown property 'arch' error, in my case (using electron-builder.yml, you have to type 2 "target"s, which looks like this:

win:
  target:
    target: nsis
    arch:
      - x64
      - ia32
  executableName: your-app-name
nsis:
  artifactName: ${name}-${version}-${arch}.${ext}
  shortcutName: ${productName}
  uninstallDisplayName: ${productName}
  createDesktopShortcut: always

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests