【发布时间】:2018-09-27 04:43:45
【问题描述】:
我想更改 Windows 上的安装目录,我的 Electron 应用是使用 electron-builder 构建的。
我尝试将installer.nsh 文件放在构建文件夹中,但还是一样,它总是安装在默认路径AppData/Roaming/ 下。
这是我的installer.nsh:
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\CustomPath"
!macroend
有没有人设法用 electron-builder 更改默认安装目录?
谢谢!
【问题讨论】:
-
你的目标是一键安装还是安装目录可变的辅助安装?
-
我认为我使用的是 oneclick 安装程序。我有
target:["nsis"] -
以上代码取自the docs,我发现这破坏了我的卸载程序。