如何为Electron应用安装程序设置自定义路径 [英] How to set a custom path for Electron app installer
问题描述
是否可以在电子应用程序安装过程中向用户询问自定义安装路径?
Is there a way to ask custom installation path to the user during electron app installation?
推荐答案
即使我设置了allowToChangeInstallationDirectory确实,编译的安装程序没有给我选择路径的机会。我发现我的模块已经过时了。更新之后,我设法得到了想要的东西。因此,如果您有任何问题,请确保您的模块支持最新更新
Even if I set allowToChangeInstallationDirectory to true, compiled installer was not giving me the opportunity select the path. I found that my modules were outdated. After an update I managed to get what I wanted. So If you have any problem make sure that your modules are supporting recent updates
另一个重要的问题是正确设置package.json。如果您正在使用nsis并在Windows Machne上进行操作,则需要在package.json中声明以下内容。
Another important issue is setting your package.json correctly. if you are using nsis and doing it on windows machne you need to declare something below in the package.json.
"win": {
"icon": "build/icon.ico",
"target": "nsis"
},
"nsis": {
"allowElevation": false,
"allowToChangeInstallationDirectory": true,
"oneClick": false,
"perMachine": true
},
这篇关于如何为Electron应用安装程序设置自定义路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!