是否可以将参数发送到 InstallShield 先决条件?

Is it possible to send parameters to InstallShield prerequisites?

我正在评估 InstallShield 2010,并尝试在用户运行时将一些命令行参数设置为 SQL Server 2008 先决条件。似乎先决条件完全在 .prq 文件(xml 样式)中定义。

Wise for Windows 使用 WiseScript 调用先决条件安装。 InstallAware 似乎有类似的东西,有自己的脚本。 InstallShield 是否存在类似的东西?


我们使用 IS v12;我为此目的构建了一个 .prq 文件(他们不为 IS v12 的 SQL 2008 提供 .prq )。首先,我访问了 http://msdn.microsoft.com/en-us/library/ms144259.aspx 以获取所有可能的 cmd 行参数。然后我使用 IS PRQ 编辑器创建了基本的 .prq 结构。然后我手动编辑了 .prq (xml) 文件,以便 (a) 将来进行简单的小调整,以及 (b) 简化版本控制差异。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    <?xml version="1.0" encoding="utf-8"?>
<SetupPrereq>
    <conditions>
        <condition Type="16" Comparison="2" Path="[ProgramFilesFolder]Microsoft SQL Server\\100\\COM" FileName="sqlresld.dll" ReturnValue="2007.100.1600.22"/>
    </conditions>
    <files>
        <file LocalFile="<ISProductFolder>\\SetupPrerequisites\\Microsoft SQL Server 2008 Express with Tools\\SQLEXPRWT_x86_ENU.exe" CheckSum="BCC335711D44BAFC420B5165D2F04647" FileSize="0,229169680"/>
    </files>
    <execute file="SQLEXPRWT_x86_ENU.exe" requiresmsiengine="1"
        cmdline      ="/INSTANCEID=AV /INSTANCENAME=AV /ACTION=Install /FEATURES=SQLENGINE,SSMS /HELP=0 /ERRORREPORTING=0 /SQMREPORTING=0 /INDICATEPROGRESS=0 /QUIETSIMPLE=1 /FILESTREAMLEVEL=0 /ENABLERANU=1 /TCPENABLED=1 /NPENABLED=0 /ADDCURRENTUSERASSQLADMIN=1 /AGTSVCACCOUNT="NT AUTHORITY\
ETWORK SERVICE" /AGTSVCSTARTUPTYPE=Manual /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /SQLSVCACCOUNT="NT AUTHORITY\
ETWORK SERVICE" /RSSVCSTARTUPTYPE=Automatic"
        cmdlinesilent="/INSTANCEID=AV /INSTANCENAME=AV /ACTION=Install /FEATURES=SQLENGINE,SSMS /HELP=0 /ERRORREPORTING=0 /SQMREPORTING=0 /INDICATEPROGRESS=0 /QUIETSIMPLE=1 /FILESTREAMLEVEL=0 /ENABLERANU=1 /TCPENABLED=1 /NPENABLED=0 /ADDCURRENTUSERASSQLADMIN=1 /AGTSVCACCOUNT="NT AUTHORITY\
ETWORK SERVICE" /AGTSVCSTARTUPTYPE=Manual /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /SQLSVCACCOUNT="NT AUTHORITY\
ETWORK SERVICE" /RSSVCSTARTUPTYPE=Automatic"
    />
    <dependencies>
        <dependency File="<ISProductFolder>\\SetupPrerequisites\\Microsoft Installer 4.5 for XP.prq"/>
        <dependency File="<ISProductFolder>\\SetupPrerequisites\\Microsoft Installer 4.5 for Windows Server 2003 or 64 bit XP.prq"/>
        <dependency File="<ISProductFolder>\\SetupPrerequisites\\Power Shell 1.0 for Windows XP.prq"/>
        <dependency File="<ISProductFolder>\\SetupPrerequisites\\Power Shell 1.0 for Windows Server 2003.prq"/>
    </dependencies>
    <properties Id="Microsoft SQL Server 2008 Express with Tools" Description="This installs Microsoft SQL Server 2008 Express Edition (SQL Server Express). The /qn switch suppresses all Setup dialog boxes and error messages. See http://msdn2.microsoft.com/en-us/library/ms144259.aspx for more information about the commad line options. The SQL setup logs to %programfiles%\\Microsoft SQL Server\\100\\Setup Bootstrap\\Log"/>
</SetupPrereq>

是 - 通过右键单击 SQL Server 先决条件 -> "Application to Run"\\' 选项卡 -> "Specify the command line for the application".


我知道如何做到这一点的唯一方法是编写 PRQ 调用的 Helper.EXE。 EXE 需要检测 Windows 设置并将正确的参数静默传递给真正的 Prereq EXE/MSI。