在主要升级期间使用已安装应用程序的位置作为默认路径

发布于 2025-01-15 18:55:17 字数 472 浏览 3 评论 0原文

我正在为一个应用程序编写主要升级。
唯一持久的就是 UpgradeCode。 我想要的是使用以前安装版本的位置作为安装的默认路径。

我天真的解决方案是运行一个 CustomAction,它使用由 AppSearch 表获取的变量 APP_LOCATION 修改 INSTALLDIR

  1. 是否有一种传统方法可以通过 MSI 或 InstallShield 实现这一目标?
  2. 我可以使用 MSI 表中的条件来使用 AppSearch 表中的“APP_LOCATION”(如果它包含值)吗? > 例如:INSTALLDIR = APP_LOCATION ? APP_LOCATION : MY_DEFAULT_INSTALL_DIR (语法是为了强调逻辑,idk if 是否有效)

I have an application which I am writing a major upgrade for.
The only thing that is persistent is an UpgradeCode.
What I want is to use a location of a previously installed version as a default path for installation.

My naive solution is to run a CustomAction which modifies the INSTALLDIR with a variable APP_LOCATION obtained by AppSearch table.

  1. Is there a conventional way to achive that via means on MSI or InstallShield?
  2. Can I use a condition in an MSI table to use "APP_LOCATION" from AppSearch table if it contains value? For example: INSTALLDIR = APP_LOCATION ? APP_LOCATION : MY_DEFAULT_INSTALL_DIR (syntax is to emphasize the logic, idk if is valid)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何以畏孤独 2025-01-22 18:55:17

您可以使用以下方法获取以前的安装位置:

Msi.GetProductInfo(ProductCode of previous Install, "InstallLocation");

要获取以前安装的产品代码,请使用主要升级时设置的公共属性。此公共属性(例如 OLD_PRODUCT_DETECTED 属性)可以在升级表的 ActionProperty 列中找到。其值将设置为产品代码({GUID})。

确保在 FindRelatedProducts 操作之后调用上述方法,如果找到以前的安装,该操作会将公共属性的值设置为 {GUID}。

You can fetch previous install location using the following method:

Msi.GetProductInfo(ProductCode of previous Install, "InstallLocation");

To get the product code of previous installation, Use the public property set for the major upgrade. This public property for example OLD_PRODUCT_DETECTED property can be found in ActionProperty column of Upgrade table. It's value will be set to product code({GUID}).

Make sure to call the above method after FindRelatedProducts action which sets the value for public property to {GUID} if previous installation found.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文