Bugs item #1656236, was opened at 2007-02-09 10:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1656236&group_id=105970

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: candle
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Lorne Laliberte (lornelaliberte)
Assigned to: Nobody/Anonymous (nobody)
Summary: FileSearch requires a parent folder found at depth 0

Initial Comment:
While testing the <FileSearch> and <DirectorySearch> elements, I've discovered 
what is either a bug, or a limitation, in WiX or MSI. 

(Based on Rob's quote about the difficulty of working with AppSearch I think 
it's most likely a bug in WiX. :)

It's a bit tricky to describe, but basically it has to do with the FileSearch 
element needing two things: 

 - it must be in a DirectorySearch element that describes its parent folder 
with an effective depth of 0; although the attribute can be higher it must be 
found at level 0

 - if that DirectorySearch has a parent DirectorySearch element, it must have 
been found at an effective depth of 0 as well

For example:

Let's assume we have the following folder structure:

C:\Temp\a\b\c\d\e\f\

And inside that folder structure we have a file:

C:\Temp\a\b\c\d\e\f\foo.txt


This search will NOT work:

<Property Id="FOO_DOT_TEXT_0">
        <DirectorySearch Depth='0' Id="dir_search_0" Path="C:\Temp\a" >
                <FileSearch Id="file_search_0" Name="foo.txt" />
        </DirectorySearch>
</Property>


This search will NOT work either:

<Property Id="FOO_DOT_TEXT_1">
        <DirectorySearch Depth='0' Id="dir_search_1" Path="C:\Temp" >
                <DirectorySearch Depth='8' Id="dir_search_2" Path="f" >
                        <FileSearch Id="file_search_1" Name="foo.txt" />
                </DirectorySearch>
        </DirectorySearch>
</Property>


This search will NOT work either:

<Property Id="FOO_DOT_TEXT_2">
        <DirectorySearch Depth='0' Id="dir_search_5" Path="C:\Temp" >
                <DirectorySearch Depth='5' Id="dir_search_6" Path="d" >
                        <DirectorySearch Depth='2' Id="dir_search_7" Path="f" >
                                <FileSearch Id="file_search_2" Name="foo.txt" />
                        </DirectorySearch>
                </DirectorySearch>
        </DirectorySearch>
</Property>


However, this search WILL work:

<Property Id="FOO_DOT_TEXT_3">
        <DirectorySearch Depth='0' Id="dir_search_8" Path="C:\Temp" >
                <DirectorySearch Depth='6' Id="dir_search_9" Path="e" >
                        <DirectorySearch Depth='0' Id="dir_search_10" Path="f" >
                                <FileSearch Id="file_search_3" Name="foo.txt" />
                        </DirectorySearch>
                </DirectorySearch>
        </DirectorySearch>
</Property>


One workaround I've found is to use two searches, like this:

<Property Id="FOLDER_F">
        <DirectorySearch Depth='0' Id="dir_search_11" Path="C:\Temp" >
                <DirectorySearch Depth='8' Id="dir_search_12" Path="f" />
        </DirectorySearch>
</Property>

<Property Id="FOO_DOT_TEXT_4">
        <DirectorySearch Depth='0' Id="dir_search_13" Path="[FOLDER_F]" >
                <FileSearch Id="file_search_4" Name="foo.txt" />
        </DirectorySearch>
</Property>

...which seems to work just fine so long as the properties are defined in the 
correct order.

Is this a bug in WiX, or a limitation in MSI?


So to summarize, there are two possible bugs:

1. you can't recursively search for a file without specifying its parent folder 
(the file must be found at an effective depth of 0)

2. you can't recursively search for the parent folder either (the file's parent 
folder must also be found at an effective depth of 0)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1656236&group_id=105970

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to