问题
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