我正在尝试学习 NSIS 来为项目创建安装程序和卸载程序,并且我正在尝试按照教程部分中的示例进行操作。我尝试了以下脚本:-
# define the name of the installer
outfile "installer.exe"
# define the directory to install to, the desktop in this case as specified
# by the predefined $DESKTOP variable
installDir $DESKTOP\Harshit\NSIS\Scripts
# default section
section
# define the output path for this file
setOutPath $DESKTOP\Harshit\NSIS\Files
# define what to install and place it in the output path
File test1.txt
# define uninstaller name
writeUninstaller $DESKTOP\Harshit\NSIS\Scripts\uninstaller.exe
sectionEnd
# create a section to define what the uninstaller does.
# the section will always be named "Uninstall"
section "Uninstall"
# Always delete uninstaller first
delete $DESKTOP\Harshit\NSIS\Scripts\uninstaller.exe
# now delete installed file
delete $DESKTOP\Harshit\NSIS\Scripts\Files\test1.txt
sectionEnd
但是,我收到一条错误消息:
无效的脚本:从来没有 OutFile 命令。
我可以在顶部看到 outfile 命令,但我不知道为什么它不起作用。请问有什么建议吗?