问题
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <Bundle Name="My Test Program" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="cc7cfeae-c3a4-4430-841e-f927de3f9f95">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<util:RegistrySearch Id="FindDotNet35SP1InstallRegValue" Root="HKLM"
Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" Value="SP"
Variable="DotNetFramework35SP1InstallRegValue" />
<util:RegistrySearch Id="FindDotNet40FullInstallRegValue" Root="HKLM"
Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" Value="Install"
Variable="DotNetFramework40FullInstallRegValue" />
<Chain>
<ExePackage Id="DotNet3.51" Cache="no" Compressed="no" Vital="no"
PerMachine="yes" Name="DotNet3.51"
SourceFile=".\sources\dotnetfx35sp1_full_x86_x64.exe"
InstallCommand="/passive /promptrestart" Permanent="yes"
DownloadUrl="http://webserver/dependencies/dotnetfx35sp1_full_x86_x64.exe"
DetectCondition="DotNetFramework35SP1InstallRegValue=1" />
<ExePackage Id="DotNet4.0" Cache="no" Compressed="no" Vital="no"
PerMachine="yes" Name="DotNet4.0"
InstallCommand="/passive /promptrestart" Permanent="yes"
SourceFile=".\sources\dotnetfx40_full_x86_x64.exe"
DownloadUrl="http://webserver/dependencies/dotnetfx40_full_x86_x64.exe"
DetectCondition="DotNetFramework40FullInstallRegValue=1" />
<ExePackage Id="ClientInstall" Cache="no" Compressed="no" Vital="yes"
PerMachine="yes" Name="ClientInstall"
SourceFile=".\sources\client_win32-setup.exe" />
</Chain>
</Bundle>
Okay, this is my source code. Say, a machine is never installed with .NET 3.5 SP1 and .NET 4.0. So, now I run the setup.exe file. I purposely cancel the .NET 3.5 SP1 and .NET 4.0 installation, but then it still executes to install the client_win32-setup.exe... How do I check the condition if only the first two had successfully installed before the client installation?
But then I added detectcondition, and it never worked as I expected. The DetectCondition="NOT ((DotNetFramework35SP1InstallRegValue=1) AND (DotNetFramework40FullInstallRegValue=1))" is pre-executed and not after the .NET installation.
<ExePackage Id="ClientInstall" Cache="no" Compressed="no" Vital="yes"
PerMachine="yes" Name="ClientInstall"
SourceFile=".\sources\client_win32-setup.exe"
DetectCondition="NOT ((DotNetFramework35SP1InstallRegValue=1) AND (DotNetFramework40FullInstallRegValue=1))" />
Is there a way to solve this kind of sequence validation issue?
回答1:
What you are seeing is the expected behavior. Burn creates a "plan" that defines all the work that should be done and executes it. Once planned, there is forward progress until a vital package causes a failure and then rollback occurs. It sounds like you need one of the ExePackages before the ClientInstall
package to be marked Vital="yes"
, so the install does not continue if it is not installed.
来源:https://stackoverflow.com/questions/8117760/bootstrapping-sequence-validation-issue-using-wix-3-6-and-burn