简体   繁体   English

有没有办法在Wix中制作组合的32位和64位安装程序?

[英]Is there a way to make a combined 32-bit and 64-bit installer in Wix?

I'm using WiX Toolset 3.8 with Votive integration for Visual Studio. 我正在使用带有Votive集成的WiX Toolset 3.8 for Visual Studio。 My product needs to be installed on 32-bit and 64-bit systems. 我的产品需要安装在32位和64位系统上。 The only real difference between the two is some 64-bit COM registrations, plus of course the ProgramFiles vs ProgramFiles (x86) fun and games. 两者之间唯一真正的区别是一些64位COM注册,当然还有ProgramFiles vs ProgramFiles (x86)乐趣和游戏。

I've been following Microsoft's advice (which I can't find now) to create separate installers for 32-bit and 64-bit systems. 我一直遵循Microsoft的建议(现在找不到),为32位和64位系统创建单独的安装程序。 However, lately I've been wondering if this is still the best practice or whether there is a better approach now? 但是,最近我一直在想这是否仍然是最佳做法,或者现在是否有更好的方法?

I create my installers from teh same WiX source. 我从相同的WiX源创建安装程序。 What I've been doing is building all my assemblies for 'Any CPU' but having separate x86 and x64 configurations for the WiX installer project. 我一直在为“任何CPU”构建我的所有程序集,但为WiX安装程序项目分别设置了x86和x64配置。 I have a config.wxi that sets up correct paths, etc., for the target being built, and I include it in all my .wxs files. 我有一个config.wxi ,它为要建立的目标设置正确的路径等,并将其包含在我的所有.wxs文件中。 It goes along these lines: 它遵循以下原则:

<?xml version="1.0" encoding="utf-8"?>

<Include>
  <!-- User Configuration - you must ensure all these variables have correct values for your project -->
  <?define InstallName = "Project Name" ?>
  <?define Manufacturer = "My Company" ?>
  <!-- End of User Configuration - do not edit anything beyond this point -->

  <!-- Define platform-specific names and locations -->
  <?if $(var.Platform) = x64 ?>
  <?define ProductName = "$(var.InstallName) (x64)" ?>
  <?define Win64 = "yes" ?>
  <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
  <?define PlatformCommonFilesFolder = "CommonFiles64Folder" ?>
  <?else ?>
  <?define ProductName = "$(var.InstallName) (x86)" ?>
  <?define Win64 = "no" ?>
  <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
  <?define PlatformCommonFilesFolder = "CommonFilesFolder" ?>
  <?endif ?>

  <!-- Set installer version based on the file version of the main assembly. -->
  <?define ProductVersion="!(bind.FileVersion.filSomeKeyFileFromTheProject)"?>
</Include>

So far, I haven't looked at Burn (the bootstrapper builder) but on the project I'm working on now I want to do that. 到目前为止,我还没有看过Burn(引导程序生成器),但是在我现在正在研究的项目上,我想这样做。 So, its is time for a review of what the community thinks is 'best practice'. 因此,现在该对社区认为的“最佳实践”进行审查了。 How are people handling dual x86/x64 installation now? 人们现在如何处理x86 / x64双重安装?

Nothing's changed: MSI still doesn't support 64-bit components in a 32-bit package. 没有任何变化:MSI仍不支持32位程序包中的64位组件。 Using a Burn bundle, you can combine the two packages and make it look like one from the user's perspective. 使用Burn捆绑包,您可以将这两个包组合在一起,并从用户角度使其看起来像一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM