OnAppSearch

InstallShield 2016 » InstallScript Language Reference

Project • This information applies to the following project types:

InstallScript
InstallScript MSI

The OnAppSearch event handler responds to the Application Search event. Code this handler in setups that must search for a specific application on the target computer. Your code might, for example, call FindFile to locate a key file, or RegDBKeyExist to search for a registry entry.

The following OnAppSearch function aborts the installation if a file called Notepad.exe is not available in the user's Windows or WinNT folder, or in a subdirectory of it.

function OnAppSearch( )

    NUMBER nResult;

    STRING svIgnore;

begin

    nResult =

        FindAllFiles(WindowsFolder, "Notepad.exe",

                     svIgnore, RESET);

 

    if (nResult < 0) then

        MessageBox("Unable to find a qualifying program. " +

                   "Setup will now exit.", SEVERE);

        abort;

    endif;

end;

Note • This event handler is not executed during a maintenance setup or uninstallation.