我正在努力学习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命令,但我不知道为什么它不起作用。有什么建议吗?
发布于 2013-03-18 05:20:51
它是否像处理一个.nsi文件并将一个不同的.nsi文件传递给编译器一样简单?
您可以在脚本的顶部添加!error "Hello World"或类似的简单内容,以找出.
编辑:
如果无法打开用于编写输出文件的输出文件,则错误消息应该是“无法打开输出文件”,并且与OutFile无关。
除非您传入带有stdin的脚本,否则它应该选择.nsi文件名作为基本名称,即使根本不使用OutFile。
请您显示您传递给makensis.exe的确切参数和真实脚本的副本。
https://stackoverflow.com/questions/15469047
复制相似问题