WiX RegistrySearch in all subdirectories

别来无恙 提交于 2020-06-17 07:38:35

问题


I need to check whether an any version of some product is already installed.

<RegistrySearch Id="MyId"
                  Root="HKLM"
                  Key="SOFTWARE\Company\{ANY FOLDER}"
                  Name="MY_KEY_NAME"
                  Type="file"  />

Is it possible to use RegistrySearch for searching in all subdirectories?


回答1:


AppSearch / RegLocator doesn't support recursion. You'll either need a custom action or change the way you store data in the registry.




回答2:


To my knowledge and from the documentation I see nothing that points to RegistrySearch recursing through directories. To do that you'd need to use a custom action. Another possibility and one we used on an installer was to search on the UpGradeCode e.g.

 <Upgrade Id ="other product's guid">
  <UpgradeVersion OnlyDetect="yes" Minimum="0.0.0.0" Property="OTHERPRODUCTDETECTED" IncludeMinimum="yes" />
 </Upgrade>

You would need a block such as this for every product you are attempting to search for, which requires knowing all the guids.



来源:https://stackoverflow.com/questions/24858866/wix-registrysearch-in-all-subdirectories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!