Let's suppose we need to file if a dll is installed on machine. WE can use code
<Property Id="IS_DLL_PRESENT" Secure="yes">
<RegistrySearch Id="ManDMSRegistrySearch" Root="HKCR" Key="CLSID\{***}\InprocServer32" Type="file">
<FileSearch Id="DllFileSearch" Name="appName.dll" MinVersion="1.0.0" />
</RegistrySearch>
</Property>
I'm wondering what is the purpose of Name attribute of FileSearch element? According to WIX documentation (see Remarks section) since FileSearch is inside RegistrySearch it just make RegistrySearch to init full file path instead of parent folder path to IS_DLL_PRESENT property.
Documentation says we need to know the fileName to search for it. But logically we can get fileName from parent RegistrySearch element and just verify it exists. And it looks like it works this way because nothing changes if I change the name in the code above to anything unexisting, like "123.dll", or even the property name "[SomeUndefinedPrivateProperty]" - it simply works in any case (log file proves that property is initialized always to the same correct file path) and that is strange =).
Can anybody explain this odd behavior?