卸载时并非所有内容都会被删除
我制作了一个简单的安装程序来安装 test.txt,但有几个问题:
- 开始菜单中创建的文件夹+链接未删除
- 卸载程序+文件夹未删除
有谁知道为什么?
#defines
outFile "Installer.exe"
installDir $DESKTOP\test
section
setOutPath $INSTDIR
writeUninstaller $INSTDIR\uninstaller.exe
createShortCut "$SMPROGRAMS\TestApplication\Uninstaller.lnk" "$INSTDIR\uninstaller.exe"
file test.txt
messageBox MB_OK "Hello World!"
sectionEnd
section "Uninstall"
delete $INSTDIR\uinstaller.exe
delete "$SMPROGRAMS\TestApplication\Uninstaller.lnk"
delete $INSTDIR\test.txt
sectionEnd
I've made a simple installer that installs test.txt, but there are several problems:
- The created folder+link in start menu isn't deleted
- The uninstaller + folder isn't deleted
Does anyone know why?
#defines
outFile "Installer.exe"
installDir $DESKTOP\test
section
setOutPath $INSTDIR
writeUninstaller $INSTDIR\uninstaller.exe
createShortCut "$SMPROGRAMS\TestApplication\Uninstaller.lnk" "$INSTDIR\uninstaller.exe"
file test.txt
messageBox MB_OK "Hello World!"
sectionEnd
section "Uninstall"
delete $INSTDIR\uinstaller.exe
delete "$SMPROGRAMS\TestApplication\Uninstaller.lnk"
delete $INSTDIR\test.txt
sectionEnd
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
并使用
RmDir "$INSTDIR"删除命令后删除安装文件夹
http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
and use
RmDir "$INSTDIR"
after the delete commands to delete the install folder除了指出您从未调用 RmDir $INSTDIR 的答案之外,您还错误地输入了卸载程序可执行文件名称:
您错过了“n”。
In addition to the answers pointing out that you never call RmDir $INSTDIR, you've also mistyped the uninstaller executable name:
You've missed the 'n'.