如何找到用于以编程方式卸载的 Wix Burn 可执行文件的 GUID? [英] How to find GUID of Wix Burn executable for programmatically uninstall?

查看:20
本文介绍了如何找到用于以编程方式卸载的 Wix Burn 可执行文件的 GUID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了 wix 引导程序项目.安装时会创建注册表项

I've created wix bootstrapper project. While installing it creates registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{SOME_GUID}

所以我可以使用 ARP 卸载它.但我想以编程方式卸载它.为此,我需要 {SOME_GUID} 的值来搜索注册表中的 UninstallString 值.但是,无法从我的项目中获取此信息,因为 Bundle 元素没有设置此 GUID 的属性.

So I can uninstall it using ARP.But I'd like to uninstall it programmatically.To do this I need the value of {SOME_GUID} to search the key in registry for UninstallString value. However it's impossible to get this information from my project, because Bundle element does not have attributes to set this GUID.

我发现这个 GUID 等于 Bundle 的 ProviderKey GUID,但前提是 ProviderKey 是自动分配的.当我尝试使用捆绑包ProviderKey"属性更改 ProviderKey 时,这两个 GUID 不再相等.

I found out that this GUID is equal to Bundle's ProviderKey GUID, but only if ProviderKey is assigned automatically. When I try to change ProviderKey using bundle "ProviderKey" attribute this two GUIDs are not equal anymore.

推荐答案

每次编译引导程序项目时,都会为其分配一个新标识 — 一个名为 BundleId 的 GUID,您无法更改该标识.在这方面,您创建的每个捆绑包都是独一无二的.UpgradeCode 属性允许我们链接两个引导程序,使它们成为相关的包.这种关系允许一个包检测和升级另一个包的已安装包.

Each time that you compile your bootstrapper project, it is assigned a new identity—a GUID called BundleId that you cannot change. In this respect, every bundle that you create is unique. The UpgradeCode attribute allows us to link two bootstrappers, making them related bundles. This relationship allows one bundle to detect and upgrade the installed packages of the other.

这篇关于如何找到用于以编程方式卸载的 Wix Burn 可执行文件的 GUID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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