3

我无法在某些不附带 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 上,结果相似。

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

4

2 回答 2

2

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

于 2014-09-25T00:45:30.340 回答
-1

您可以使用 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>
于 2012-11-14T15:35:29.787 回答