如何解决无法通过电子生成器自定义 NSIS 包含脚本注册和取消注册 .dll 文件
我创建了一个 electron 桌面应用程序并使用 electron-builder 创建了一个安装程序。
现在我想在我的桌面应用程序的 registering
时添加 .dll
一个 installation
文件的功能,并在 {{1} 时添加 unregistering
}.
我的 uninstallation
文件是
installer.nsh
我的 !macro customInstall
Exec "regsvr32.exe $INSTDIR\resources\app.asar.unpacked\node_modules\obs-studio-node\obs-virtualsource.dll"
!macroend
!macro customUnInstall
Exec "regsvr32.exe /u $INSTDIR\resources\app.asar.unpacked\node_modules\obs-studio-node\obs-virtualsource.dll"
!macroend
配置是
electron-builder
但这对我不起作用。我试过 "build": {
"nsis": {
"include": "installer.nsh"
},"mac": {
"icon": "build/icon.png"
},"win": {
"icon": "build/icon.png"
}
}
和 Exec
都没有效果。
我缺少什么才能使它工作?
解决方法
您是否以管理员身份运行安装程序? 注册 .dll 需要管理员权限。
首先在脚本中设置管理员权限:
RequestExecutionLevel 管理员
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。