从“Program Files x86"移动应用程序到“程序文件"升级到 64 位版本时 [英] Move application from "Program Files x86" to "Program Files" when upgrading to 64 bit version

查看:25
本文介绍了从“Program Files x86"移动应用程序到“程序文件"升级到 64 位版本时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用最初以 32 位形式交付.现在发布了32位和64位版本.

App was initially delivered in 32 bit form. Now it is distributed with 32 and 64 bit version.

现在,当 64 位 Windows 用户将应用程序从 32 位版本升级到 64 位版本时,默认安装文件夹应指向程序文件"(无 x86).

Now when user on 64 bit Windows upgrades application from 32 bit version to 64 bit version default installation folder should point to "Program files" (no x86).

我已经以这种方式更新了我的 wsx 文件:

I've updated my wsx files in such way:

    <?if $(var.Platform) = x64 ?>
        <?define bitness = "(64 bit)" ?>
        <?define Win64 = "yes" ?>
        <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
    <?else ?>
        <?define bitness = "(32 bit)" ?>
        <?define Win64 = "no" ?>
        <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
    <?endif ?>
      ....
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="$(var.PlatformProgramFilesFolder)">
                <Directory Name="COMPANY" Id="D.COMPANY">
                    <Directory Name="Product name" Id="APPDIR">

                    </Directory>
                </Directory>
            </Directory>
        </Directory>

这对于全新安装非常有效:
在 64 位系统上安装 32 位应用程序时,它安装在程序文件 x86"中,在所有其他情况下,安装到程序文件"中.

And this works nicely for fresh installs:
When 32 bit app is installed on 64 bit system it is installed in "Program files x86" and in all other cases installation is performed to "Program files".

如果从 32 位升级到 64 位,默认目标文件夹仍然是Program files x86",我喜欢将其移至Program files".

In case of upgrade from 32 to 64 bit default destination folder is still "Program files x86" and I like that if it is moved to "Program files".

有什么好的办法吗?或者我是否必须在我的 C++ 代码中覆盖这个自定义操作?

Is there a nice way to do it? Or do I have to override this some custom action in my C++ code?

编辑/更新:
只是要清楚.我的应用程序是后台服务.机器用户根本看不到该应用程序(极端极端情况除外).在大多数情况下,此服务由其他可以静默远程安装所需软件的服务安装/取消分级.

Edit/Update:
Just to be clear. My application is a background service. Machine user doesn't see that application at all (except for extreme corner cases). In most of the time this service is installed/ungraded by other service which silently and remotely can install required software.

在此升级期间,所有 32 位组件都被清除(一个 exe 和几个 dll-s)并替换为 64 位等效组件.配置数据和缓存数据传输到升级的应用程序.

During this upgrade all 32 bit components are purged (one exe and couple dll-s) and replaced by 64 bit equivalents. Configuration data and cached data are transferred to upgraded application.

RemoveExistingProducts 设置为

推荐答案

总体:首先要解决几个问题:

Overall: A couple of issues first:

  • Side-By-Side:您确定不支持并行安装 32 位和 64 位版本吗?具有不同安装位置(和一些共享组件)的不同软件包?
    • 这有时是可能的 - 作为向最新版本的过渡.您可以允许在一段时间(或永远)同时安装两个版本.
    • 这取决于您的软件包安装了多少纠缠"的数据(在机器上全局注册,因此会在软件包之间产生干扰).
    • 这里有一个关于并行问题的部分的答案(针对底部).不多,但就此事进行了一些讨论.

    Practical Bitness:我生疏了,请耐心等待,但我会

    Practical Bitness: I am rusty, so bear with me, but I would

    1. 为您的新 64 位软件包完全设置一个新的安装位置,
    2. 最好更改产品名称,
    3. 更改所有组件 GUID(移动安装位置时需要,此处解释) - 使用 WiX 自动 GUID,如果你可以,
    4. 将所有 64 位组件标记为 64 位并将其余组件标记为 32 位(显然:<Component Win64="yes"/>),
    5. 将包标记为 64 位,
    6. 更改输出文件名以指示 64 位包,
    7. 我可能会为新版本设置一个新的升级代码,但这需要对升级表进行更高级的处理,以方便卸载 32 位版本.通常需要一个新的升级代码来支持并行安装.还有很多小细节...例如:WiX heat.exe不支持64位COM注册数据提取.
    1. set a new installation location entirely for your new 64-bit package,
    2. preferably change the product name,
    3. change all component GUIDs (necessary when you move the installation location, explanation here) - use WiX auto-GUIDs if you can,
    4. mark all components that are 64-bit as 64-bit and leave the rest as 32-bit (obviously: <Component Win64="yes" />),
    5. mark the package as 64-bit,
    6. change output file name to indicate 64-bit package,
    7. I might set a new upgrade code to the new version, but that requires more advanced handling of the upgrade table to facilitate uninstall of the 32-bit version. A new upgrade-code is generally necessary to support side-by-side installation. There are many small details... For example: WiX heat.exe does not support 64-bit COM registration data extraction.

    一些问题:

    • 您还有剩余的 32 位组件吗?(64 位软件包).
    • 全局范围:任何 COM 组件?有司机吗?任何文件关联?
    • 存在位数问题的先决条件?

    链接:

    这篇关于从“Program Files x86"移动应用程序到“程序文件"升级到 64 位版本时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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