【问题标题】:Adding WIC as a requirement before .NET 4.0 in WiX Burn custom Managed Bootstrapper在 WiX Burn 自定义托管引导程序中添加 WIC 作为 .NET 4.0 之前的要求
【发布时间】:2012-10-04 12:43:19
【问题描述】:

我在获取带有自定义托管引导程序应用程序的刻录包时遇到问题,以便在某些不附带 Windows 映像组件的平台上启动,这是安装 .NET 4.0 所必需的(Windows 2003 就是其中之一)。

我们使用标准方法来定义托管引导程序应用程序的要求:

<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full"/>

当此引导程序在新安装的 Windows 2003 R2 机器上运行时,它会启动 .NET 的标准要求安装程序,然后失败并出现错误。

我们已尝试通过执行以下操作来解决此问题(所有不必要的内容都被剪掉了):

...
<!-- Define WIC packages -->
<PackageGroup Id="PG.WIC">      
  ...
  <ExePackage Id="EP.wic_x64_enu" Cache="no" Compressed="no"  PerMachine="yes" Permanent="yes" Vital="no"  
     DisplayName="Windows Imaging Component for Windows Server 2003 x64"
     Name="{4A85FFDB-5563-4FE9-9C0E-C780A271BCC7}\WIC\wic_x64_enu.exe"
     SourceFile="$(var.SetupPrereq_SRC)\WindowsImagingComponent\x64\wic_x64_enu.exe"
     DownloadUrl="http://download.microsoft.com/download/6/4/5/645fed5f-a6e7-44d9-9d10-fe83348796b0/wic_x64_enu.exe"
     InstallCondition="(VersionNT=v5.2 AND VersionNT64 AND NOT NETFRAMEWORK40FULL)"
     InstallCommand="/q /norestart">
  </ExePackage>
</PackageGroup>
...
<!-- Define our own .NET package, and set it to be after the WIC package -->
<PackageGroup Id="PG.NetFx40Full">
  <ExePackage Id="EP.NetFx40Full" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes" Protocol="netfx4" 
      DisplayName="Microsoft .NET Framework 4"
      Name="{4A85FFDB-5563-4FE9-9C0E-C780A271BCC7}\NetFx\dotNetFx40_Full_x86_x64.exe"
      SourceFile="$(var.SetupPrereq_SRC)\NetFx\dotNetFx40_Full_x86_x64.exe"
      DownloadUrl="http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe"
      DetectCondition="NETFRAMEWORK40FULL"
      InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log %TEMP%\PG.NetFx40Full.log"
      RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot;"        
      After="EP.wic_x64_enu"        >
  </ExePackage>
</PackageGroup>
...
<!-- Change wixmbaprereqpackageid to point to our own package-->
<WixVariable Id="WixMbaPrereqPackageId" Value="PG.Netfx4Full" Overridable="no"/>
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
...
<Chain>
  <!--Windows Imaging Component-->
  <PackageGroupRef Id="PG.WIC"/>

  <!--.Net Framework 4 -->      
  <!--Custom offline package.-->
  <PackageGroupRef Id="PG.NetFx40Full"/>
  ...
</Chain>
...

这不起作用。 prereq 安装程序像往常一样启动,但是当您单击按钮开始安装时,进度条会闪烁一秒钟,然后安装程序退出。如果捆绑包再次启动,prereq 安装程序将启动,但仅显示标题和徽标,但没有按钮。我们还尝试将 After 条件放在 .NET 包组的 PackageGroupRef 上,结果相似。

所以,我的问题是:有没有办法让刻录安装多个包作为托管引导程序的先决条件,或者有没有其他方法可以解决这个问题?

【问题讨论】:

    标签: .net wix bootstrapper burn


    【解决方案1】:

    对于 WiX v3.9 及更高版本,将 bal:PrereqSupportPackage="yes"(在 v4.x 中为 bal:PrereqPackage)添加到您希望 prereq BA 安装的包(它遵循 InstallCondition)。

    【讨论】:

    • 这是有效的解决方案。 (在 WIX 3.9 R2 中,该属性更改为 bal:PrereqSupportPackage="yes")
    【解决方案2】:

    您可以使用 dotNetInstaller,它是 Windows 的安装引导程序。 安装 wic(在 x86 或 x64 上)后,您可以启动 Wix 安装程序。

    这里是一些您可以在 dotNetInstaller configuration.xml 中使用的代码 共有三个组件:wic_x86、wic_x64 和 dot Net framework 4

      <component executable="&quot;#CABPATH\wic_x86_enu.exe&quot; /norestart /quiet" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="" exeparameters_basic="" exeparameters_silent="" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" disable_wow64_fs_redirection="False" id="Windows Imaging Component (x86)" display_name="Windows Imaging Component" uninstall_display_name="" os_filter="" os_filter_min="winXP" os_filter_max="" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="False" default_continue_on_error="False" required_install="True" required_uninstall="True" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="x86" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <embedfile sourcefilepath="#APPPATH\presetup\wic_x86_enu.exe" targetfilepath="#TEMPPATH\wic_x86_enu.exe" />
      <installedcheck filename="#SYSTEMPATH\WindowsCodecs.dll" fileversion="" comparison="exists" defaultvalue="False" type="check_file" description="Installed Check" />
    </component>
    <component executable="&quot;#CABPATH\wic_x64_enu.exe&quot; /norestart /quiet" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="" exeparameters_basic="" exeparameters_silent="" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" disable_wow64_fs_redirection="False" id="Windows Imaging Component (x64)" display_name="Windows Imaging Component" uninstall_display_name="" os_filter="" os_filter_min="winXP" os_filter_max="" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="False" default_continue_on_error="False" required_install="True" required_uninstall="True" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="x64" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <embedfile sourcefilepath="#APPPATH\presetup\wic_x64_enu.exe" targetfilepath="#TEMPPATH\wic_x64_enu.exe" />
      <installedcheck filename="#SYSTEMPATH\WindowsCodecs.dll" fileversion="" comparison="exists" defaultvalue="False" type="check_file" description="Installed Check" />
    </component>
    <component executable="&quot;#CABPATH\dotNetFx40_Full_x86_x64.exe&quot; /norestart /quiet" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="3010" exeparameters="" exeparameters_basic="" exeparameters_silent="" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" disable_wow64_fs_redirection="False" id=".NET Framework 4 (English)" display_name="Microsoft .NET Framework 4" uninstall_display_name="" os_filter="" os_filter_min="winXP" os_filter_max="" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="False" default_continue_on_error="False" required_install="True" required_uninstall="True" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
      <installedcheck path="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" fieldname="Install" fieldvalue="1" defaultvalue="False" fieldtype="REG_DWORD" comparison="match" rootkey="HKEY_LOCAL_MACHINE" wowoption="NONE" type="check_registry_value" description="Installed Check" />
      <embedfile sourcefilepath="#APPPATH\presetup\dotNetFx40_Full_x86_x64.exe" targetfilepath="#TEMPPATH\dotNetFx40_Full_x86_x64.exe" />
    </component>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-12
      • 2014-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多