This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- FindFile Command
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 10, 2011
03:14 PM
FindFile Command
I have tried just about ever syntax combo I can think of on this code and it will NOT compile.
function OnFirstUIBefore()
number nResult, nLevel, nSize, nSetupType;
string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
string szName, szCompany, szTargetPath, szDir, szFeatures;
BOOL bLicenseAccepted;
#define FILE_SPEC "notepad.exe"
#define SEARCH_DIR "C:\Winodws"
#define TITLE_TEXT "InstallScript Sucks!!"
STRING svResult;
begin
FindFile (SEARCH_DIR, FILE_SPEC, svResult);
MessageBox (TITLE_TEXT, svResult );
end;
I've wrapped each variable in quotes, no quotes etc....etc... and nothing works.
What am I not doing?
function OnFirstUIBefore()
number nResult, nLevel, nSize, nSetupType;
string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
string szName, szCompany, szTargetPath, szDir, szFeatures;
BOOL bLicenseAccepted;
#define FILE_SPEC "notepad.exe"
#define SEARCH_DIR "C:\Winodws"
#define TITLE_TEXT "InstallScript Sucks!!"
STRING svResult;
begin
FindFile (SEARCH_DIR, FILE_SPEC, svResult);
MessageBox (TITLE_TEXT, svResult );
end;
I've wrapped each variable in quotes, no quotes etc....etc... and nothing works.
What am I not doing?
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 10, 2011
03:41 PM
hh1234 wrote:
I have tried just about ever syntax combo I can think of on this code and it will NOT compile.
function OnFirstUIBefore()
number nResult, nLevel, nSize, nSetupType;
string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
string szName, szCompany, szTargetPath, szDir, szFeatures;
BOOL bLicenseAccepted;
#define FILE_SPEC "notepad.exe"
#define SEARCH_DIR "C:\Winodws"
#define TITLE_TEXT "InstallScript Sucks!!"
STRING svResult;
begin
FindFile (SEARCH_DIR, FILE_SPEC, svResult);
MessageBox (TITLE_TEXT, svResult );
end;
I've wrapped each variable in quotes, no quotes etc....etc... and nothing works.
What am I not doing?
If its a direct copy/paste of your script... it could be that you misspelled the directory name wrong "c:\Winodws" instead of "c:\windows"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 10, 2011
03:45 PM
Even when Windows is spelled right it still fails 🙂 No matter what I try it will not compile.
How hard can it be to search for a file? I came from Wise Script Editor which blows this tool away. With Wise you don't have to define anything you just do it. Question for you and this board......do you actually have to add a bunch of #define command every time you want to search for a file or a reg key?
How hard can it be to search for a file? I came from Wise Script Editor which blows this tool away. With Wise you don't have to define anything you just do it. Question for you and this board......do you actually have to add a bunch of #define command every time you want to search for a file or a reg key?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 11, 2011
02:53 PM
Check the parameters you're supplying to the functions.
One obvious thing, without even looking at the help is that MessageBox takes a string followed by a message type (INFORMATION|WARNING|SEVERE) as parameters...
One obvious thing, without even looking at the help is that MessageBox takes a string followed by a message type (INFORMATION|WARNING|SEVERE) as parameters...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2011
02:39 PM
you need two \\ to make one \ in real life
from the documentation:
from the documentation:
/*--------------------------------------------------------------*\
*
* InstallShield Example Script
*
* Demonstrates the FindFile function.
*
* FindFile is called to search for the file Config.sys in the
* root of drive C.
*
\*--------------------------------------------------------------*/
#define FILE_SPEC "Config.sys"
#define SEARCH_DIR "C:\\"
#define TITLE_TEXT "FindFile Example"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_FindFile(HWND);
function ExFn_FindFile(hMSI)
STRING svResult;
begin
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;