NSIS中的卸载脚本

问题描述

| 我是编写安装程序/卸载程序的新手。我需要一个卸载程序来删除存储在日志文件(文本文件)中的文件。我正在尝试使用NSIS脚本来实现该功能,但是我无法遵循以下链接: http://nsis.sourceforge.net/对话:Uninstall_only_installed_files 基本上,我需要实现以下四行代码:
OutFile \"dummy.exe\" 
Section \"Uninstall\"
!include \"unlist.txt\"
!system \'del unlist.txt\'
SectionEnd
include语句显示错误,因为我在unlist.txt中以错误的格式附加了文件名。 编译结果:
OutFile: \"dummy.exe\"
Section: \"Uninstall\"
!include: \"unlist.txt\"
File: \"Test1.txt\" [compress] 4 bytes
File: \"Test2.txt\" [compress] 0/4 bytes
File: \"Test3.txt\" [compress] 0/4 bytes
File: \"Test4.txt\" [compress] 0/4 bytes
!include: closed: \"unlist.txt\"
SectionEnd
处理了1个文件,写入输出:
Error: invalid script: no sections specified
Error - aborting creation process
有人可以在unlist.txt中建议我使用正确的脚本或正确的文件格式吗? 谢谢你的帮助。 最好的祝福, 彼得     

解决方法

您的安装程序至少需要看起来像这样:
OutFile \"dummy.exe\"

Section 01
# This is install section
WriteUninstaller \"Uninstall.exe\"
SectionEnd

Section \"Uninstall\"
!include \"unlist.txt\"
!system \'del unlist.txt\'
SectionEnd
必须存在一个安装部分,并且已创建了简单的卸载程序(在temp目录中)。 您需要指定更多代码才能正常工作:例如设置$ INSTDIR等     

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...