User Guide
170
Performing a System Search
Performing a System Search
Use the System Search page to search the destination computer:
! To find a previous version of your application that wasn’t installed using Windows
Installer technology.
! To find any files, directories, .INI files, registry entries, or components of a previous
version of your application. You can specify the items to search for and then code the
installation so the new version is placed in the same location as the previous one,
rather than in a default location.
! To look for a specific third-party application. Example: You might want to include a
feature in your application that is only installed if a certain application is already
installed on the destination computer.
At runtime, the installation searches for the items indicated on the System Search page
and places the results in properties you specify. There is no order to the search,
therefore you can’t make one entry depend on another.
See:
! Searching For Files or Directories on page 170
! Searching For Items in .INI Files on page 172
! Searching For a Registry Value on page 174
! Searching For a Previously-Installed Component on page 175
For information on searching for previous versions, see Searching for Existing
Applications, Files, Registry Entries, or .ini File Entries in the Windows Installer SDK
Help. You can get the product code GUID of the previous installation by filling in the
Action Property field on the Upgrade dialog. See Creating an Upgrade on page 311.
Searching For Files or Directories
On the System Search page, you can set up a search for a file or directory on the
destination computer. To find a directory, you must search for a specific file contained
inside the directory. When you search for a file, Windows Installer stops searching as
soon as it finds the first file or directory that matches your specification. Therefore, it’s
important that you specify unique file or directory attributes for your search. You can
specify to return either the full file path or just the directory that contains the file.
1. Select Installation Expert > System Search page.
2. Click Add at the right of the page and select File or Directory.
The Search for File dialog appears.
3. Complete the dialog:
• Property
Specify a property name. It will hold the result of the search, which is a file name
or directory path. If you’ve already defined a new public property (all uppercase)
in the Properties icon on the Product tab, then you can select it from the list;
otherwise enter a new property name (all uppercase). If you enter a new
property name, and the search fails to find a match, the property value will be
null and will be false if used in a condition.
Operation
Select the type of entry for the property: