[wix-users] Using RegistrySearch, with Directory/File search to get Directory issue

Tim Mayert TimMayert at smarttech.com
Tue Apr 5 11:51:08 PDT 2016


I am trying to get and set a Directory property if the directory exists with a specific file. I am using the following code:
<Property Id="GS_EXISTS" Secure="no">
       <RegistrySearch Id="GS_Path_Key" Root="HKLM" Key="Software\SMART Technologies\Gallery\Install Information" Name="Install Path" Type="raw">
              <DirectorySearch Id="GS_Search" Path="[GS_EXISTS]" Depth="1" AssignToProperty="no">
                     <FileSearch Id="GS.exe" Name="Gallery Setup.exe" MinVersion="" />

This will find the directory and file, but it will set my GS_EXISTS property to the full path and file name. I only want the path if the file exists. I saw the AssignToProperty element and the way I read it was that it would not update the original RegistrySearch property with path/file name if set to "no". So I thought that this would create the property with only the RegistrySearch value if the Directory/File search was true, but again it used the full path/file name.

So how can I do a search of the registry to get the path name and validate that a file exists without having the property updated to be full path and file name?


Tim Mayert.

More information about the wix-users mailing list