NSIS - 如何覆盖“un.onInit”打回来
我是 NSIS 脚本编写的新手,我想在弹出默认卸载窗口之前添加提示消息。如果他们单击“继续”,卸载将继续并显示默认卸载窗口,但如果他们单击“取消”,卸载将停止并且不会删除任何应用程序文件。
谢谢。
我尝试了这个脚本:
Function un.onInit
MessageBox MB_YESNO "This will uninstall. Continue?"
FunctionEnd
但运行电子生成器时出现错误:
Error: Function named "un.onInit" already exists.
!include: error in script: "uninstaller.nsh" on line 5
I am new in NSIS scripting, and I want to add a prompt message before the default uninstall window pop up. And if they click Proceed, uninstalling will continue by showing the default uninstall window, but if they click Cancel, uninstalling will stop and won't delete any application files.
Thank you.
I tried this script:
Function un.onInit
MessageBox MB_YESNO "This will uninstall. Continue?"
FunctionEnd
But I'm getting an error when running electron-builder:
Error: Function named "un.onInit" already exists.
!include: error in script: "uninstaller.nsh" on line 5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Electron 已经将回调用于其自身目的,但它确实提供了您可以使用的宏选项。请参阅其文档中的自定义脚本部分。
在自定义 .nsh 中,只需添加宏:
Electron is already using that callback for its own purpose but it does provide the option of a macro you can use. See the custom script section in their documentation.
In the custom .nsh, simply add the macro: