我正在使用WiX 3.7的GenerateBootstrapper来生成我在Visual Studio部署项目中使用的引导程序。
我的Bundle.wxs
目前是一个包含单个项目的链,引用了我的MSI文件。
<Chain>
<MsiPackage Id="MyProgramInstaller" SourceFile="$(var.MyProgramInstaller.TargetPath)" Compressed="no"/>
</Chain>
我修改了我的Bootstrapper项目的.wixproj,以包含各种组件的bootstrapper生成。
...
<ItemGroup>
<ProjectReference Include="..\MyProgramInstaller\MyProgramInstaller.wixproj">
<Name>MyProgramInstaller</Name>
<Project>{my-guid}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.3.5.SP1">
<ProductName>.NET Framework 3.5 SP1</ProductName>
</BootstrapperFile>
<BootstrapperFile Include=".NETFramework,Version=v4.0">
<ProductName>.NET Framework 4.0</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="Microsoft.Windows.Installer.3.1">
<ProductName>Windows Installer 3.1</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="Microsoft.Windows.Installer.4.5">
<ProductName>Windows Installer 4.5</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="Microsoft.Sql.Server.Express.10.50.1600.1">
<ProductName>Microsoft SQL Server 2008 R2</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="Windows.Imaging.Component">
<ProductName>Windows Imaging Component</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="WindowsXP-KB921337-x86-ENUWinXPSP2">
<ProductName>Win XP SP2 Hotfix</ProductName>
</BootstrapperFile>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<!--
To modify your build process, add your task inside one of the
targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target> -->
<Target Name="AfterBuild">
<GenerateBootstrapper ApplicationFile="$(TargetFileName)"
ApplicationName="My Program"
BootstrapperItems="@(BootstrapperFile)"
ComponentsLocation="Relative"
CopyComponents="True"
OutputPath="$(OutputPath)"
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\" />
</Target>
当我构建bundle项目时,我会按预期看到我的MSI,EXE和我的必备软件包的文件夹。当我去执行我的bootstrapper exe时,我简要地看到一个对话框,指示'setup is initializing components',它被隐藏,并且一个新窗口打开了同样的东西。不知何故,设置文件递归调用自身,我无法确定原因。查看我的install.log
,似乎检查了我的所有先决条件,完成了SQL Server,并确定不需要安装任何东西(对于我的开发机器来说是真的),然后调用setup.exe
再次。直到我快速关闭设置窗口以中止下一个呼叫才会停止。它应该尝试再次调用.msi文件,而不是setup.exe,但我不确定是什么导致了这种行为。
Result of running operator 'ValueEqualTo' on property 'SQLExpressChk' and value '-2': false
Result of running operator 'ValueEqualTo' on property 'SQLExpressChk' and value '-3': false
Result of running operator 'ValueEqualTo' on property 'SQLExpressChk' and value '-4': false
Result of running operator 'ValueLessThan' on property 'SQLExpressChk' and value '-4': false
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'amd64': false
Result of running operator 'ValueNotEqualTo' on property 'SQLExpressChk' and value '1': true
Result of checks for command 'SqlExpress2008_R2\SQLEXPR_x64_ENU.EXE' is 'Bypass'
Running checks for command 'SqlExpress2008_R2\SQLEXPR32_x86_ENU.EXE'
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'amd64': false
Result of running operator 'ValueNotEqualTo' on property 'SQLExpressChk' and value '2': true
Result of checks for command 'SqlExpress2008_R2\SQLEXPR32_x86_ENU.EXE' is 'Bypass'
'SQL Server 2008 R2 Express' RunCheck result: No Install Needed
Launching Application.
Running command 'C:\Path\To\MyBootstrapper\bin\Release\setup.exe' with arguments ''
我的GenerateBootstapper
中有什么东西引起了这种情况吗?我尝试按照 How to use Wix to create Windows Installer files ? 。
答案 0 :(得分:0)
答案在于<GenreateBootsrapper>
标签。
ApplicationFile属性指的是MSI文件。 $(TargetFileName)
,这是我最初使用的,必须膨胀到setup.exe
,导致它以递归方式执行。
<Target Name="AfterBuild">
<GenerateBootstrapper
ApplicationFile="MyInstaller.msi"
ApplicationName="My Program"
BootstrapperItems="@(BootstrapperFile)"
ComponentsLocation="Relative"
CopyComponents="True"
OutputPath="$(OutputPath)"
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\" />
</Target>
但是,如何让引导程序在此文件中按变量名称定位MSI文件?