首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NSIS错误:无效脚本:从未有OutFile命令

NSIS错误:无效脚本:从未有OutFile命令
EN

Stack Overflow用户
提问于 2013-03-18 02:50:38
回答 1查看 1.9K关注 0票数 1

我正在努力学习NSIS为一个项目创建一个安装程序和一个卸载程序,并且我试图遵循教程部分中的例子。我试过以下脚本:-

代码语言:javascript
复制
# 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命令,但我不知道为什么它不起作用。有什么建议吗?

EN

回答 1

Stack Overflow用户

发布于 2013-03-18 05:20:51

它是否像处理一个.nsi文件并将一个不同的.nsi文件传递给编译器一样简单?

您可以在脚本的顶部添加!error "Hello World"或类似的简单内容,以找出.

编辑:

如果无法打开用于编写输出文件的输出文件,则错误消息应该是“无法打开输出文件”,并且与OutFile无关。

除非您传入带有stdin的脚本,否则它应该选择.nsi文件名作为基本名称,即使根本不使用OutFile。

请您显示您传递给makensis.exe的确切参数和真实脚本的副本。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15469047

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档