PDA

View Full Version : Using System Search in FindFile



neddyflanders
11-29-2005, 10:08 AM
Hello, I am doing a system search to find a path to a file (Folder Path, by searching Folders) and I give this search a property name (FILEPATH). I am then running a custom action which calls the following installscipt. It seems straightforward but the value from the system search is not being inserted and I get a FindFile failed. Any help would be appreciated:)



#define FILE_SPEC "MyFile.exe"

// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"

export prototype ExFn_FindFile(HWND);

function ExFn_FindFile(hMSI)
STRING svResult, Search_Dir;
begin

Search_Dir = 'FILEPATH'
if (FindFile (Search_Dir, FILE_SPEC, svResult) < 0) then
MessageBox ("FindFile failed.", SEVERE);
else
SprintfBox (INFORMATION, TITLE_TEXT, "Found: %s in %s.", svResult,
Search_Dir);
endif;

end;