I'm building a WiX installer where I want to do a registry search for the install directory for a 3rd party application. The 3rd party application I'm interested in creates a registry entry under HKLM which points not only to the install directory, but it also includes the file name and extension (ie. C:/Program Files/MyApp/myapp.exe). What I need is just the actual parent directory (ie. C:/Program Files/MyApp) so that when I do a Directory/File search it looks in the correct location. Is there a way to modify the @Property that gets returned from the registry search to only include the parent directory and strip out the file name and extension? Here's what I have:
<Property Id="MYAPPINSTALLFOLDER">
<RegistrySearch Id='InstallPathRegistry'
Type='raw'
Root='HKLM'
Key='SOFTWARE\Company\SomeLongPath'
Name='FileName'
Win64='yes'/>
</Property>
<Property Id="ISINSTALLED">
<DirectorySearch Id="CheckFileDir" Path="[MYAPPINSTALLFOLDER]" Depth="0">
<FileSearch Id="CheckFile" Name="myapp.exe" />
</DirectorySearch>
</Property>