【问题标题】:How do you uninstall another program in wix installer?如何在 wix 安装程序中卸载另一个程序?
【发布时间】:2015-10-22 07:27:12
【问题描述】:

我丢失了旧安装程序的 GUID。我设法使用 Orca 获得了升级 ID,但它仍然没有从程序和功能列表中删除旧版本。如何使用全新的 msi/bootstrapper 卸载旧的 msi/bootstrapper?

【问题讨论】:

    标签: wix uninstallation


    【解决方案1】:

    -利用 Windows 安装程序 API:MsiEnumRelatedProducts() 获取共享相同 UpgradeCode 的所有产品的列表。

    https://msdn.microsoft.com/en-us/library/aa370103(v=vs.85).aspx

    此 API 返回系统上安装的所有共享同一 UpgradeCode 的产品的产品代码。

    您可能可以通过 Internet 或 Windows 安装程序 SDK 看到使用此功能的示例。

    另外,最近有一个相关的问题:

    WiX - Allowing a *manual* uninstall of one msi to uninstall another msi that shares the same UpgradeCode (and not just during the MajorUpgrade)

    -另一种方法是使用新的 msi 包升级旧的 msi 包。

    http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html

    【讨论】:

      【解决方案2】:

      如果您有要卸载的 MSI(即不是引导程序),那么您应该可以使用 WIX <Upgrade> 元素卸载它,方法是在此处指定它:

      <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is installed." />
      
      <Upgrade  Id="{YOUR-OTHER-STUFF-GUID-HERE}">
        <UpgradeVersion OnlyDetect="no" Property="OTHER_STUFF_FOUND" Minimum="0.0.0" />
      </Upgrade>
      

      如果您要卸载一些 EXE,而不是 MSI,那么 AFAIK 只有一个自定义操作是一种解决方案(只需使用自定义操作执行卸载行)。

      【讨论】:

      【解决方案3】:

      另一种方法是从注册表中读取卸载键 (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall) 并查找您的应用程序名称/发布者,如果找到匹配项,请执行 UninstallString 命令。

      【讨论】:

        猜你喜欢
        • 2010-09-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-12-13
        • 2014-01-31
        • 2014-08-11
        相关资源
        最近更新 更多