3

I currently have two WIX projects - one for creating an x86 installer and one for creating an x64 installer. I would like to combine these two projects into just one project which uses variables to control program flow.

I have the following:

  <?if $(var.Platform) = x64 ?>
    <?define ProductName = "CableSolve Web (64 bit)" ?>
    <?define Win64 = "yes" ?>
    <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
  <?else ?>
    <?define ProductName = "CableSolve Web" ?>
    <?define Win64 = "no" ?>
    <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
  <?endif ?>

and I went into Visual Studio -> Build -> Configuration Manager and set things like so:

enter image description here

I then went through and removed all of the "Win64='yes'" and "Win64='no'" parameters in all the components /directories of both projects.

I am wondering if there is something more to it than this, though. When I create my x64 installer I see it trying to install to C:\Program Files (x86)... and not to C:\Program Files. I am assuming that this means the code is dropping down to the 'else' statement -- but I do not know of a way to confirm this.

Are there other variables which need to be set in order to ensure proper generation of an x64 install path?

Thanks

I inherited all of the installer code below (excluding the variables I am currently working on adding). I've added the $(var.PlatformProgramFilesFolder) as well as the EnvironmentVariables wxi. enter image description here

EDIT2: This is probably the culprit, but trying to find why its configuration is x86:

------ Skipped Rebuild All: Project: CS Web Installer x64, Configuration: Release x86 ------

Sean Anderson
  • 27,963
  • 30
  • 126
  • 237
  • When installing the 64-bit version, does the ProductName show as "CableSolve Web (64 bit)" or "CableSolve Web"? Also, can you please show us your Directory tag branches. – Hand-E-Food Dec 19 '11 at 22:37
  • The ProductName displays as CableSolve Web. I just replaced the 'ProductName = "CableSolve Web"' bit with $(var.Platform) and am building another installer -- curious to see what Platform is thought to be. I'll have another image uploaded to the main post in a second showing my Directory tag branches. EDIT: var.Platform is x86 when building the x64 installer. – Sean Anderson Dec 19 '11 at 22:43
  • Looking at your Configuration Manager screen, you have two separate projects each building an installer. Are those two projects identical or have they accidentally developed inconsistencies? – Hand-E-Food Dec 19 '11 at 23:45
  • Another programmer at the company created the two separate projects. When I saw what was going on I opted to take over and condense these down into just one project. There aren't any inconsistencies and, if I could get these variables working, their wix files would be identical. – Sean Anderson Dec 20 '11 at 00:05

1 Answers1

6

Two things:

  1. You need to set Platform="x64" attribute in Package element to get 64bit .msi file
  2. Where is $(var.Platform) variable initialized? If you intended to use WIX built-in platform variable then you should rather use $(sys.BUILDARCH) or $(sys.PLATFORM) depending on WIX version.
imagi
  • 946
  • 8
  • 8