WiX Bootstrapper:使用util:RegistrySearch结果作为util:FileSearch中的路径?

时间:2016-03-04 23:57:38

标签: wix windows-installer bootstrapper

我可以使用util:RegistrySearch从注册表项中检索路径,并在util:FileSearch中使用该路径来检查该目录中的文件是否存在?

示例

我有一个存储在注册表项中的可执行文件的路径。

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

如果此目录中存在不同的文件(例如:C:\ Program Files(x86)\ MyApp \ AnotherFile.dll),我想用作检测条件。

<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"
                 />

1 个答案:

答案 0 :(得分:1)

是的,你可以。

使用&#34;&#34;属性为了定义应该追求的属性。 http://wixtoolset.org/documentation/manual/v3/xsd/util/registrysearch.html