2014-09-26 20 views
2

我的引导程序,setup.exe产生如下(节选是从我.wixproj文件):如何将参数传递给BootstrapperFile?

<Target Name="AfterBuild"> 
    <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 
    <BootstrapperFile Include="Microsoft.Net.Framework.3.5.SP1"> 
     <ProductName>.NET Framework 3.5 SP1</ProductName> 
    </BootstrapperFile> 
    <BootstrapperFile Include="Microsoft.VSTORuntime.4.0"> 
     <ProductName>Microsoft Visual Studio 2010 Tools for Office Runtime (x86 and x64)</ProductName> 
    </BootstrapperFile> 
    </ItemGroup> 
    </BootstrapperFile> 
    <GenerateBootstrapper ApplicationFile="$(TargetFileName)" ApplicationName="My Application" BootstrapperItems="@(BootstrapperFile)" ComponentsLocation="HomeSite" CopyComponents="False" OutputPath="$(OutputPath)" Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\BootStrapper" ApplicationRequiresElevation="True" Culture="en-US" Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' " /> 
</Target> 

msiexec支持/norestart,我想这/norestart参数传递到这些先决条件,如Office工具运行和。 NET 3.5安装程序。我不知道如何将命令行参数传递给引导程序将下载和安装的MSI。有没有任何标准的方法来实现这一目标?

回答

2

在默认的引导程序,这是我们如何传递参数从命令行:

<Wix> 
    <Bundle> 
    <Variable Name="CommandLineArgument" bal:Overridable="yes"/> 
    <Chain> 
     <MsiPackage> 
     <MsiProperty Name="CommandLineArgument" Value="[CommandLineArgument]"/> 
     </MsiPackage> 
    </Chain> 
    </Bundle> 
</Wix> 

记下BAL的:可重写。这就是我能够确保我们可以从命令行传递属性值的方式。确保将名称空间声明添加到Wix元素xmlns:bal =“http://schemas.microsoft.com/wix/BalExtension”,并链接到WixBalExtension.dll。

+0

虽然这是伟大的WiX的引导程序,我使用Microsoft Windows的引导程序生成器我的实际.wixproj文件里用上面的代码来生成它,所以我只是想知道如果我能传递任何参数微星的微软引导程序使用。 – Alexandru 2014-09-28 03:51:40

+0

@Alexandru出现混淆是因为你用[wix]标记了你的问题。 – 2014-09-28 15:44:59

+0

@TomBlodget是的,因为它是我的WiX安装程序的后构建设置的一部分。我无意造成任何混淆。我也标记为“引导程序”,但无论哪种方式,你可以说我不使用WiX的引导程序项目中的XAML看到的,但我的WiX的项目有微软的引导程序的生成后调用。 – Alexandru 2014-09-28 17:58:55