使用 WiX 3.6 和 Burn 的引导序列验证问题 [英] Bootstrapping sequence validation issue using WiX 3.6 and Burn

查看:34
本文介绍了使用 WiX 3.6 和 Burn 的引导序列验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<util:RegistrySearch Id="FindDotNet40FullInstallRegValue" Root="HKLM"Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" Value="安装"变量="DotNetFramework40FullInstallRegValue"/><链><ExePackage Id="DotNet3.51" Cache="no" Compressed="no" Vital="no"PerMachine="yes" 名称="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" 名称="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" 名称="ClientInstall"SourceFile=".\sources\client_win32-setup.exe"/></链></捆绑包>

好的,这是我的源代码.比如说,一台机器从来没有安装过 .NET 3.5 SP1 和 .NET 4.0.所以,现在我运行 setup.exe 文件.我故意取消了.NET 3.5 SP1 和.NET 4.0 的安装,但它仍然执行以安装client_win32-setup.exe...如果在客户端安装之前仅成功安装了前两个,我如何检查条件?

但后来我添加了检测条件,但它从未按我预期的那样工作.DetectCondition="NOT ((DotNetFramework35SP1InstallRegValue=1) AND (DotNetFramework40FullInstallRegValue=1))" 是预先执行的,而不是在 .NET 安装之后执行.

 <ExePackage Id="ClientInstall" Cache="no" Compressed="no" Vital="yes"PerMachine="yes" 名称="ClientInstall"SourceFile=".\sources\client_win32-setup.exe"DetectCondition="NOT ((DotNetFramework35SP1InstallRegValue=1) AND (DotNetFramework40FullInstallRegValue=1))"/>

有没有办法解决这种序列验证问题?

解决方案

您看到的是预期的行为.Burn 创建一个计划",定义所有应该完成的工作并执行它.一旦计划好,就会有向前的进展,直到一个重要的包导致失败,然后发生回滚.听起来您需要将 ClientInstall 包之前的 ExePackages 之一标记为 Vital="yes",因此如果未安装,安装将不会继续.>

<?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?

解决方案

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.

这篇关于使用 WiX 3.6 和 Burn 的引导序列验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆