问题描述
|
我是编写安装程序/卸载程序的新手。我需要一个卸载程序来删除存储在日志文件(文本文件)中的文件。我正在尝试使用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等