问题
When using the generic bootstrapper with MSBuild how is the order of installation of prerequisite items determined?
For example, given:
<Project ToolsVersion="3.5" xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<ItemGroup>
<BootstrapperFile Include='A' />
<BootstrapperFile Include='B' />
<BootstrapperFile Include='C' />
<BootstrapperFile Include='D' />
</ItemGroup>
<Target Name='MySetup'>
<GenerateBootstrapper
Path='C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper'
ApplicationName='My Program'
ApplicationFile='MyProgram.msi'
BootstrapperItems='@(BootstrapperFile)'
Culture='en'
CopyComponents='true'
ComponentsLocation='HomeSite'
OutputPath='.\' />
</Target>
</Project>
What is the order that A, B, C, and D get installed? How do I control that order?
回答1:
It looks like I can specify in the product manifest with the DependsOnProduct
tag:
<Product ProductCode="A">
<PackageFiles>...</PackageFiles>
<RelatedProducts>
<DependsOnProduct Code="B" />
</RelatedProducts>
...
</Product>
This should result in B
being installed before A
.
http://msdn.microsoft.com/en-us/library/ms229456.aspx
回答2:
You seem to have already answered your own question. As you allude to in your answer, the order of the products in determined by the pacakges themselves. Your msi is always installed last.
The packages can be found in (for VS2008):
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
Eeach package contains it's own bootstrapper manifest file where the prerequisites are set. You shouldn't have to worry about this for the provided packages from microsoft. You really should only care if you're creating your own packages for your pre-requisites.
来源:https://stackoverflow.com/questions/471405/bootstrapper-prerequisite-ordering