NSIS 中的卸载脚本
我是编写安装程序/卸载程序的新手。我需要一个卸载程序来删除存储在日志文件(文本文件)中的文件。我正在尝试使用 NSIS 脚本实现该功能,但我无法执行以下链接: http://nsis.sourceforge.net/Talk: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 中提及正确的文件格式吗?
感谢您的帮助。
此致, 彼得
I am a newbie in writing an installer/uninstaller. I need an uninstaller to delete the files stored in the log file (text file). I am trying to implement the functionality using NSIS script but I couldn't though I followed the below link :
http://nsis.sourceforge.net/Talk:Uninstall_only_installed_files
Basically I need to implement the following four lines of code:
OutFile "dummy.exe"
Section "Uninstall"
!include "unlist.txt"
!system 'del unlist.txt'
SectionEnd
The include statement shows an error as I've appended the file names with wrong format in unlist.txt .
Compilation result:
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
Processed 1 file, writing output:
Error: invalid script: no sections specified
Error - aborting creation process
Can anyone advise me with a correct script or the correct format of file need to be mentioned in the unlist.txt ?
Thanks for your help.
Best Regards,
Peter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的安装程序至少需要如下所示:
必须存在一个安装部分,并创建简单的卸载程序(在临时目录中)。
您需要指定更多代码才能正常工作:例如设置 $INSTDIR 等。
Your installer need to look at least like this:
One install section must exists and simple uninstaller is created (in temp directory).
You need to specify more code to work correctly: e.g. set $INSTDIR etc.