MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: FilesExcludeClear[Next]: FileMake
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->FileFind

The "FileFind" Command

This command is used to find a file or directory (perhaps to validate its existance).

Unfortunately the Windows Installer "AppSearch" logic is not smart enough to be able to search the "PATH" environment variable.

The found item's name is placed into a property specified by you.

As the search is done via an "AppSearch" table entry, you may wish to modify the sequencing of this action.

This command takes these parameters:

EXAMPLES

Look for "PPWIZARD.REX" to a maximum directory depth of 4:

<$FileFind File="PPWIZARD.REX" Property="PPWIZARD.REX" Depth=4>
<$FileFind File="IEXPLORE.EXE" Property="IEXPLORE.EXE" Path="[ProgramFilesFolder]">
#(
   <$FileFind
           File="JAR.EXE"
       Property="JAR.EXE"
           Path="[ProgramFilesFolder]"
        Message=^Could not install this product as "JAR.EXE" could not be
                 located in the "[ProgramFilesFolder]" directory tree!^
   >
#)

EXAMPLE - Does Directory Exist?

In the following, if the directory doesn't exist then a message will be displayed (implements a "launch condition"):

<$FileFind File="" Property="SOMEDIR" Path="c:\SomeDir\SomeSubDir">

For an example of finding a file that may be located in more than one place have a look at the "Finding 'WSCRIPT.EXE' or 'CSCRIPT.EXE' Files" tip


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: FilesExcludeClear[Next]: FileMake


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Friday October 13 2017 at 2:08pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.