Electron create MSI installer using electron
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/electron-builder.
I ended up having a folder with a working .exe
"dist:win64": "./node_modules/.bin/build --platform win32 --arch x64"
The build section of my main package.json is
"build": {
"app-bundle-id": "org.test.mytest",
"app-category-type": "public.app-category.graphics-design",
"osx": {
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file"
}
]
},
"win": {
"title": "My awesome app",
"version": "2.28.999.1",
"noMsi": false,
"authors": "Author"
}
}
Everything works fine, I have and .exe installer but no way to have an .msi installer that put the content in program files directory.
Instead I ended up with an installation in the C:UsersUserHomeAppDataLocalelectron folder with and installer like below.
Is there a way to have a real .msi installer using electron builder that put the content in the Program file folder. The only one project that worked is this one https://github.com/theodo/electron-boilerplate but it uses a former version of electron-builder.
In the electron doc setting the noMsi
to false, should do the trick ...
Should Squirrel.Windows create an MSI installer?
我还没有得到这个工作(但),但我的理解是,这是相反的(可怕的命名)。
"noMsi": false // will make an MSI
"noMsi": true // will NOT make an MSI
正如最新的电子制造商版本的wiki中所述,您必须在build.win
使用msi
选项:
"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"
}
}
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.