Electron-builderWindows平台打包安装后执行指定的bat脚本(exe)

Electron-builderWindows平台打包安装后执行指定的bat脚本(exe)

2023年7月4日发(作者:)

Electron-builderWindows平台打包安装后执⾏指定的bat脚本(exe) 1. ⽂件 build 下的 nsis 和 win 配置"nsis": { "oneClick": false, "allowElevation": true, "allowToChangeInstallationDirectory": true, "installerIcon": "./build/icons/", "uninstallerIcon": "./build/icons/", "installerHeaderIcon": "./build/icons/", "createDesktopShortcut": true, "createStartMenuShortcut": true, "shortcutName": "e-mbms-client", "include": "./build/script/" }"win": { "icon": "build/icons/", "requestedExecutionLevel": "highestAvailable", "artifactName": "${productName}_windows_${version}.${ext}", "target": [ { "target": "nsis", "arch": [ "x64" ] } ]} 2. include 核⼼属性 ,⽤于exe执⾏⽂件安装后执⾏的nsh脚本(下⾯是 脚本内容)!macro customInstall WriteRegStr HKLM "SOFTWAREMicrosoftWindows NTCurrentVersionWindows" "AppInit_DLLs" "$" WriteRegDWORD HKLM "SOFTWAREMicrosoftWindows NTCurrentVersionWindows" "LoadAppInit_DLLs" "1" WriteRegStr HKLM "SOFTWAREMicrosoftWindowsCurrentVersionRun" "xxxx" '"$" /start' ExecWait "$"!macroend!macro customUninstall DeleteRegKey HKCR "*shellxxxx"!macroend 3. ExecWait 执⾏bat脚本(下⾯是脚本内容)@ echo offset currPath=%~dp0echo e-mbms-client start installation ...echo %currPath%:: 写⼊注册表:: reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWindows" /v LoadAppInit_DLLs /t REG_DWORD /d 1 /f:: copy⽂件copy "%currPath%" C:WindowsSystem32driverscopy "%currPath%resourceswindowsdllsystem32*" C:WindowsSystem32copy "%currPath%resourceswindowsdllsysWOW64*" C:WindowsSysWOW64:: 执⾏dllregsvr32 /s "%currPath%":: 执⾏inf⽂件写⼊启动rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 %currPath%o e-mbms-client installation complete ...::重启电脑shutdown -r -t 3:: reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWindows" /v AppInit_DLLs /t REG_SZ /d "%currPath%"微笑的java欢迎关注转发评论点赞沟通,让编码不在孤单。

发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1688473021a141781.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信