ProgramFiles64Folder 正在安装到 WIX 安装程序中的 \Program Files (x86)\ [英] ProgramFiles64Folder is installing to \Program Files (x86)\ in WIX Installer

查看:39
本文介绍了ProgramFiles64Folder 正在安装到 WIX 安装程序中的 \Program Files (x86)\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有两个 WIX 项目 - 一个用于创建 x86 安装程序,一个用于创建 x64 安装程序.我想将这两个项目合并为一个使用变量来控制程序流程的项目.

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.

我有以下几点:

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

然后我进入 Visual Studio -> Build -> Configuration Manager 并进行如下设置:

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

然后我检查并删除了两个项目的所有组件/目录中的所有Win64='yes'"和Win64='no'"参数.

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

不过,我想知道是否还有比这更多的东西.当我创建 x64 安装程序时,我看到它试图安装到 C:\Program Files (x86)... 而不是 C:\Program Files.我假设这意味着代码正在下降到else"语句 - 但我不知道如何确认这一点.

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.

是否需要设置其他变量以确保正确生成 x64 安装路径?

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

谢谢

我继承了下面的所有安装程序代码(不包括我目前正在添加的变量).我已经添加了 $(var.PlatformProgramFilesFolder) 以及 EnvironmentVariables wxi.

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.

这可能是罪魁祸首,但试图找出其配置为 x86 的原因:

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

------ 全部跳过重建:项目:CS Web 安装程序 x64,配置:发布 x86 ------

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

推荐答案

两件事:

  1. 您需要在 Package 元素中设置 Platform="x64" 属性以获取 64 位 .msi 文件
  2. $(var.Platform) 变量在哪里初始化?如果您打算使用 WIX 内置平台变量,那么您应该根据 WIX 版本使用 $(sys.BUILDARCH) 或 $(sys.PLATFORM).

这篇关于ProgramFiles64Folder 正在安装到 WIX 安装程序中的 \Program Files (x86)\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆