ProgramFiles64Folder is installing to \Program Files (x86)\ in WIX Installer

末鹿安然 提交于 2020-01-04 02:55:11

问题


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:

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.

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:


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.


来源:https://stackoverflow.com/questions/8568250/programfiles64folder-is-installing-to-program-files-x86-in-wix-installer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!