我们用NSIS打包electron做的exe时,默认安装路径都是C盘,如果想要修改默认安装路径,就需要写个NSIS脚本来修改。 1.package.json的nsis里添加 "include": "build/script/installer.nsh" 2.新建文件installer.nsh !macro preInit SetRegView 64 WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "D:\...
在installer.nsh里加入这个代码即可 !macro preInit SetRegView 64 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\{GUID}" "UninstallString" ${If} $0 == '' WriteRegStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$PROFILE\AppData\Local\Programs\{APPNAME}" ${Endif} Set...
我们用NSIS打包electron做的exe时,默认安装路径都是C盘,如果想要修改默认安装路径,就需要写个NSIS脚本来修改。 1.package.json的nsis里添加: 2.新建文件