electron-builder构建的安装包,安装时通过nsis脚本自动导入注册表
需求
怎么做
"build": { "appId": "com.cendc.id", "asar": false, "directories": { "output": "installer" }, "win": { "target": [ "nsis" ] }, "publish": [ { "provider": "generic", "url": "http://192.168.4.101:9090/installer/" } ], "nsis": { "include": "script/installer.nsh", "oneClick": false, "perMachine": true, "allowToChangeInstallationDirectory": true } },!macro customInstall WriteRegStr HKCR "CenDC" "URL Protocol" "" WriteRegStr HKCR "CenDC" "" "URL:CenDC Protocol Handler" WriteRegStr HKCR "CenDC\shell\open\command" "" '"$INSTDIR\CenDC.exe" "%1"' !macroendWindows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\CenDC] "URL Protocol"="" @="URL:CenDC Protocol Handler" [HKEY_CLASSES_ROOT\CenDC\shell] [HKEY_CLASSES_ROOT\CenDC\shell\open] [HKEY_CLASSES_ROOT\CenDC\shell\open\command] @="\"C:\\Program Files\\CenDC\\CenDC.exe\" \"%1\""
Last updated