Electron create MSI installer using electron-builder

后端 未结 5 1584
无人及你
无人及你 2021-02-13 00:24

I managed to create an .exe installer for windows using electron builder, I create 2 package.json as pointed out in the docs :

https://github.com/electron-userland/elec

相关标签:
5条回答
  • 2021-02-13 00:29

    I haven't gotten this to work either (yet), but my understanding is that it's the opposite (terrible naming).

    "noMsi": false // will make an MSI
    "noMsi": true // will NOT make an MSI
    
    0 讨论(0)
  • 2021-02-13 00:32

    as stated in the wiki of latest electron builder release you have to use the msi option within build.win:

    "build": {
        "app-bundle-id": "org.test.mytest",
        "app-category-type": "public.app-category.graphics-design",
        ...
        ,
        "win": {
          "title": "My awesome app",
          "version": "2.28.999.1",
          "msi": true,
          "authors": "Author"
        }
      }
    
    0 讨论(0)
  • 2021-02-13 00:40

    You don't actually need an MSI installed to get your app installed into Program Files.

    If you disable one click in the nsis config (oneClick), the user is prompted whether to do the single user install (in AppData) or per machine (in Program Files).

    If you don't want to give them the choice, you can set perMachine to false which will only allow install into Program Files:

    "nsis": {
      "oneClick": false,
      "perMachine": false
    },
    

    I would personally leave them the option as they can still install without admin rights!

    In the latest version of electron-builder there is also a allowToChangeInstallationDirectory option which allows the user to choose any install location.

    0 讨论(0)
  • 2021-02-13 00:44

    I figured it out by looking at the target. do this

    "win": {
      "target": [
       "msi"
       ]
    //your code here
    },
    
    0 讨论(0)
  • 2021-02-13 00:56

    If all you want is an installer in exe format (I don't know about msi) you can use electron-builder to build the exe unpacked to a directory. Check out the documentation at http://npmjs.org/package/electron-builder. The documentation is pretty straight forward. After you obtain the unpacked folder with your exe , use "Inno Setup Compiler" to create a professional looking installer. Once you get the hang of it , it just takes like 5 minutes to do the whole thing.

    0 讨论(0)
提交回复
热议问题