ProgramFiles64Folder is installing to \Program Fil

2019-07-01 11:12发布

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 ------

1条回答
beautiful°
2楼-- · 2019-07-01 11:57

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.
查看更多
登录 后发表回答