Wix-跟踪已安装的应用程序 [英] Wix - Keeping track of installed applications

查看:78
本文介绍了Wix-跟踪已安装的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个非常简单的问题,但我一直找不到答案:

This seems like a fairly straightforward question but I've been unable to find an answer:

假设我有两种产品:MyCompany创建的A和B。产品A和B都将以这种方式在开始菜单中具有快捷方式:

Let's say I have two products: A and B created by MyCompany. Both products A and B will have shortcuts in the start menu in this fashion:

MyCompanyFolder-> Product_A_Folder-> A.exe和MyCompanyFolder-> Product_B_Folder-> B.exe

MyCompanyFolder->Product_A_Folder->A.exe and MyCompanyFolder->Product_B_Folder->B.exe

如果我卸载产品B,除非它是最后剩下的产品,否则我不希望它删除 MyCompanyFolder。我只是要检查产品A是否存在(通过组件或注册表搜索),但是我目前无法知道将有多少将来的应用程序添加到该文件夹​​中。

If I uninstall "Product B" I don't want it to delete the "MyCompanyFolder" unless it is the last product left. I would just check to see if "Product A" exists or not (through a component or registry search) but it is impossible for me to know at this time how many future applications will be added to this folder.

我想出的唯一解决方案是创建一个注册表项,该注册表项仅包含一个表示已安装应用程序数量的整数-但这似乎有点不雅(更不用说我不知道​​如何来增加Wix中的注册表值)。

The only solution I came up with was to create a registry key that simply contains an integer denoting the number of apps installed - but that seems a bit inelegant (not to mention I don't know how to increment registry values in Wix either).

有什么想法吗?
谢谢。

Any thoughts? Thanks.

推荐答案

您必须在安装过程中执行一些与众不同的操作,因为这应该会自动执行。开始菜单目录中不需要任何组件或createfolder元素。只需创建一个如下所示的引用,并在整个安装过程中在ShortCut元素中使用ApplicationProgramsFolder Id,MSI就会自动处理最后一次关闭的情况,从而删除该文件夹。

You must be doing something unusual in your install because this should all work automatically. You shouldn't need to have any components or createfolder elements for your start menu directory. Just create a reference like below and use the ApplicationProgramsFolder Id in your ShortCut element across your installs and MSI will automatically handle the case of last one off removes the folder.

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramMenuFolder">
    <Directory Id="CompanyProgramsFolder" Name="ISWIX, LLC">
     <Directory Id="ApplicationProgramsFolder" Name="IsWiX" />
  </Directory>
 </Directory>
</Directory>

这篇关于Wix-跟踪已安装的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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