keinkoenig
keinkoenig

Reputation: 303

WiX Bootstrapper: use util:RegistrySearch result as path in util:FileSearch?

can i use a util:RegistrySearch to retrieve a path from a registry key and use that path in a util:FileSearch to check if a file in that directory exists?


Example

i have a path to an executable stored in a registry key.

HKLM\Software\MyApp\ -> C:\Program Files (x86)\MyApp\MyApplication.exe

and i want to use as detect condition if a different file within this directory (e.g.: C:\Program Files (x86)\MyApp\AnotherFile.dll ) exists.

<util:RegistrySearch Id="SearchForMyApp"
                     Variable="MyApp_Found"
                     Root="HKLM"
                     Key="SOFTWARE\MyApp"
                     Result="exists"
                     Win64="no"
                     After="SearchForOtherFile"
                     />

<util:FileSearch Id="SearchForOtherFile"
                 Variable="OtherFile_Found"
                 Result="exists"
                 Path="AnotherFile.dll" Comment="<-- how to use path from reg search here"
                 />

Upvotes: 0

Views: 1102

Answers (1)

Arkady Sitnitsky
Arkady Sitnitsky

Reputation: 1886

yes you can.

Use "After" attributes in order to define the one should come after. http://wixtoolset.org/documentation/manual/v3/xsd/util/registrysearch.html

Upvotes: 1

Related Questions