- 安装软件NSIS_V2.46_20101210.exe
- Copy“KillProcDLL.dll” 、“ShellExecAsUser.dll”至C:\Program Files (x86)\NSIS\Plugins目录
这些插件可以在官网下载http://nsis.sourceforge.net/Category:Plugins,安装指导说明可参照https://www.cnblogs.com/modou/p/3573772.html
重启后删除指定文件,文件夹
Delete /REBOOTOK "$INSTDIR\test.dll"
RMDir /r /REBOOTOK "$INSTDIR\"
提示是否需要重启系统?
Function un.onUninstSuccess
HideWindow
;MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) 已成功地从您的计算机移除。部分文件需要在重启之后删除。"
MessageBox MB_YESNO|MB_ICONQUESTION "部分文件需要在重启之后删除,你希望重启系统吗?" IDNO +2
Reboot
FunctionEnd
如果重启失败
Function .onRebootFailed
MessageBox MB_OK|MB_ICONSTOP "重启失败,请手动重启。" /SD IDOK
FunctionEnd