使用安装程序开关在NSIS脚本中运行MSIEXEC

使用安装程序开关在NSIS脚本中运行MSIEXEC

本文介绍了使用安装程序开关在NSIS脚本中运行MSIEXEC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建NSIS安装程序并将其与必要的驱动程序(来自供应商的MSI文件)打包在一起.最终,我想在背景中静默安装这些驱动程序.但是,我似乎无法正常工作.

I'm trying to build an NSIS installer and package it with necessary drivers (MSI files from the vendor). Eventually, I'd like to install these drivers silently in the backgroud. However, I cannot seem to get it working properly.

在我的NSIS脚本中,我有以下内容:

In my NSIS script, I have the following:

ExecWait 'msiexec /i "$INSTDIR\Flash.msi INSTALLDIR="$INSTDIR\Drivers\Flash""'

似乎执行了;如果我从上述片段中删除了INSTALLDIR开关,它将按预期运行驱动程序安装.但是当我把它放在里面时,我会被下面的窗口打招呼

It seems to execute; if I remove the INSTALLDIR switch from the above snippet, it'll run the driver installation as expected. But when I leave it in, I'm instead greeted by the following window

但是,直接在Powershell中运行以下命令完全可以实现我想要的,并按预期设置适当的安装目录:

However, running the following directly in Powershell does exactly what I want, sets the install directory appropriately, as expected:

.\Flash.msi INSTALLDIR=".\Drivers\Flash\"

我猜这是一个愚蠢的引号不匹配,但是我已经尝试了很多,并且得到了相同的结果.

I'm guessing it's a silly quotation-mark mismatch somewhere, but I've tried so many already and I get the same results.

推荐答案

.msi路径的双引号关闭太晚了.

Your doublequote for the .msi path is closed too late.

使用

ExecWait 'msiexec /i "$INSTDIR\Flash.msi" INSTALLDIR="$INSTDIR\Drivers\Flash"'

这篇关于使用安装程序开关在NSIS脚本中运行MSIEXEC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 17:38