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]: FilesInZip[Next]: FileFindInListedDirs
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 the "AppSearch" table entry, you may wish to modify the sequencing of this action.

If you don't need to search a tree (depth > 1) or you can list possible directories then you may find the similar "FileFindInListedDirs" command useful.

$$TODO FIX DOCO

This command takes these parameters (plus most parameters from "FileFind" to do with specifying the file's characteristics):

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]: FilesInZip[Next]: FileFindInListedDirs


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
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.