DirectorySearch is performed by the AppSearch action. You have to have all
your properties in place before it runs, or nest the searches appropriately.
I think you need to nest your PRODUCT_VALID search inside the PRODUCT_FOLDER
search. If you need both you'll need to do both. A RegistrySearchRef should
avoid you having to specify the same information twice.
Technically, Path isn't a Formatted data type, it's an AnyPath type, so the
[] aren't processed and Windows Installer will be literally looking for a
folder called [PRODUCT_FOLDER].
So my guess is that you should have:
<Property Id="PRODUCT_VALID" >
<RegistrySearch Id='SearchProductInstallDir' Type='raw' Root='HKLM'
Key='[KEYNAME]' Name='Services'>
<DirectorySearch Id="SearchProduct.bin" Path="bin">
<FileSearch Name="file.exe" />
</DirectorySearch>
</RegistrySearch>
</Property>
<Property Id="PRODUCT_FOLDER">
<RegistrySearchRef Id='SearchProductInstallDir' />
</Property>
You can't nest things under a RegistrySearchRef, not sure why.
Not tested, no warranties, etc.
--
Mike Dimmick
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Oliver
Schneider
Sent: 04 July 2007 21:24
To: [email protected]
Subject: [WiX-users] Problem with FileSearch element (WiX 2.0)
Hi everyone,
at the moment I am trying to find out whether another product on which
our product depends is installed. Retrieving the path to the folder from
the registry works flawlessly so far. However, I can't manage to get
further than this.
First I retrieve the path from the registry (which works):
<Property Id="PRODUCT_FOLDER">
<RegistrySearch Id='SearchProductInstallDir' Type='raw' Root='HKLM'
Key='[KEYNAME]' Name='Services' />
</Property>
PRODUCT_FOLDER now contains the path and I try to find out whether
[PRODUCT_FOLDER]\bin\file.exe exists. However, this doesn't seem to
work. In all cases PRODUCT_VALID is empty:
<Property Id="PRODUCT_VALID" >
<DirectorySearch Id="SearchProduct" Path="[PRODUCT_FOLDER]">
<DirectorySearch Id="SearchProduct.bin" Path="bin">
<FileSearch Name="file.exe" />
</DirectorySearch>
</DirectorySearch>
</Property>
I also tried this, which didn't do any good either:
<Property Id="PRODUCT_VALID" >
<DirectorySearch Id="SearchProduct" Path="[PRODUCT_FOLDER]\bin">
<FileSearch Name="file.exe" />
</DirectorySearch>
</Property>
Does anyone have any idea how to resolve this? Out of curiosity I tried
[WindowsFolder] instead of [PRODUCT_FOLDER] and it worked (file was
regedit.exe for testing).
Cheers,
--
Oliver Schneider
Researcher / Developer
FRISK Software International
Thverholti 18
IS-105 Reykjavik
Iceland
+354 540 7400
http://www.f-prot.com | http://forum.f-prot.com
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users