简体   繁体   中英

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. My product needs to be installed on 32-bit and 64-bit systems. The only real difference between the two is some 64-bit COM registrations, plus of course the ProgramFiles vs ProgramFiles (x86) fun and games.

I've been following Microsoft's advice (which I can't find now) to create separate installers for 32-bit and 64-bit systems. 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. 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. 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. 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. So, its is time for a review of what the community thinks is 'best practice'. How are people handling dual x86/x64 installation now?

Nothing's changed: MSI still doesn't support 64-bit components in a 32-bit package. Using a Burn bundle, you can combine the two packages and make it look like one from the user's perspective.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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