NSIS:卸载时删除文件夹
我想在卸载应用程序时删除 Startmenu\XXX
文件夹和 Program Files\XXX
菜单。
尝试过 RMDir /r
但这对我不起作用。 (Windows 7)
I want to delete the Startmenu\XXX
folder and Program Files\XXX
menu upon uninstall for the application.
Tried RMDir /r
but this does not work for me.
(Windows 7)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
RMDir 是正确的指令,您的路径可能是错误的。
删除开始菜单的一个常见问题是忘记使用 RequestExecutionLevel,请参阅 NSIS wiki 上的此页面
进程监视器可以帮助您检测路径和权限问题...
RMDir is the correct instruction, your path is probably wrong.
A common issue with startmenu removal is forgetting to use RequestExecutionLevel, see this page on the NSIS wiki
Process Monitor can help you detect path and privilege issues...
有时,Windows 不允许您删除仍在使用的文件夹。解决方案是将文件夹(和/或文件)标记为在下次系统重新启动时删除。为此,请使用标志 /REBOOTOK
对于文件:
对于文件夹
下次重新启动后,文件/文件夹将被删除。
另请参阅:http://nsis.sourceforge.net/Reference/RMDir
Occasionally Windows won't let you remove a folder when it's still in use. The solution is to mark the folder (and/or files) for deletion on next system reboot. For this, use the flag /REBOOTOK
For files:
For folders
After next reboot, the files/folders will be removed.
See also: http://nsis.sourceforge.net/Reference/RMDir
这是您的解决方案:
添加“SetShellVarContext all”
http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
示例代码:
-joedf
Here's your solution:
add "SetShellVarContext all"
http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
Example code:
-joedf