The System Search view in InstallShield provides the Windows Installer capability to search for a particular file, folder, registry key, .ini file value, or .xml file value on a user’s system prior to an installation. This feature enables you to perform application, version, and configuration data searches.
Example.
We have an application in which the INSTALLDIR vary based on the location of a particular file.
In this case we can not have a specific installdir set.
Let this file be AcroRd32.exe which is present in the C:\Program Files\Adobe\Reader 8.0\Reader.
We have to Install the application where this AcroRd32.exe is located.
Now we know that it is located at C:\Program Files\Adobe\Reader 8.0\Reader.
But for different users may have different version of the Reader installed It can be Reader 7.0 but the file name remain the same AcroRd32.exe for all the versions od reader.

So before installing the application we need to find the location of AcroRd32.exe.
Go to system search in the installshield. Right click on the right panel and click Add.
Then you will get a list of option on how and what to search.
In this Example we are seraching a file called AcroRd32.exe which we know that it will be inside Adobe folder.
Right click add then a wizard will be opened there click on the first option which is File path by searching folder and then click next. See the above screen shot.
Next You have to specify the file which you have to search and the location.See the below screen. Path where the file located. We know that the reader file will be inside Adobe folder. So give the path as [ProgramFilesFolder]Adobe and the max no of sub folder to check as 4 so that it will check 4 folder down the Adobe folder.

Click next Now Specify a property name so that the path will be returned to this property. You can give any name but it should be in capital letters.
ACROREADER is the name given .
Now when it find the file AcroRd32.exe the path to that file will be staored in this property so that we can use the propert in custom action or in launch condition.

Click finish.
Now we will have the path C:\Program Files\Adobe\Reader 8.0\Reader in the property ACROREADER.
It can be C:\Program Files\Adobe\Reader 7.0\Reader for another user
Therfore INSTALLDIR will be set based on this property.
Now go to DIRECTORY table.
There modify the INSTALLDIR Row.see the screen shot below.
Give Directory_Parent as TARGETDIR and DefaultDir as “.”

Now we have to set the INSTALLDIR runtime for that we have to write a custom action to set INSATLLDIRECTORY.
Go to Custom Action wizard.click next

Give a Name for customaction and click next.
Here select Type as Set a directory. And click Next.

Click next .
You have to give the Directory name which you want to set during runtime.
We have to set INSTALLDIR so give source as INSTALLDIR
And target is what value it has to set. We want the target as the path the system search returns which is ACROREADER .
Give TARGET as [ACROREADER] in square brackets
NOTE: properties whenver used in custom action should be in square bracket.

Click next until it close the wizard.
Now see the right panel.
Give the sequence .
As I said earlier we give the sequence in the Execute sequence because we install MSI silently.
We place the custom action after Cost finalize action which is a standard action more information will be avaible in help. Click on custom action and press F1 for help on specific topics.
Install Exec Sequence is After Costfinalize and
Insatll Exec Conditin is NOT Installed.
You can have the sequence view in the sequence section right below the custom action section see the below screen shots.



