尝试执行 exe 时,NSIS ExecWait 返回 6
嗨,我在 NSIS 上遇到了一个恼人的问题。
我正在尝试编写脚本来安装 Office 2007 的 SaveAsPdfAndXps.exe 插件/插件。
这是我的脚本:
Section "SaveAsPdf"
DetailPrint "Installing SaveAsPdfAndXps Extension"
File 'Prereq\SaveAsPDFandXPS.exe'
ExecWait '$TEMP\SaveAsPDFandXPS.exe' $0
DetailPrint "SaveAsPDFandXPS exit code = $0"
; Delete '$TEMP\SaveAsPDFandXPS.exe'
SectionEnd
所以我正在运行 Windows 7 x64,我已经安装了安装了此扩展的 Office 07。但是,如果我通过单击并手动安装它来自行运行该exe,它不会中止它,而是会很好地安装。
现在上面的脚本打印出退出代码6!?如果我评论删除位,我在临时目录中看不到该文件?我怎样才能知道发生了什么事?
SaveAsPDFandXPS 扩展在临时目录中输出日志文件。如果手动执行,但脚本不会发生这种情况。
当编译的设置执行时,它确实会要求海拔高度。
问候,
Hi I have an annoying problem with NSIS.
I'm trying to write script to install the SaveAsPdfAndXps.exe plugin/addin for Office 2007.
Here is my script:
Section "SaveAsPdf"
DetailPrint "Installing SaveAsPdfAndXps Extension"
File 'Prereq\SaveAsPDFandXPS.exe'
ExecWait '$TEMP\SaveAsPDFandXPS.exe' $0
DetailPrint "SaveAsPDFandXPS exit code = $0"
; Delete '$TEMP\SaveAsPDFandXPS.exe'
SectionEnd
So I'm running Windows 7 x64, I already have Office 07 with this extension installed. However, if I run the exe on my own by clicking it and installing it manually it doesn't abort it just installs nicely.
Now the above script, prints out exit code 6!? And the if I comment the Delete bit, I don't see the file in my temp directory? How do I find out whats going on?
The SaveAsPDFandXPS extension outputs a log file in the temp dir. if executed manually, but it doesn't happen with the script.
When the compiled setup executes, it does ask for elevation btw.
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您发布的代码不完整, File 指令将文件提取到 $outdir ,除非您使用 /oname 开关, $outdir 由 InstallDir 或 SetOutPath 设置,并且两者都没有出现在您的代码中,因此无法知道您提取到哪里。 ..
尝试将其更改为:
$PluginsDir 永远不会与其他应用程序冲突,$Temp 与其他应用程序共享,因此通常最好将内容放在 $PluginsDir 中。
要在没有提升的情况下运行,请添加
RequestExecutionLevel User
The code you posted is incomplete, the File instruction extracts files to $outdir unless you use the /oname switch, $outdir is set by InstallDir or SetOutPath and neither appear in your code so there is no way to tell where you are extracting to...
Try changing it to:
$PluginsDir will never conflict with other apps, $Temp is shared with other apps, so it is usually better to put things in $PluginsDir.
To run without elevation, add
RequestExecutionLevel User