prototype GetNetworkDirFQN(BYREF STRING);
[...]
sTargetDir = "\\megalith";
nResult = GetNetworkDirFQN(sTargetDir);s
switch (nResult)
case BACK: MessageBox ("the back", INFORMATION);
case NEXT: MessageBox ("the next", INFORMATION);
case CANCEL: MessageBox ("abort", INFORMATION);
endswitch;
[...]
function GetNetworkDirFQN(sTargetdirFQN)
// isdll.dll must be in:
// <project>\Setup Files\Compressed Files\<Language>\Intel
32\isdll.dll
// when building the project
// but this routine will check it before running into the depth
//
// give back as reference: the choosen sTargetdirFQN
// give back as result of function: NEXT, BACK, CANCEL
STRING szDLL;
// how the window looks like
STRING sWindowStrings;
STRING szTitle, szInfo, szFile, szString;
STRING sResult;
STRING sRescueTargetDir;
LONG nValue, nResult;
LONG nKeyNext, nKeyBack, nKeyCancel;
begin
// this variables to be defined for calling the dll
// define the values of the buttons of the internal function
of the DLL
nKeyNext = 1;
nKeyCancel = 2;
nKeyBack = 4;
// this in the program itself
// rescue given sTargetdirFQN which was default
sRescueTargetDir = sTargetdirFQN;
// the isdll.dll is in the installshield-directory <project>\Setup
Files\Compressed Files\
// <Language>\Intel 32\isdll.dll
// this makes that isdll.dll is packed into the _user1.cab and this
is the archive which
// is packed out into the "SUPPORT" temporary directory on
the harddisk
szDLL = SUPPORTDIR ^ "ISDLL.DLL";
if (FindFile(SUPPORTDIR, "ISDLL.DLL", sResult) < 0) then
MessageBox("While calling GetNetworkDirFQN the File "
+ szDLL + " was not found. I abort installation.", SEVERE);
abort;
endif;
// Initialize inputs
nValue = 3000;
szTitle = "This is the title of the window";
szInfo = "Setup will install the program 'yoman32' in the following
directory." +
"\n\nTo install in this directory, click 'Next'." +
"\n\nTo install in another directory, click 'Browse' and choose
another directory."+
"\n\nClick on 'abort' if you choose not to install the program.";
// Initial Targetdir is the given one, this variable will get
changed
szFile = sTargetdirFQN;
// This is the format how we give the strings of the setup to
the dll
// separated with #
sWindowStrings = szTitle + "#" + szInfo + "#" +
szFile ;
// Show inputs to users
//SprintfBox( INFORMATION, "", "Before - nValue: %i ,
szString: %s", nValue, szString );
// Call DLL function; pass by value.
// You don't have to call "Use" and "Unuse" with
this kind of method
Disable(DIALOGCACHE);
nResult = CallDLLFx( szDLL, "Fkt01", nValue, sWindowStrings
);
Enable(DIALOGCACHE);
// Show values returned by DLL function
SprintfBox( INFORMATION, "", "Returned - nValue: %i ,
szString: %s, nResult: %i", nValue,
szString,nResult );
// what keys has been pressed while being in the window?
if (nResult == nKeyCancel) then
// bInstallAborted = TRUE;
// return -1;
// give back the original given directory
sTargetdirFQN = sRescueTargetDir;
return CANCEL;
endif;
if (nResult == nKeyBack) then
sTargetdirFQN = sRescueTargetDir;
return BACK;
endif;
// else... he has choosen a directory
// sTargetdirFQN
return NEXT;
end; |