How to deploy an Electron app as an executable or installable in Windows?

后端 未结 9 1379
渐次进展
渐次进展 2020-11-30 20:14

I want to generate a unique .exe file to execute the app or a .msi to install the application. How to do that?

相关标签:
9条回答
  • 2020-11-30 20:38

    well ... this will work but the idea is to run the .exe without need of install it in the pc ... another solution is use Autoplay media Studio for wrap you package generated by electron and make one executable or other solution is to use thinstall vmware... The cons both are commercial so you have to paid for them...

    0 讨论(0)
  • 2020-11-30 20:39

    2020 Update You can use electron-builder to create portable .exe file for your electron app. All you need to do is install electron-builder with yarn add electron-builder --dev Then create a package.json file like this(this is just for portable .exe):

    {
      "name": "my-electron-app",
      "productName": "electron app",
      "version": "1.0.0",
      "description": "an electron app",
      "main": "main.js",
      "scripts": {
        "start": "electron .",
        "dist": "electron-builder"
      },
      "devDependencies": {
        "electron": "^8.0.2",
        "electron-builder": "^22.3.2"
      },
      "build": {
        "appId": "com.electron.app",
        "win": {
          "target": "portable"
        },
        "portable": {
          "unicode": false,
          "artifactName": "my_electron_app.exe"
        }
      }
    }
    
    0 讨论(0)
  • 2020-11-30 20:44

    You might be able to "wrap" the entire electron app in a .NET project. Then the single executable that it creates can then just "internally" run the electron app.

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