home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-06-24 | 135.7 KB | 3,811 lines
''/********************************************************************* '' '' Module Name: setupapi.lss '' '' Module Code: TOOLKIT '' '' Author: '' '' Creation Date: Aug 31, 1993 '' '' Copyright Lotus Development Corporation, (c) 1991 '' '' '' '' Description: '' Lotus script file for common install '' '' '' Additional authors: '' '' Change History: '' $Log: //CIT/VOL1/CFLOG/logfiles/cominst/toolkit/setupapi.l@s $ '' '' Rev 1.119 24 Jun 1996 15:53:00 jdonohue '' Ref SPR: RWIS36THFG '' Fixed problem with UNC paths in functions GetWindowsDir and GetWindowsSysDir '' Added terminal backslash to return value in GetWindowsDir and GetWindowsSysDir '' '' Rev 1.118 14 Jun 1996 16:42:28 jdonohue '' Added RebootLater Flag to indicate reboot required but deferred '' '' Rev 1.117 10 Jun 1996 15:04:20 mhishinu '' Replaced three LEFT calls with LEFTBP to fix DBCS bug. '' '' Rev 1.116 10 Jun 1996 11:06:48 jdonohue '' Ref SPR: GEM16136 '' Added call to Lot_TrimEndslash in Lot_CreateRegKeyValueEx '' Moved Lot_TrimEndSlash to setupapi.lss '' '' Rev 1.115 06 Jun 1996 13:55:38 jdonohue '' Removed reference to obsolete MS-Setup function FIsDirWritable '' '' Rev 1.114 30 May 1996 12:15:18 jdonohue '' Added Lot_ShellExec function '' '' Rev 1.113 22 May 1996 15:24:56 jdonohue '' Replaced LEFTBP calls with LEFT '' '' Rev 1.112 02 May 1996 09:21:00 glutz '' Added function RemovePriorVersion() for sspawning Uninstall. '' '' Rev 1.111 25 Apr 1996 13:57:50 schen '' backed out addition of closedown function '' '' Rev 1.109 03 Apr 1996 13:39:08 jdonohue '' Ref SPR: ODMOO335PU6 '' Added function Lot_DeleteFile and wrappers for old MS Setup functions '' FValidFATPath and FValidPath that call Lot_ValidPath '' '' Rev 1.108 29 Mar 1996 12:34:20 jdonohue '' Moved Lot_IsNewShell from lcomstf.dll to mscuistf.dll '' '' Rev 1.107 29 Feb 1996 13:50:44 jdonohue '' Ref SPR: SSAO334QY4 '' Changed RegCloseKeyA to RegCloseKey in alias '' '' Rev 1.106 28 Feb 1996 12:16:44 jdonohue '' Added declarations of Lot_RegisterOCX and Lot_UnRegisterOCX '' '' Rev 1.105 24 Jan 1996 16:17:32 jdonohue '' Ref SPR: JHOH327JRZ '' Fixed error in IsNewShell return value '' '' Rev 1.104 23 Jan 1996 16:15:22 cmoy '' HISHI: Merged FE changes '' '' Rev 1.103 18 Jan 1996 16:51:12 jdonohue '' Changed IsNewShell function to call C routine Lot_IsNewShell '' '' Rev 1.102 12 Jan 1996 10:01:16 jdonohue '' Added flag for server install to shared windows location '' '' Rev 1.101 28 Dec 1995 10:55:34 jdonohue '' Replaced MS Setup call CbGetEnvVariableValue with WIn API call GetEnvironmentVariable '' '' Rev 1.100 21 Dec 1995 14:15:52 jdonohue '' Removed obsolete functions '' Replaced MS Setup call CbGetIniKeyString with Windows call '' GetPrivateProfileString '' '' Rev 1.99 Oct 24 1995 16:55:02 cmoy '' removed eof char '' '' Rev 1.98 24 Oct 1995 11:33:14 glutz '' IsLonfDirPath checks validity of symbols before manipulating them. '' Lot_GetRegKeyValueEx passes local buffer size to GetRegKeyValueEx. '' '' Rev 1.97 23 Oct 1995 18:25:56 tveerapp '' Fixed spr#???. TV and PDonahue. Modified Lot_GetRegKeyValue. Checks if the '' GetRegKeyValue call returned error_success and dwType is not REG_NONE. '' '' Rev 1.96 22 Oct 1995 17:27:34 cmoy '' HISHI: Added GetDBCSSymbolValue and GetDBCSListItem functions '' They are valid for double-byte characters. '' Reg_GetRootFolder, GetGroupName and PROGMANGROUPCB call them. '' '' Rev 1.95 22 Sep 1995 12:52:56 jdonohue '' Changed LdString string size limit back to 255 because of RED limitation '' '' Rev 1.94 22 Sep 1995 12:17:40 amontalv '' Check for focus before making change to Program Folder entry in tree from edit line. '' '' Rev 1.93 15 Sep 1995 17:02:38 glutz '' SetSybolValue will error out if the symbol name string is empty. '' '' Rev 1.92 13 Sep 1995 17:09:18 amontalv '' Moved Lot_RegAppPath from setupapi.lss to toolkit.lss and also added a parameter. '' Lot_RegAppPath now register the registry entry . '' '' Rev 1.91 06 Sep 1995 14:07:30 amontalv '' Have NT create App path entries in Windows so that when the new shell comes along '' this will be already set. '' '' Rev 1.90 02 Sep 1995 15:30:32 amontalv '' Added definition of Lot_CheckPrivileges() which lives in regwrap.c of lotussrc. '' '' Rev 1.89 31 Aug 1995 12:16:18 jdonohue '' Added GetDriveType prototype '' '' Rev 1.88 30 Aug 1995 19:10:42 amontalv '' Added code to create environment key if it is missing. Also deal with existing '' path more intelligently. '' '' Rev 1.87 29 Aug 1995 08:35:42 jdonohue '' Fix WEDS2VENXL: Reg_AppPath use SYM_NETCOMPONENT for node '' '' Rev 1.86 24 Aug 1995 10:24:10 glutz '' Added function IsLongDirPath to check for long directory names. '' '' Rev 1.85 23 Aug 1995 16:42:08 amontalv '' Put a wrapper around EnableWindow to prevent trying to enable null window. '' '' Rev 1.84 22 Aug 1995 14:04:38 glutz '' IsDirWritable no longer gets the short path name. '' '' Rev 1.83 21 Aug 1995 15:41:52 amontalv '' Put name of registry keys into globals.lss '' '' Rev 1.82 16 Aug 1995 20:33:10 amontalv '' Added code to do error messages for registry. '' '' Rev 1.81 14 Aug 1995 16:47:16 mmeth '' Modified the functions: '' SetRegKeyValueEx-->SetRegKeyValueExS and SetRegKeyValueExD '' and '' CreateRegKeyValueEx-->CreateRegKeyValueExS and CreateRegKeyValueExD '' therefroe the two places where these functions are called have been '' modified accordingly. '' '' Rev 1.80 11 Aug 1995 16:47:50 mmeth '' FindWindows has changed on WIndows 32 to FindWindowsA '' '' Rev 1.79 11 Aug 1995 15:04:30 glutz '' DoesFileExist now calls Lot_DoesFileExist. '' '' Rev 1.78 09 Aug 1995 16:11:12 jdonohue '' Added GetLastError declaration '' '' Rev 1.77 09 Aug 1995 14:46:56 glutz '' DoesDirExist now calls Lot_DoesDirExist. '' '' Rev 1.76 08 Aug 1995 17:30:32 jdonohue '' Added declaration of FGetNameForResourceDLL '' '' Rev 1.75 03 Aug 1995 15:22:36 amontalv '' Checked in changes for setting system path on NT. '' '' Rev 1.74 01 Aug 1995 17:10:40 amontalv '' Added comments '' '' Rev 1.73 01 Aug 1995 14:21:44 amontalv '' Added Lot_RegAppPath(). '' '' Rev 1.72 31 Jul 1995 18:28:24 amontalv '' Added routine to add App Paths to registry. '' '' Rev 1.71 27 Jul 1995 11:03:48 amontalv '' Added call Lot_AddLinkIconToFolder so that icon information can be sent '' when creating a shortcut. '' '' Rev 1.70 25 Jul 1995 10:32:04 amontalv '' Moved ShortPath check to inside of GetShortPathName. '' '' Rev 1.69 25 Jul 1995 10:16:36 amontalv '' Put in a check to make sure we got back a value from GetShortPath. '' '' Rev 1.68 20 Jul 1995 12:57:58 jdonohue '' Changed CopyFile to FCopyFile, which calls Win32 CopyFile instead of MS-Setup '' FCopyOneFile '' '' Rev 1.67 20 Jul 1995 10:50:00 glutz '' GetFreeSpaceForDrive now returns free space in K bytes, also accepts full '' paths with either drive letter or UNC volume. '' '' Rev 1.66 17 Jul 1995 12:17:10 jdonohue '' Removed trailing blanks from FOpen/CloseLogFile declaration '' '' Rev 1.65 17 Jul 1995 10:24:52 pdonahue '' changed registry functions to take variant type buffer. '' '' Rev 1.64 13 Jul 1995 15:50:14 jdonohue '' Changed Lot_CleanPath MBCS handling '' '' Rev 1.63 10 Jul 1995 12:03:54 glutz '' IsDirWritable now calls Lot_IsDirWritable '' '' Rev 1.62 29 Jun 1995 11:56:34 glutz '' Added wrappers for Lot_GetShortPath, Lot_regedit, Lot_CreateIniKeyValue '' '' Rev 1.61 26 Jun 1995 13:29:12 glutz '' Added wrapper for Lot_createDirectory '' '' Rev 1.60 23 Jun 1995 14:39:34 jdonohue '' Added declaration of FGetHandleForResourceDLL '' '' Rev 1.59 23 Jun 1995 08:22:16 jdonohue '' ShowWaitCursor and RestoreCursor does nothing '' '' Rev 1.58 22 Jun 1995 12:41:26 jdonohue '' Added FindResource Windows call '' '' Rev 1.57 21 Jun 1995 21:55:20 amontalv '' Added GetUserName to get network name as a last resort. '' '' Rev 1.56 19 Jun 1995 11:20:22 tveerapp '' Fixed InitFrame. When InitializeFrame returns a 0 , the cmd line '' processing failed on an argument. Quit script whern InitializeFRame returns '' 0. '' '' Rev 1.55 19 Jun 1995 10:27:32 amontalv '' Put in code to add function to New Folder button and Remove Folder button. Also '' fixed some of the selection problems in the tree list. '' '' Rev 1.54 15 Jun 1995 19:40:46 amontalv '' Checked for and changed integers passed to C functions. Changed to longs. '' '' Rev 1.53 14 Jun 1995 16:31:32 amontalv '' Fixed problem with NT Program Groups. Look through the registry for '' program groups and display them for the user. Most of the code '' is in C in lotusui.c. Put calls to registry functions in regwrap. '' '' Rev 1.52 13 Jun 1995 11:21:30 jdonohue '' Fixed typos '' '' Rev 1.51 08 Jun 1995 16:37:08 jdonohue '' Added IDCANCEL constant '' '' Rev 1.50 08 Jun 1995 14:28:50 tveerapp '' Fixed SendlDlgItemMessageLb declaration. '' '' Rev 1.49 08 Jun 1995 14:20:36 tveerapp '' Added SendDlgItemMessageLb which is an alias to SendDlgItemMessage '' to fix spr # TVEN2PXSJ2. '' '' Rev 1.48 07 Jun 1995 13:03:24 jdonohue '' Added prototype for WhatPlatform for calling from script '' '' Rev 1.47 06 Jun 1995 15:59:16 amontalv '' We are experiencing problems with LotusScript when we fill buffers with '' nulls and then pass them to C routines. For the time being, it is suggested '' that we fill our buffers with spaces. To this end (and to make it '' easier to change back later) I have created a small LotusScript routine '' named CreateBuffer. You use it any time you ordinarily would use '' STRING$(num, 0). CreateBuffer() just needs the num, it decides what to '' fill the buffer with (sorry about the grammer). Right now it fill the '' buffer with spaces. Later we will change it back to nulls. Also look '' at the routine NullTrim(). It will get rid of final nulls and spaces. '' You can use this when getting a buffer that has been changed or filled '' in a external C routine. '' '' Rev 1.46 05 Jun 1995 16:37:06 amontalv '' Made changes for migrating to LotusScript version 3.0.37. '' '' Rev 1.45 01 Jun 1995 15:23:12 pdonahue '' changed createregkeyvalue to check for 1 if the key exist rather than 0. '' '' Rev 1.44 01 Jun 1995 14:00:28 amontalv '' Needed to change the size of the passed arguments to correspond to 4 args '' no that's 5 args instead of 3. '' '' Rev 1.43 01 Jun 1995 13:13:14 amontalv '' Added CreateLink to create shortcuts. '' '' Rev 1.42 01 Jun 1995 12:39:00 jdonohue '' Added call to FKillNdialogs3 to replace Microsoft function '' '' Rev 1.41 01 Jun 1995 11:11:34 pdonahue '' modified Lot_GetRegKeyValue to pass dwtype,lpbuff and cbuf by reference. '' '' Rev 1.40 31 May 1995 14:55:56 pdonahue '' Removed invalid byval references in registry functions '' '' Rev 1.39 30 May 1995 15:24:56 mzgripce '' add some ByVal to the reg arguments, add headers to the reg functions and '' add _ in the name of two Reg functions declarations '' '' Rev 1.38 30 May 1995 12:56:32 jdonohue '' Call to FdoDialog3 for multiple DLLs '' '' Rev 1.37 30 May 1995 09:26:02 amontalv '' Added back my changes. Had not made changes to setupapi.lss to declare '' functions. '' '' Rev 1.36 26 May 1995 15:07:40 cmoy '' added A to regsetkey functions '' '' Rev 1.35 26 May 1995 14:15:42 pdonahue '' fixed lot_createregkey. '' '' Rev 1.34 22 May 1995 23:32:12 amontalv '' Added browse for Win 95 program folder. '' '' Rev 1.33 19 May 1995 14:43:42 pdonahue '' fixed registry function api. '' '' Rev 1.32 15 May 1995 17:33:24 amontalv '' Fixed SPR JHOH2RWGQX and JMOY2RXNKM. Had wrong case on 'b' of function '' declaration of IsDlgButtonChecked(). '' '' Rev 1.31 15 May 1995 11:38:50 jdonohue '' Added LdStringInit function to initialize SYM_CUIDLL with list of DLLs and '' make sure libraries loaded '' '' Rev 1.31 15 May 1995 11:16:10 jdonohue '' Added LdStringInit function to initialize SYM_CUIDLL with list of DLLs and '' make sure libraries loaded '' '' Rev 1.30 11 May 1995 17:05:26 tveerapp '' Changed WriteToFile to a sub. '' '' Rev 1.29 02 May 1995 17:49:22 mzgripce '' fix syntax errors in the new feature code '' '' Rev 1.28 02 May 1995 12:53:02 cmoy '' Merged c2 into cf build '' '' Rev 1.29 19 Apr 1995 14:54:56 mheerman '' Changed the prototype for WinHelp to include the new suffix A to indicate '' the ASCII version of the call. '' '' Rev 1.27 21 Apr 1995 10:11:52 pdonahue '' added Registry wrappers '' '' Rev 1.28 14 Apr 1995 16:04:06 amontalv '' Delete space from FRestoreCursor name so that LotusScript could find it in the DLL. '' '' Rev 1.27 10 Apr 1995 17:54:54 amontalv '' Had to change some function definitions for script to find functions. '' '' Rev 1.26F 19 Apr 1995 14:56:58 jdonohue '' Changed LdString to look in a list of DLLs for string SYM_CUIDLL$ '' Moved Lot_GetNthFieldFromIniString from toolkit.lss '' '' Rev 1.25 06 Apr 1995 21:02:52 amontalv '' Changed the exported functions parameters to match those of the new '' 32 bit functions. I changed as little as I thought possible. '' '' LSS 32 bit port merge changes. '' '' Rev 1.24 05 Apr 1995 19:52:54 amontalv '' Porting to 32 bit. '' '' Rev 1.23 31 Mar 1995 18:47:32 amontalv '' Had to make Script file names into Unicode before LotusScript would read '' them. '' '' Rev 1.22 07 Jan 1995 16:09:58 jplump '' '' In InitFrame, commented out display of error message '' (SID_ERR_COMMANDLINE). This message is no longer '' needed, especially since we now have a usage screen '' that will be displayed. '' SPR JHOH2MPJ6X '' '' Rev 1.21 05 Dec 1994 16:23:18 mzgripce '' added FWriteToFile() declaration and WriteToFile()wrapper. '' '' Rev 1.20 18 Nov 1994 16:12:48 amontalv '' Japan DBCS: Added some resources to '' '' Rev 1.19 26 Sep 1994 16:30:44 cmoy '' No change. '' '' Rev 1.18 10 Jun 1994 15:19:46 ddupre '' Removed MB_SYSTEMMODAL flag from ErrorMsg. '' '' Rev 1.17 10 Jun 1994 14:35:06 ddupre '' '' Added MB_SYSTEMMODAL flag to ErrorMsg subroutine. '' '' Rev 1.16 03 Jun 1994 12:09:46 cmoy '' Modified CreateProgmanItem to accept accented characters. '' '' Rev 1.15 26 May 1994 18:35:18 cmoy '' '' Added ProgmanManageGroup declaration. '' '' Rev 1.14 25 May 1994 17:05:06 mzgripce '' suppress the remove failed message '' '' Rev 1.13 25 May 1994 14:39:38 cmoy '' '' added FindWindow declaration '' '' Rev 1.12 12 May 1994 11:25:38 mmeth '' Adding Icons for Lic and Install and using DoMsgBox instead of MessageBox '' '' Rev 1.11 02 May 1994 16:09:52 ddupre '' Removed debug comments from PopAll subroutine. -- JGreene '' '' '' Rev 1.10 02 May 1994 13:57:08 mmeth '' SetFoxu & GetParent are public '' '' Rev 1.8 24 Apr 1994 14:41:18 cmoy '' Fixed problem of "vanishing" Error Msg Box. '' Added MB_SYSTEMMODAL to specification of type of message box '' to put up in SUB ErrorMsg '' '' Rev 1.7 13 Apr 1994 09:43:02 cmoy '' '' Added Rebooting return codes and declarations used in '' the modification of AUTOEXEC.BAT '' '' Rev 1.6 08 Apr 1994 11:34:20 mmeth '' cleanedup error messages '' '' Rev 1.5 28 Mar 1994 17:03:48 thangv '' Added the ASSERT statement to LdString function. Removed the if. '' '' Rev 1.4 26 Mar 1994 16:33:18 p3 '' Datalens Install changes for ODBC driver '' '' Rev 1.3 22 Mar 1994 12:37:00 mmeth '' added some more error handling for GetListItem and SetListItem '' '' Rev 1.2 17 Mar 1994 16:49:08 mmeth '' added check for LOTUS_DEBUG in shell '' '' Rev 1.1 16 Mar 1994 17:30:12 mmeth '' Mariana & Marcel Code Review '' '' Rev 1.0 11 Feb 1994 10:56:30 jbrodeur '' Initial Revision ''---------------------------------------------------------------------- '' Date Vers. Pgmr SPR# Change ''---------------------------------------------------------------------- '' 02-06-94 0047 MMETH Added STFTOGGLE and MsgBox-> MessageB '' 02-03-94 0046 MMETH Added logging facilities ''! '' 01-26-94 0045 MMETH changed all string inits to string(...,0) '' 01-25-94 0044 DND Move SetRestartDir, RestartListEmpty, '' and ExitExecRestart to toolkit. '' 01-24-94 0043 TQI Capture all function returns (lsi36) '' 01-18-94 0042 MZ move Lot_CleanPath() from toolkit.lss '' 01-18-94 0041 DND Fix any functions that use paths. Also, '' always check for FALSE instead of 0. '' 01-11-94 0040 TQI option declare '' 01-10-94 0039 MZ Make all symbols Constants and put them '' in GLOBALS.LSS '' 01-07-94 0038 DND/MZ Removed lots of functions '' 12-20-93 0037 tqi Changes for LSI 34 '' 12-07-93 0036 MZ replace FRemoveDir() with Dave's function '' 12-06-93 0035 DND 25705 IsPathWritable Will now look backwards '' for a writable directory. The first directory '' it finds that exists will be the one that '' will be asked to be writable. '' 12-05-93 0034 MMETH Added IDYES & IDNO from windows.h '' 12-03-93 0033 DND Fixed the fatal errors. Most all the ERROR '' statements were changed to STFQUIT '' 12-01-93 0032 DND Added gStrK and gStrMB. Removed LdStr. '' MakePath returns lower case path. Commented '' out debug error messages in a bunch of '' Lot_ wrappers. '' 12-01-93 0031 DND Moved some functions over from new.lss. '' No longer call DoErrMsg. Removed DoErrMsg. '' 11-24-93 0030 MMETH Modified GetChapterFromKeyword parm list '' 11-24-93 0029 MMETH Removed chptsize% param from Lot_GetChapterFromKeyword '' 11-22-93 0028 JKEDIA Defined FIsKeywordInCopyList & FGetChapterFrom '' Keyword and wrote a wrapper for FGetChapterFromKeyWord. '' 11-19-93 0027 DND Added the HELP_ constants for WinHelp '' 11-19-93 0026 MMETH Replaced LdStrS with LdString '' 11-19-93 0025 MMETH Added LdStrS: LdStr will go away soon '' 11-18-93 0024 JKK Modified Lot_CheckPath to call FCleanFatPath '' instead of FValidFatPath. '' 11-17-93 0023 MZ Added Lot_Dir() '' 11-15-93 0022 DND Added F_KEYWORD '' 11-15-93 0021 JKEDIA defined NULLSTROK,INVALIDSTROK,NULLSTRERR,INVALIDSTRERR. '' Defined a function called GetAbsPathFromIni. '' 11-11-93 0020 MMETH change all Left$ -> RTRIM$ & inited all '' bufs to 0 insetad of 32s; This fixes Soraya's bug! '' 11-09-93 0019 Jkedia took out debugging print statements. '' 11-09-93 0018 JKEDIA modified GetWindowsDir & GetWindowsSysdir to '' call FCleanFatPath. '' 11-08-93 0017 JKEDIA modified IsWindowsShared to call FcleanFatPath. '' 11-08-93 0016 JKEDIA added FCleanFatPath. '' 11-05-93 0015 MMETH Uncommented prototype for SetCopyGaugePosition '' 11-04-93 0014 MMETH Don't send a help dialog in PopupModelessDialog '' 11-03-93 0013 DND Don't send a help dialog in PopupModalDialog '' 10-25-93 0012 DND Fixed modeless dialogs. Added UM_PAINTMODELESS '' Added SendMessage prototype. '' 10-24-93 0011 JKEDIA changed the value of USERNAME & COMPANYNAME. '' 10-23-93 0010 Jkedia Added GetModuleHandle. '' 10-20-93 0009 Jkedia Added 3 new prototype for reading and writing '' from .ri file. ReadUserRegistration,WriteUserRegistration, '' ReadSerialNumber. Alse added 2 new Public Const. '' Username & company name. '' 10-20-93 0010 MMETH Added Call to FLotusInitialze(LSIRUN(4)) '' 10-20-93 0009 MZ Add protptype fpr BcfMod() '' 10-20-93 0009 MMETH Added Some Window Prototypes '' also added FLotusInitialze LIB "lcomstf.dll" '' 10-19-93 0008 Jkedia Added prototype for WinExec and IsdlgButtonChecked. '' 10-18-93 0007 CHyland Added SID_ERR.... a whole bunch of them '' All ERrors, now resourced '' 10-15-93 0006 DND Changed all the krnl386's to kernel. '' Make sure to only reference the windows '' DLL's by library name - NOT by filename!!! '' If you reference by filename then you will '' not work when krnl386.exe or os2k386.exe '' is loaded. '' 10-14-93 0005 DND Added Lot_GetDriveFreeSpaceList '' 10-11-93 0003 MZ OpenBookShelfFile,CloseBookShelfFile '' AddBook '' 9-17-93 0002 JKK/TV defined a prototype for LcbGetChapterCost. ' ' 9-9-93 0001 JKK changed LSI(4) TO LSI_INFO(4) in RegisterCallBack. '' 8-12-93 0000 Initial Check-In '' 9-08-93 add Lot_SetDateOfFile() '' ''---------------------------------------------------------------------- '' ''*********************************************************************/ '************************************************************************** '******************************* Windows API's ************************** '************************************************************************** USE "RESOURCE" USE "GLOBALS" OPTION DECLARE '**************************CONSTANTS************************************ 'MS CONSTANTS '************* PUBLIC CONST LOGPIXELSY = 90 PUBLIC CONST SM_CXSCREEN = 0 PUBLIC CONST SM_CYSCREEN = 1 PUBLIC CONST WF_80x87 = 1024 PUBLIC CONST PROCESSOR_INTEL_PENTIUM = 586 PUBLIC CONST PROCESSOR_INTEL_486 = 486 PUBLIC CONST PROCESSOR_INTEL_386 = 386 PUBLIC CONST PROCESSOR_INTEL_860 = 860 PUBLIC CONST WF_STANDARD = 16 PUBLIC CONST WF_ENHANCED = 32 PUBLIC CONST USERNAME = 514 PUBLIC CONST COMPANYNAME = 515 PUBLIC CONST NULLSTROK = 0 PUBLIC CONST INVALIDSTROK = 0 PUBLIC CONST NULLSTRERR = 1 PUBLIC CONST INVALIDSTRERR = 1 '' TRANSLATED FROM WINDOWS.H for WinHelp PUBLIC CONST HELP_CONTEXT = 1 PUBLIC CONST HELP_QUIT = 2 PUBLIC CONST HELP_INDEX = 3 PUBLIC CONST HELP_CONTENTS = 3 PUBLIC CONST HELP_HELPONHELP = 4 PUBLIC CONST HELP_SETINDEX = 5 PUBLIC CONST HELP_SETCONTENTS = 5 PUBLIC CONST HELP_CONTEXTPOPUP = 8 PUBLIC CONST HELP_FORCEFILE = 9 PUBLIC CONST HELP_KEY = 257 '0x0101 PUBLIC CONST HELP_COMMAND = 258 '0x0102 PUBLIC CONST HELP_PARTIALKEY = 261 '0x0105 PUBLIC CONST HELP_MULTIKEY = 513 '0x0201 PUBLIC CONST HELP_SETWINPOS = 515 '0x0203 '' DoMsgBox Flags PUBLIC CONST MB_SYSTEMMODAL = 4096 PUBLIC CONST MB_TASKMODAL = 8192 PUBLIC CONST MB_OK = &H0000 PUBLIC CONST MB_OKCANCEL = &H0001 PUBLIC CONST MB_ABORTRETRYIGNORE = &H0002 PUBLIC CONST MB_YESNOCANCEL = &H0003 PUBLIC CONST MB_YESNO = &H0004 PUBLIC CONST MB_RETRYCANCEL = &H0005 PUBLIC CONST MB_TYPEMASK = &H000F PUBLIC CONST MB_ICONHAND = &H0010 PUBLIC CONST MB_ICONQUESTION = &H0020 PUBLIC CONST MB_ICONEXCLAMATION = &H0030 PUBLIC CONST MB_ICONASTERISK = &H0040 PUBLIC CONST MB_ICONMASK = &H00F0 PUBLIC CONST MB_ICONINFORMATION = MB_ICONASTERISK PUBLIC CONST MB_ICONSTOP = MB_ICONHAND PUBLIC CONST IDCANCEL = 2 PUBLIC CONST IDYES = 6 PUBLIC CONST IDNO = 7 '************MS Setup Constants ' ''Command Option Flags PUBLIC CONST cmoVital = 1 PUBLIC CONST cmoCopy = 2 PUBLIC CONST cmoUndo = 4 PUBLIC CONST cmoRoot = 8 PUBLIC CONST cmoDecompress = 16 PUBLIC CONST cmoTimeStamp = 32 PUBLIC CONST cmoReadOnly = 64 PUBLIC CONST cmoBackup = 128 PUBLIC CONST cmoForce = 256 PUBLIC CONST cmoRemove = 512 PUBLIC CONST cmoOverwrite = 1024 PUBLIC CONST cmoAppend = 2048 PUBLIC CONST cmoPrepend = 4096 PUBLIC CONST cmoNone = 0 PUBLIC CONST cmoAll = 65535 ''File Exist Modes PUBLIC CONST femExists = 0 PUBLIC CONST femRead = 1 PUBLIC CONST femWrite = 2 PUBLIC CONST femReadWrite = 3 ''Read-Only Return Code PUBLIC CONST ynrcNo = 0 PUBLIC CONST ynrcYes = 1 PUBLIC CONST ynrcErr1 = 2 PUBLIC CONST ynrcErr2 = 3 PUBLIC CONST ynrcErr3 = 4 PUBLIC CONST ynrcErr4 = 5 PUBLIC CONST ynrcErr5 = 6 PUBLIC CONST ynrcErr6 = 7 PUBLIC CONST ynrcErr7 = 8 PUBLIC CONST ynrcErr8 = 9 PUBLIC CONST ynrcErr9 = 10 ''Rebooting Return Codes PUBLIC CONST EW_RESTARTWINDOWS = 66 '0x42 PUBLIC CONST EW_REBOOTSYSTEM = 67 '0x43 ''Program Manager Configuration Codes PUBLIC CONST ADD_GRP = 0 ''General Return Codes PUBLIC CONST grcOkay = 0 PUBLIC CONST grcNotOkay = 1 PUBLIC CONST grcUserQuit = 48 ''Ranges ''CONST cbSymValMax = 8192 PUBLIC CONST cbSymValMax = 512 ''REVIEW: symbol table will allow strings up to 8192 bytes '' but we get Out of String Space wattdrvr error if we alloc '' STR$() that big. (See GetSymbolValue and GetListItem) '' We should look into using dynamic far alloc instead of '' STR$ for large buffers. '' NOTE: 8192 works okay with runtime wattdrvr, however. ''ON ERROR Error Codes PUBLIC CONST STFERR = 1024 ''setup system error PUBLIC CONST STFQUIT = 1025 ''user quit PUBLIC CONST STFTOGGLE = 1026 ''Toggle Error; not fatal at all, just means couldn't toggle PUBLIC CONST scmOff = 0 PUBLIC CONST scmOnIgnore = 1 PUBLIC CONST scmOnFatal = 2 'Registration Database Constants PUBLIC CONST ERROR_SUCCESS = 0 PUBLIC CONST GRC_API_FAILED = 104 PUBLIC CONST STILL_ACTIVE = 259 PUBLIC CONST REG_NONE& = 0 '* No value type PUBLIC CONST REG_SZ& = 1 '* Unicode nul terminated string PUBLIC CONST REG_EXPAND_SZ& = 2 '* Unicode nul terminated string '* (with environment variable references) PUBLIC CONST REG_BINARY& = 3 '* Free form binary PUBLIC CONST REG_DWORD& = 4 '* 32-bit number PUBLIC CONST REG_DWORD_LITTLE_ENDIAN& = 4 '* 32-bit number (same as REG_DWORD) PUBLIC CONST REG_DWORD_BIG_ENDIAN& = 5 '* 32-bit number PUBLIC CONST REG_LINK& = 6 '* Symbolic Link (unicode) PUBLIC CONST REG_MULTI_SZ& = 7 '* Multiple Unicode strings PUBLIC CONST REG_RESOURCE_LIST& = 8 '* Resource list in the resource map PUBLIC CONST REG_FULL_RESOURCE_DESCRIPTOR& = 9 '* Resource list in the hardware description PUBLIC CONST REG_RESOURCE_REQUIREMENTS_LIST& = 10 PUBLIC CONST PRIVILEDGE_CHECKFLAG_REGSYSTEMPATH = 1 '* flag passed to priviledge checking routine PUBLIC CONST HKEY_CLASSES_ROOT& = &h80000000 PUBLIC CONST HKEY_CURRENT_USER& = &h80000001 PUBLIC CONST HKEY_LOCAL_MACHINE& = &h80000002 PUBLIC CONST HKEY_USERS& = &h80000003 PUBLIC CONST HKEY_PERFORMANCE_DATA& = &h80000004 PUBLIC CONST HKEY_PERFORMANCE_TEXT& = &h80000050 PUBLIC CONST HKEY_PERFORMANCE_NLSTEXT& = &h80000060 '* Registry Specific Access Rights. PUBLIC CONST KEY_QUERY_VALUE = &h0001 PUBLIC CONST KEY_SET_VALUE& = &h0002 PUBLIC CONST KEY_CREATE_SUB_KEY& = &h0004 PUBLIC CONST KEY_ENUMERATE_SUB_KEYS& = &h0008 PUBLIC CONST KEY_NOTIFY& = &h0010 PUBLIC CONST KEY_CREATE_LINK& = &h0020 PUBLIC CONST SYNCHRONIZE& = &h00100000 PUBLIC CONST REG_OPTION_RESERVED& = &h00000000 '* Parameter is reserved PUBLIC CONST REG_OPTION_NON_VOLATILE& = &h00000000 '* Key is preserved '* when system is rebooted PUBLIC CONST REG_CREATED_NEW_KEY& = &h00000001 '* New Registry Key created PUBLIC CONST REG_OPENED_EXISTING_KEY& = &h00000002 '* Existing Key opened PUBLIC CONST REG_OPTION_VOLATILE& = &h00000001 '* Key is not preserved '* when system is rebooted PUBLIC CONST REG_OPTION_CREATE_LINK& = &h00000002 '* Created key is a '* symbolic link PUBLIC CONST REG_OPTION_BACKUP_RESTORE& = &h00000004 '* open for backup or restore '* special access rules '* privilege required PUBLIC CONST REG_WHOLE_HIVE_VOLATILE& = &h00000001 '* Restore whole hive volatile PUBLIC CONST REG_REFRESH_HIVE& = &h00000002 '* Unwind changes to last flush PUBLIC CONST REG_NOTIFY_CHANGE_NAME& = &h00000001 '* Create or delete (child) PUBLIC CONST REG_NOTIFY_CHANGE_ATTRIBUTES& = &h00000002 PUBLIC CONST REG_NOTIFY_CHANGE_LAST_SET& = &h00000004 '* time stamp PUBLIC CONST REG_NOTIFY_CHANGE_SECURITY& = &h00000008 PUBLIC CONST STANDARD_RIGHTS_ALL& = &h001F0000 PUBLIC CONST KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL OR _ KEY_QUERY_VALUE OR _ KEY_SET_VALUE OR _ KEY_CREATE_SUB_KEY OR _ KEY_ENUMERATE_SUB_KEYS OR _ KEY_NOTIFY OR _ KEY_CREATE_LINK) AND _ (NOT SYNCHRONIZE)) ''LOGO PUBLIC CONST LOGO = 2 ''TEMP PUBLIC CONST SW_HIDE = 0 PUBLIC CONST SW_SHOW = 5 PUBLIC CONST SW_SHOWNORMAL = 1 PUBLIC CONST SW_NORMAL = 1 PUBLIC CONST SW_SHOWMINIMIZED= 2 PUBLIC CONST SW_SHOWMAXIMIZED = 3 PUBLIC CONST SW_MAXIMIZE = 3 PUBLIC CONST SW_SHOWNOACTIVATE = 4 PUBLIC CONST SW_MINIMIZE = 6 PUBLIC CONST SW_SHOWMINNOACTIVE = 7 PUBLIC CONST SW_SHOWNA = 8 PUBLIC CONST SW_RESTORE = 9 '************************GLOBAL VARIABLES******************************* 'MS GLOBAL VARIABLES DIM hSetup AS INTEGER %rem DIM fFrameInit AS INTEGER DIM fInstallInit AS INTEGER %endrem 'LOTUS GLOBAL VARIABLES DIM g_strbuf AS STRING PUBLIC gStrK AS STRING PUBLIC gStrMB AS STRING DIM fLdStringInit AS INTEGER PUBLIC gIsSharedWindows% 'Flag is true for server install to shared 'windows environment PUBLIC RebootLater% ' Flag that user needs reboot and has selected to do later '**************************C STRUCTS ************************* TYPE SysInfoType dwOemId AS LONG dwPageSize AS LONG lpMinimumApplicationAddress AS LONG lpMaximumApplicationAddress AS LONG dwActiveProcessorMask AS LONG dwNumberOfProcessors AS LONG dwProcessorType AS LONG dwAllocationGranularity AS LONG dwReserved AS LONG END TYPE '**************************C CALLOUT PROTOTYPES************************* '' SHOULD BE IN 123.LSS, but LotusScript BUG Prevented this! DECLARE PUBLIC FUNCTION OpenBookShelfFile LIB "FIXBOOK.DLL" ALIAS "_OpenBookShelfFile" (ByVal bookshelfname$) AS INTEGER DECLARE PUBLIC FUNCTION CloseBookShelfFile LIB "FIXBOOK.DLL" ALIAS "_CloseBookShelfFile" () AS INTEGER DECLARE PUBLIC FUNCTION AddBook LIB "FIXBOOK.DLL" ALIAS "_AddBook" (ByVal bookpath$, ByVal bookcaption$) AS INTEGER ''this is a call into bcfmod.dll DECLARE PUBLIC FUNCTION BcfMod LIB "BCFMOD.DLL" ALIAS "_BcfMod@24" (ByVal BcfFilepath$, ByVal DNarg$, ByVal DLarg$, ByVal DCarg$, ByVal ACarg$, ByVal DDarg$) AS LONG '' NEW!! add call to modify ODBC.INI DECLARE PUBLIC FUNCTION FixODBCiniSources LIB "BCFMOD.DLL" ALIAS "_FixODBCiniSources@28" (ByVal IniFile$, ByVal Sect1$, ByVal Match1$, ByVal Repl1$, ByVal Sect2$, ByVal Match2$, ByVal Repl2$) AS LONG '' End NEW!! '** Do to a limitation in LotusScript, these Lotus declarations needed '** to be here. DECLARE PUBLIC FUNCTION FCleanFATPath LIB "lcomstf.dll" ALIAS "_FCleanFATPath@4" (ByVal szPath$) AS INTEGER DECLARE PUBLIC FUNCTION FLotusInitialize LIB "lcomstf.dll" ALIAS "_FLotusInitialize@4" (ByVal sess&) AS INTEGER DECLARE PUBLIC FUNCTION WhatPlatform LIB "lcomstf.dll" ALIAS "?WhatPlatform@@YGHXZ" () AS INTEGER DECLARE PUBLIC FUNCTION Lot_IsDirWritable LIB "lcomstf.dll" ALIAS "_Lot_IsDirWritable@4" (ByVal szDir$) AS LONG DECLARE PUBLIC FUNCTION Lot_DoesDirExist LIB "lcomstf.dll" ALIAS "_Lot_DoesDirExist@4" (ByVal szDir$) AS LONG DECLARE PUBLIC FUNCTION Lot_DoesFileExist LIB "lcomstf.dll" ALIAS "_Lot_DoesFileExist@4" (ByVal szDir$) AS LONG DECLARE PUBLIC FUNCTION Lot_ExecUninstall LIB "lcomstf.dll" ALIAS "_Lot_ExecUninstall@4" (ByVal szCmd$) AS LONG DECLARE PUBLIC FUNCTION Lot_RegisterOCX LIB "lcomstf.dll" ALIAS "_Lot_RegisterOCX@4" (ByVal OCXpath$) AS LONG DECLARE PUBLIC FUNCTION Lot_UnRegisterOCX LIB "lcomstf.dll" ALIAS "_Lot_UnRegisterOCX@4" (ByVal OCXpath$) AS LONG DECLARE PUBLIC FUNCTION Lot_ValidPath LIB "lcomstf.dll" ALIAS "_Lot_ValidPath@4" (ByVal Path$) AS INTEGER DECLARE PUBLIC FUNCTION Lot_DeleteFile LIB "lcomstf.dll" ALIAS "_Lot_DeleteFile@8" (ByVal Path$, ByVal cmo%) AS INTEGER DECLARE PUBLIC FUNCTION Lot_ShellExec LIB "lcomstf.dll" ALIAS"_Lot_ShellExec@4" (ByVal File$) AS LONG ''DBCS support partially from Japan DECLARE PUBLIC FUNCTION IsDBCSFirstAtOffset LIB "lcomstf.dll" ALIAS "_IsDBCSFirstAtOffset@8" (ByVal szStr$, ByVal cnt&) AS LONG DECLARE PUBLIC FUNCTION FDBCSCharLen LIB "lcomstf.dll" ALIAS "_FDBCSCharLen@8" (ByVal szStr$, ByVal offset&) AS LONG ''Functions to configure AUTOEXEC.BAT DECLARE PUBLIC FUNCTION IsShareInstalled LIB "lcomstf.dll" ALIAS "_IsShareInstalled@0" () AS INTEGER DECLARE PUBLIC FUNCTION ExitWindows LIB "user32" ALIAS "ExitWindows" (ByVal dwReturnCode&, ByVal wReserved&) AS LONG DECLARE PUBLIC FUNCTION FindWindow LIB "user32" ALIAS "FindWindowA" (ByVal lpszClassName$, ByVal lpszWindow$) AS INTEGER DECLARE PUBLIC FUNCTION GetUserName LIB "advapi32" ALIAS "GetUserNameA" (ByVal lpszClassName$, wLength&) AS INTEGER ''Functions to configure Program Manager DECLARE PUBLIC FUNCTION ProgmanManageGroup LIB "mscuistf.dll" ALIAS "_ProgmanManageGroup@8" (ByVal szName$, ByVal fDelete&) AS INTEGER DECLARE PUBLIC FUNCTION FAddProgramGroupsToList LIB "mscuistf.dll" ALIAS "_FAddProgramGroupsToList@16" (ByVal hkeyRoot&, ByVal pszKeyName$, ByVal pszListName$, ByVal pszSuppressName$) AS LONG DECLARE PUBLIC FUNCTION FAddItemToTree LIB "mscuistf.dll" ALIAS "_FAddItemToTree@8" (ByVal hDlg&, ByVal szNewName$) AS INTEGER DECLARE PUBLIC FUNCTION FDeleteCurrTreeItem LIB "mscuistf.dll" ALIAS "_FDeleteCurrTreeItem@4" (ByVal hDlg&) AS INTEGER DECLARE PUBLIC FUNCTION FChangeNameCurrTreeItem LIB "mscuistf.dll" ALIAS "_FChangeNameCurrTreeItem@8" (ByVal hDlg&, ByVal NewName$) AS INTEGER '********************** Microsoft DLL Api *********************************** 'JMD DECLARE PUBLIC FUNCTION FDoDialog3 LIB "msshlstf.dll" ALIAS "_FDoDialog3@16" (ByVal hwnd&, ByVal szDll$, ByVal Dlg&, ByVal szDlgProc$ ) AS INTEGER DECLARE PUBLIC FUNCTION FKillNDialogs3 LIB "msshlstf.dll" ALIAS "_FKillNDialogs3@4" (ByVal n&) AS INTEGER DECLARE PUBLIC FUNCTION FGetHandleForResourceDLL LIB "msshlstf.dll" ALIAS "_FGetHandleForResourceDLL@8" (ByVal id%, ByVal t%) AS LONG DECLARE PUBLIC FUNCTION FGetNameForResourceDLL LIB "msshlstf.dll" ALIAS "_FGetNameForResourceDLL@16" (ByVal id%, ByVal t%, ByVal buffer$, ByVal bufsize&) AS LONG DECLARE PUBLIC FUNCTION FRemoveIniSection LIB "msinsstf.dll" ALIAS "FRemoveIniSection" (ByVal szFile$, ByVal szSect$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION FCreateIniKeyValue LIB "msinsstf.dll" ALIAS "FCreateIniKeyValue" (ByVal szFile$, ByVal szSect$, ByVal szKey$, ByVal szValue$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION FRemoveIniKey LIB "msinsstf.dll" ALIAS "FRemoveIniKey" (ByVal szFile$, ByVal szSect$, ByVal szKey$, ByVal cmo&) AS INTEGER DECLARE PUBLIC FUNCTION FCreateSysIniKeyValue LIB "msinsstf.dll" ALIAS "FCreateSysIniKeyValue" (ByVal szFile$, ByVal szSect$, ByVal szKey$, ByVal szValue$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION FCreateProgManGroup LIB "msinsstf.dll" ALIAS "FCreateProgManGroup" (ByVal szGroup$, ByVal szPath$, ByVal cmo&) AS INTEGER DECLARE PUBLIC FUNCTION FCreateProgManItem LIB "msinsstf.dll" ALIAS "FCreateProgManItem" (ByVal szGroup$, ByVal szItem$, ByVal szCmd$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION FShowProgManGroup LIB "msinsstf.dll" ALIAS "FShowProgManGroup" (ByVal szGroup$, ByVal szCmd$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION FStampResource LIB "msinsstf.dll" ALIAS "FStampResource" (ByVal szSect$, ByVal szKey$, ByVal szDst$,_ ByVal wResType&, ByVal wResId&, ByVal szData$, ByVal cbData&) AS LONG DECLARE PUBLIC FUNCTION FAddDos5Help LIB "msinsstf.dll" ALIAS "FAddDos5Help" (ByVal szProgName$, ByVal szProgHelp$, ByVal cmo&) AS LONG '*OBSOLETE DECLARE PUBLIC FUNCTION YnrcRemoveFile LIB "msinsstf.dll" ALIAS "YnrcRemoveFile" (ByVal szFullPathSrc$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION YnrcBackupFile LIB "msinsstf.dll" ALIAS "YnrcBackupFile" (ByVal szFullPath$, ByVal szBackup$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION FInitializeInstall LIB "msinsstf.dll" ALIAS "FInitializeInstall" ( ByVal hinst&, ByVal hwndFrame&) AS LONG DECLARE PUBLIC FUNCTION WFindFileUsingFileOpen LIB "msinsstf.dll" ALIAS "WFindFileUsingFileOpen" (ByVal szFile$, ByVal szBuf$, ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION FIsFileWritable LIB "msinsstf.dll" ALIAS "FIsFileWritable" (ByVal szFile$) AS LONG DECLARE PUBLIC FUNCTION SetDecompMode LIB "msinsstf.dll" ALIAS "SetDecompMode" (ByVal fMode&) AS LONG DECLARE PUBLIC FUNCTION GetDecompMode LIB "msinsstf.dll" ALIAS "GetDecompMode" () AS LONG DECLARE PUBLIC FUNCTION FPrependToPath LIB "msinsstf.dll" ALIAS "FPrependToPath" (ByVal szSrc$, ByVal szDst$, ByVal szDir$, ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION SetTimeValue LIB "msinsstf.dll" ALIAS "SetTimeValue" (ByVal usHours&, ByVal usMinutes&, ByVal usSeconds&) AS LONG DECLARE PUBLIC FUNCTION HShowWaitCursor LIB "msshlstf.dll" ALIAS "HShowWaitCursor" () AS LONG DECLARE PUBLIC FUNCTION FRestoreCursor LIB "msshlstf.dll" ALIAS "FRestoreCursor" (ByVal hPrev&) AS LONG DECLARE PUBLIC FUNCTION FSetBitmap LIB "msshlstf.dll" ALIAS "FSetBitmap" (ByVal szDll$, ByVal Bitmap&) AS LONG DECLARE PUBLIC FUNCTION FSetAbout LIB "msshlstf.dll" ALIAS "FSetAbout" (ByVal szAbout1$, ByVal szAbout2$) AS LONG DECLARE PUBLIC FUNCTION FSetSymbolValue LIB "msshlstf.dll" ALIAS "FSetSymbolValue" (ByVal szSymbol$,ByVal szValue$) AS LONG DECLARE PUBLIC FUNCTION InitializeFrame LIB "msshlstf.dll" ALIAS "InitializeFrame" (ByVal szCmdLine$) AS LONG DECLARE PUBLIC FUNCTION HwndFrame LIB "msshlstf.dll" ALIAS "HwndFrame" () AS LONG DECLARE PUBLIC FUNCTION HinstFrame LIB "msshlstf.dll" ALIAS "HinstFrame" () AS LONG DECLARE PUBLIC FUNCTION FWriteToFile LIB "msshlstf.dll" ALIAS "FWriteToFile" (ByVal szFile$, ByVal sz$) AS INTEGER DECLARE PUBLIC FUNCTION CreateRegKeyEx LIB "msshlstf.dll" ALIAS "CreateRegKeyEx" (ByVal hKey&, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION CreateRegKeyValueExD LIB "msshlstf.dll"ALIAS "CreateRegKeyValueExD" (ByVal hKey&,ByVal szSubKey$,ByVal szValueName$,ByVal dwType&, ByVal dwDataLen&, ByVal dwValueData&) AS LONG DECLARE PUBLIC FUNCTION CreateRegKeyValueExS LIB "msshlstf.dll"ALIAS "CreateRegKeyValueExS" (ByVal hKey&,ByVal szSubKey$,ByVal szValueName$,ByVal dwType&, ByVal dwDataLen&, ByVal szValueData$) AS LONG DECLARE PUBLIC FUNCTION DeleteRegKeyEx LIB "msshlstf.dll" ALIAS "DeleteRegKeyEx" (ByVal hKey&,ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION DeleteAllSubKeys LIB "msshlstf.dll" ALIAS "DeleteAllSubKeys" (ByVal hKey&, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION DoesRegKeyExistEx LIB "msshlstf.dll" ALIAS "DoesRegKeyExistEx" (ByVal hKey&, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION GetRegKeyValueEx LIB "msshlstf.dll" ALIAS "GetRegKeyValueEx" (ByVal hKey&,ByVal szSubKey$,ByVal szValueName$, dwType&, ByVal cbBuf&, lpdwBuf&, ByVal lpBuf$) AS LONG DECLARE PUBLIC FUNCTION SetRegKeyValueExD LIB "msshlstf.dll" ALIAS "SetRegKeyValueExD" (ByVal hKey&,ByVal szSubKey$,ByVal szValueName$, dwType&, ByVal dwValueData&, ByVal dwDataLen& ) AS LONG DECLARE PUBLIC FUNCTION SetRegKeyValueExS LIB "msshlstf.dll" ALIAS "SetRegKeyValueExS" (ByVal hKey&,ByVal szSubKey$,ByVal szValueName$, dwType&, ByVal szValueData$, ByVal dwDataLen& ) AS LONG DECLARE PUBLIC FUNCTION Lot_CheckPriviledges LIB "msshlstf.dll" ALIAS "Lot_CheckPriviledges" (ByVal checkflags&) AS LONG DECLARE PUBLIC FUNCTION EercErrorHandler LIB "mscomstf.dll" ALIAS "EercErrorHandler" (ByVal grc&,ByVal fVital&,ByVal sz1$,ByVal sz2$,ByVal sz3$) AS INTEGER DECLARE PUBLIC FUNCTION FValidFATPath (ByVal szPath$) AS INTEGER DECLARE PUBLIC FUNCTION FValidPath (ByVal szPath$) AS INTEGER DECLARE PUBLIC FUNCTION FAddSpecialFileToCopyList LIB "mscomstf.dll" ALIAS "FAddSpecialFileToCopyList" (ByVal szSect$, ByVal szKey$, ByVal szSrc$, ByVal szDest$) AS LONG DECLARE PUBLIC FUNCTION FRemoveSymbol LIB "mscomstf.dll" ALIAS "FRemoveSymbol" (ByVal szSym$) AS LONG DECLARE PUBLIC FUNCTION CbGetSymbolValue LIB "mscomstf.dll" ALIAS "CbGetSymbolValue" (ByVal szSymbol$, ByVal szValue$,ByVal Length&) AS LONG DECLARE PUBLIC FUNCTION UsGetListLength LIB "mscomstf.dll" ALIAS "UsGetListLength" (ByVal szSymbol$) AS INTEGER DECLARE PUBLIC FUNCTION CbGetListItem LIB "mscomstf.dll" ALIAS "CbGetListItem" (ByVal szListSymbol$, ByVal n&, ByVal szListItem$, ByVal cbMax&) AS LONG DECLARE PUBLIC FUNCTION FAddListItem LIB "mscomstf.dll" ALIAS "FAddListItem" (ByVal szListSymbol$,ByVal szListItem$) AS LONG DECLARE PUBLIC FUNCTION FReplaceListItem LIB "mscomstf.dll" ALIAS "FReplaceListItem" (ByVal szListSymbol$, ByVal n&, ByVal szListItem$) AS LONG DECLARE PUBLIC FUNCTION FOpenLogFile LIB "mscomstf.dll" ALIAS "FOpenLogFile" (ByVal szFile$, ByVal fAppend&) AS LONG DECLARE PUBLIC FUNCTION FCloseLogFile LIB "mscomstf.dll" ALIAS "FCloseLogFile" () AS LONG DECLARE PUBLIC FUNCTION FWriteToLogFile LIB "mscomstf.dll" ALIAS "FWriteToLogFile" (ByVal sz$, ByVal fRequire&) AS LONG DECLARE PUBLIC FUNCTION DoMsgBox LIB "lcomstf.dll" ALIAS "_DoMsgBox@12" (ByVal lpText$,ByVal lpCaption$,ByVal wType&) AS LONG DECLARE PUBLIC FUNCTION FParseFATPathIntoPieces LIB "mscomstf.dll" ALIAS "FParsePathIntoPieces" (ByVal szPath$, ByVal szVol$, ByVal cbVol&, ByVal szDir$, ByVal cbDir&, ByVal szFile$, ByVal cbFile&) AS INTEGER DECLARE PUBLIC FUNCTION FParsePathIntoPieces LIB "mscomstf.dll" ALIAS "FParsePathIntoPieces" (ByVal szPath$, ByVal szVol$, ByVal cbVol&, ByVal szDir$, ByVal cbDir&, ByVal szFile$, ByVal cbFile&) AS INTEGER DECLARE PUBLIC FUNCTION CbGetVersionOfFile LIB "msdetstf.dll" ALIAS "CbGetVersionOfFile" (ByVal szFile$,ByVal szBuf$,ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION LGetVersionNthField LIB "msdetstf.dll" ALIAS "LGetVersionNthField" (ByVal szVersion$,ByVal nField&) AS LONG DECLARE PUBLIC FUNCTION LcbGetSizeOfFile LIB "msdetstf.dll" ALIAS "LcbGetSizeOfFile" (ByVal szFile$) AS LONG DECLARE PUBLIC FUNCTION FGetValidDrivesList LIB "msdetstf.dll" ALIAS "FGetValidDrivesList" (ByVal szSymbol$) AS LONG DECLARE PUBLIC FUNCTION FGetLocalHardDrivesList LIB "msdetstf.dll" ALIAS "FGetLocalHardDrivesList" (ByVal szSymbol$) AS LONG DECLARE PUBLIC FUNCTION FGetRemovableDrivesList LIB "msdetstf.dll" ALIAS "FGetRemovableDrivesList" (ByVal szSymbol$) AS LONG DECLARE PUBLIC FUNCTION FGetNetworkDrivesList LIB "msdetstf.dll" ALIAS "FGetNetworkDrivesList" (ByVal szSymbol$) AS LONG DECLARE PUBLIC FUNCTION LcbTotalDrive LIB "msdetstf.dll" ALIAS "LcbTotalDrive" (ByVal nDrive&) AS LONG DECLARE PUBLIC FUNCTION LcbFreeDrive LIB "msdetstf.dll" ALIAS "LcbFreeDrive" (ByVal nDrive&) AS LONG DECLARE PUBLIC FUNCTION FIsValidDrive LIB "msdetstf.dll" ALIAS "FIsValidDrive" (ByVal nDrive&) AS LONG DECLARE PUBLIC FUNCTION FIsLocalHardDrive LIB "msdetstf.dll" ALIAS "FIsLocalHardDrive" (ByVal nDrive&) AS LONG DECLARE PUBLIC FUNCTION FIsRemoveDrive LIB "msdetstf.dll" ALIAS "FIsRemoveDrive" (ByVal nDrive&) AS LONG DECLARE PUBLIC FUNCTION FIsRemoteDrive LIB "msdetstf.dll" ALIAS "FIsRemoteDrive" (ByVal nDrive&) AS LONG DECLARE PUBLIC FUNCTION FDirExists LIB "msdetstf.dll" ALIAS "FDirExists" (ByVal szDir$) AS LONG DECLARE PUBLIC FUNCTION FDoesFileExist LIB "msdetstf.dll" ALIAS "FDoesFileExist" (ByVal szFileName$, ByVal mode&) AS LONG DECLARE PUBLIC FUNCTION CbGetDateOfFile LIB "msdetstf.dll" ALIAS "CbGetDateOfFile" (ByVal szFile$, ByVal szBuf$, ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION FDoesIniSectionExist LIB "msdetstf.dll" ALIAS "FDoesIniSectionExist" (ByVal szFile$, ByVal szSect$) AS LONG DECLARE PUBLIC FUNCTION FDoesIniKeyExist LIB "msdetstf.dll" ALIAS "FDoesIniKeyExist" (ByVal szFile$, ByVal szSect$, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION WGetNumWinApps LIB "msdetstf.dll" ALIAS "WGetNumWinApps" () AS LONG DECLARE PUBLIC FUNCTION FGetParallelPortsList LIB "msdetstf.dll" ALIAS "FGetParallelPortsList" (ByVal szSymbol$) AS LONG DECLARE PUBLIC FUNCTION FGetSerialPortsList LIB "msdetstf.dll" ALIAS "FGetSerialPortsList" (ByVal szSymbol$) AS LONG DECLARE PUBLIC FUNCTION FHas87MathChip LIB "msdetstf.dll" ALIAS "FHas87MathChip" () AS LONG DECLARE PUBLIC FUNCTION FHasMonochromeDisplay LIB "msdetstf.dll" ALIAS "FHasMonochromeDisplay" () AS LONG DECLARE PUBLIC FUNCTION FHasMouseInstalled LIB "msdetstf.dll" ALIAS "FHasMouseInstalled" () AS LONG DECLARE PUBLIC FUNCTION WGetConfigSmartdrvSize LIB "msdetstf.dll" ALIAS "WGetConfigSmartdrvSize" () AS LONG DECLARE PUBLIC FUNCTION WGetConfigRamdriveSize LIB "msdetstf.dll" ALIAS "WGetConfigRamdriveSize" () AS LONG DECLARE PUBLIC FUNCTION WGetConfigNumBuffers LIB "msdetstf.dll" ALIAS "WGetConfigNumBuffers" () AS LONG DECLARE PUBLIC FUNCTION WGetConfigNumFiles LIB "msdetstf.dll" ALIAS "WGetConfigNumFiles" () AS LONG DECLARE PUBLIC FUNCTION WGetConfigLastDrive LIB "msdetstf.dll" ALIAS "WGetConfigLastDrive" () AS LONG DECLARE PUBLIC FUNCTION FIsDriverInConfig LIB "msdetstf.dll" ALIAS "FIsDriverInConfig" (ByVal szDrv$) AS LONG DECLARE PUBLIC FUNCTION CbFindTargetOnEnvVar LIB "msdetstf.dll" ALIAS "CbFindTargetOnEnvVar" (ByVal szFile$, ByVal szEnvVar$, ByVal szBuf$, ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION CbFindFileInTree LIB "msdetstf.dll" ALIAS "CbFindFileInTree" (ByVal szFile$, ByVal szDir$, ByVal szBuf$, ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION GetTypeFaceNameFromTTF LIB "msdetstf.dll" ALIAS "GetTypeFaceNameFromTTF" (ByVal szFile$, ByVal szBuf$, ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION GetExistingFOTFileForTTF LIB "msdetstf.dll" ALIAS "GetExistingFOTFileForTTF" (ByVal szFile$, ByVal szBuf$, ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION HinstCui LIB "mscuistf.dll" ALIAS "_HinstCui@0" () AS LONG DECLARE PUBLIC FUNCTION LoadCommonCtl LIB "mscuistf.dll" ALIAS "_LoadCommonCtl@0" () AS INTEGER DECLARE PUBLIC FUNCTION CreateLink LIB "mscuistf.dll" ALIAS "_CreateLink@20" (ByVal szPathObj$, ByVal szPathLink$, ByVal pszDesc$, ByVal szArgument$, ByVal szWorkingDir$) AS LONG DECLARE PUBLIC FUNCTION CreateLinkIcon LIB "mscuistf.dll" ALIAS "_CreateLinkIcon@28" (ByVal szPathObj$, ByVal szPathLink$, ByVal pszDesc$, ByVal szArgument$, ByVal szWorkingDir$, ByVal szIconPath$, ByVal Icon&) AS LONG DECLARE PUBLIC FUNCTION Lot_FreeDrive LIB "mscuistf.dll" ALIAS "_Lot_FreeDrive@4" (ByVal szDrive$) AS LONG DECLARE PUBLIC FUNCTION Lot_IsNewShell LIB "mscuistf.dll" ALIAS "_Lot_IsNewShell@0" () AS INTEGER '************ Windows Calls **************************************** DECLARE PUBLIC FUNCTION SendDlgItemMessage LIB "user32" ALIAS "SendDlgItemMessage" (ByVal hDlg&,ByVal idCtrl&,ByVal msg&,ByVal w&,ByVal l&) AS LONG DECLARE PUBLIC FUNCTION SendDlgItemMessageLb LIB "user32" ALIAS "SendDlgItemMessage" (ByVal hDlg&,ByVal idCtrl&,ByVal msg&,ByVal w&,ByVal lParam$) AS LONG DECLARE PUBLIC FUNCTION SendMessage LIB "user32" ALIAS "SendMessageA" (ByVal hWnd&,ByVal msg&,ByVal w&,ByVal l&) AS LONG DECLARE PUBLIC FUNCTION GetTickCount LIB "kernel32" ALIAS "GetTickCount" () AS LONG DECLARE PUBLIC FUNCTION GetDC LIB "user32" ALIAS "GetDC" (ByVal hWnd&) AS LONG DECLARE PUBLIC FUNCTION ReleaseDC LIB "user32" ALIAS "ReleaseDC" (ByVal hWnd&, ByVal hDC&) AS LONG DECLARE PUBLIC FUNCTION GetDeviceCaps LIB "GDI32" ALIAS "GetDeviceCaps" (ByVal hDC&, ByVal nIndex&) AS LONG DECLARE PUBLIC FUNCTION WinHelp LIB "user32" ALIAS "WinHelpA" (ByVal hwndMain&, ByVal helpfile$, ByVal context&, ByVal ID) AS LONG DECLARE PUBLIC FUNCTION WinExec LIB "kernel32" ALIAS "WinExec" (ByVal path$, ByVal data&) AS LONG DECLARE PUBLIC FUNCTION IsDlgbuttonChecked LIB "user32" ALIAS "IsDlgButtonChecked" (ByVal hwnd&, ByVal fEnable&) AS LONG DECLARE PUBLIC FUNCTION GetWindowsDirectory LIB "kernel32" ALIAS "GetWindowsDirectoryA" (ByVal szBuf$,ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION GetSystemDirectory LIB "kernel32" ALIAS "GetSystemDirectoryA" (ByVal szBuf$, ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION GetProfileString LIB "kernel32" ALIAS "GetProfileString" (ByVal szSect$,ByVal szKey$,ByVal szDefault$,ByVal szBuf$,ByVal cbBuf&) AS LONG DECLARE PUBLIC FUNCTION GetVersion LIB "kernel32" ALIAS "GetVersion" () AS LONG DECLARE PUBLIC FUNCTION GetSystemMetrics LIB "user32" ALIAS "GetSystemMetrics" (ByVal nIndex&) AS LONG DECLARE PUBLIC FUNCTION FindResource LIB "kernel32" ALIAS "FindResourceA" (ByVal hDll&, ByVal Id&, ByVal RType& ) AS LONG DECLARE PUBLIC FUNCTION Win32CopyFile LIB "kernel32" ALIAS "CopyFileA" (ByVal szSrc$, ByVal szDest$, ByVal cmo%) AS INTEGER DECLARE PUBLIC FUNCTION GetLastError LIB "kernel32" ALIAS "GetLastError" () AS LONG DECLARE PUBLIC FUNCTION GetDriveType LIB "kernel32" ALIAS "GetDriveTypeA" (ByVal szPath$) AS INTEGER DECLARE PUBLIC FUNCTION GetEnvironmentVariable LIB "kernel32" ALIAS "GetEnvironmentVariableA" (ByVal szName$, ByVal szValue$, ByVal Size&) AS LONG '*** This functions isn't available on Win32. 'DECLARE PUBLIC FUNCTION GetWinFlags LIB "kernel32" () AS LONG DECLARE PUBLIC SUB GetSystemInfo LIB "kernel32" ALIAS "GetSystemInfo" ( rSysInf AS SysInfoType ) DECLARE PUBLIC FUNCTION LoadLibrary LIB "kernel32" ALIAS "LoadLibraryA" (ByVal path$) AS LONG DECLARE PUBLIC FUNCTION GetPrivateProfileString LIB "kernel32" ALIAS "GetPrivateProfileStringA" (ByVal szSect$, ByVal szKey$, ByVal szDef$, ByVal szBuf$, ByVal cbBuf&,ByVal szFile$) AS LONG DECLARE PUBLIC FUNCTION LoadString LIB "user32" ALIAS "LoadStringA" (ByVal hinst&,ByVal TextID&, ByVal Textbuf$, ByVal BufSize&) AS LONG DECLARE PUBLIC FUNCTION GetModuleHandle LIB "kernel32" ALIAS "GetModuleHandleA" (ByVal path$) AS LONG DECLARE PUBLIC FUNCTION GetDlgItem LIB "user32" ALIAS "GetDlgItem" (ByVal hwndDlg&, ByVal idControl&) AS LONG DECLARE PUBLIC FUNCTION IsWindowVisible LIB "user32" ALIAS "IsWindowVisible" (ByVal hwndDlg&) AS INTEGER DECLARE PUBLIC FUNCTION UpdateWindow LIB "user32" ALIAS "UpdateWindow" (ByVal hwndDlg&) AS INTEGER DECLARE PUBLIC FUNCTION SetFocus LIB "user32" ALIAS "SetFocus" (ByVal hwndDlg&) AS LONG DECLARE PUBLIC FUNCTION GetFocus LIB "user32" ALIAS "GetFocus" () AS LONG DECLARE PUBLIC FUNCTION GetParent LIB "user32" ALIAS "GetParent" (ByVal hwndDlg&) AS LONG ''shell DECLARE PUBLIC FUNCTION SetWindowText LIB "user32" ALIAS "SetWindowTextA" (ByVal hwnd&, ByVal lpString$) AS INTEGER DECLARE PUBLIC FUNCTION EnableWindow (ByVal hwnd&, ByVal fEnable&) AS INTEGER DECLARE PUBLIC FUNCTION WEnableWindow LIB "user32" ALIAS "EnableWindow" (ByVal hwnd&, ByVal fEnable&) AS INTEGER DECLARE PUBLIC FUNCTION ShowWindow LIB "user32" ALIAS "ShowWindow" (ByVal hwnd&, ByVal fEnable&) AS INTEGER DECLARE PUBLIC FUNCTION RegSetValue LIB "advapi32" ALIAS "RegSetValueA" (ByVal hKey&, ByVal szSubKey$, ByVal dwType&, ByVal szValue$, ByVal cbValue&) AS LONG DECLARE PUBLIC FUNCTION RegCloseKey LIB "advapi32" ALIAS "RegCloseKey" (ByVal hKey&) AS LONG '**************************WRAPPRER PROTOTYPES************************** 'MS WRAPPER PROTOTYPES 'DECLARE PUBLIC SUB CreateDir (szDir$, cmo%) 'DECLARE PUBLIC SUB RemoveIniSection (szFile$, szSect$, cmo%) DECLARE PUBLIC SUB CreateIniKeyValue (szFile$, szSect$, szKey$, szValue$, cmo%) 'DECLARE PUBLIC SUB RemoveIniKey (szFile$, szSect$, szKey$, cmo%) 'DECLARE PUBLIC SUB CreateSysIniKeyValue (szFile$, szSect$, szKey$, szValue$, cmo%) DECLARE PUBLIC SUB CreateProgmanGroup (szGroup$, szPath$, cmo%) DECLARE PUBLIC SUB CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) DECLARE PUBLIC SUB ShowProgmanGroup (szGroup$, Cmd%, cmo%) 'DECLARE PUBLIC SUB StampResource (szSect$, szKey$, szDst$, wResType%, wResId%, szData$, cbData%) 'DECLARE PUBLIC SUB AddDos5Help (szProgName$, szProgHelp$, cmo%) DECLARE PUBLIC SUB CopyFile (szFullPathSrc$, szFullPathDst$, cmo%, fAppend%) DECLARE PUBLIC SUB RemoveFile (szFullPathSrc$, cmo%) 'DECLARE PUBLIC SUB BackupFile (szFullPath$, szBackup$) 'DECLARE PUBLIC SUB RenameFile (szFullPath$, szBackup$) DECLARE PUBLIC SUB InitInstall DECLARE PUBLIC SUB OpenLogFile (szFile$, fAppend%) DECLARE PUBLIC SUB CloseLogFile DECLARE PUBLIC SUB WriteToLogFile (szStr$) 'DECLARE PUBLIC FUNCTION FindFileUsingFileOpen (szFile$) AS STRING DECLARE PUBLIC FUNCTION IsDirWritable (szDir$) AS INTEGER DECLARE PUBLIC FUNCTION IsFileWritable (szFile$) AS INTEGER 'DECLARE PUBLIC SUB PrependToPath (szSrc$, szDst$, szDir$, cmo%) DECLARE PUBLIC FUNCTION Lot_TrimEndSlash (path$) AS STRING '** Lotus Error functions DECLARE PUBLIC SUB ErrorMsg (nMsg%, szErr$) DECLARE PUBLIC SUB FatalErrorMsg (nMsg%, szErr$, nErr%) DECLARE PUBLIC SUB ErrorMsgNoDlgExit (nMsg%, szErr$) DECLARE PUBLIC FUNCTION LdString (TextID%) AS STRING DECLARE PUBLIC SUB LdStringInit () %rem DECLARE PUBLIC SUB StfApiErr (nMsg%, szApi$, szArgs$) DECLARE PUBLIC SUB BadArgErr (nArg%, szApi$, szArgs$) '' chk arg 'DECLARE PUBLIC FUNCTION FValidDrive (szDrive$) AS INTEGER 'DECLARE PUBLIC FUNCTION FValidInfSect (szSect$) AS INTEGER 'DECLARE PUBLIC FUNCTION FValidIniFile (szFile$) AS INTEGER %endrem ''DEBUG '' Windows system detect DECLARE PUBLIC FUNCTION GetWindowsMajorVersion () AS INTEGER DECLARE PUBLIC FUNCTION GetWindowsMinorVersion () AS INTEGER DECLARE PUBLIC FUNCTION IsNewShell () AS INTEGER DECLARE PUBLIC FUNCTION GetWindowsMode () AS INTEGER DECLARE PUBLIC FUNCTION GetWindowsDir () AS STRING DECLARE PUBLIC FUNCTION GetWindowsSysDir () AS STRING DECLARE PUBLIC FUNCTION IsWindowsShared () AS INTEGER DECLARE PUBLIC FUNCTION GetScreenWidth () AS INTEGER DECLARE PUBLIC FUNCTION GetScreenHeight () AS INTEGER '' Detect DECLARE PUBLIC FUNCTION IsLongDirPath (szDir$) AS INTEGER DECLARE PUBLIC FUNCTION IsDriveValid (szDrive$) AS INTEGER DECLARE PUBLIC FUNCTION IsDriveLocalHard (szDrive$) AS INTEGER DECLARE PUBLIC FUNCTION IsDriveRemovable (szDrive$) AS INTEGER DECLARE PUBLIC FUNCTION IsDriveNetwork (szDrive$) AS INTEGER DECLARE PUBLIC SUB GetValidDrivesList (szSymbol$) DECLARE PUBLIC SUB GetLocalHardDrivesList (szSymbol$) DECLARE PUBLIC SUB GetRemovableDrivesList (szSymbol$) DECLARE PUBLIC SUB GetNetworkDrivesList (szSymbol$) DECLARE PUBLIC FUNCTION GetTotalSpaceForDrive (szDrive$) AS LONG DECLARE PUBLIC FUNCTION GetFreeSpaceForDrive (szDrive$) AS LONG DECLARE PUBLIC FUNCTION GetEnvVariableValue (szEnvVar$) AS STRING DECLARE PUBLIC FUNCTION GetNumWinApps () AS INTEGER DECLARE PUBLIC FUNCTION DoesFileExist (szFile$, mode%) AS INTEGER DECLARE PUBLIC FUNCTION GetDateOfFile (szFile$) AS STRING DECLARE PUBLIC FUNCTION GetYearFromDate (szDate$) AS INTEGER DECLARE PUBLIC FUNCTION GetMonthFromDate (szDate$) AS INTEGER DECLARE PUBLIC FUNCTION GetDayFromDate (szDate$) AS INTEGER DECLARE PUBLIC FUNCTION GetHourFromDate (szDate$) AS INTEGER DECLARE PUBLIC FUNCTION GetMinuteFromDate (szDate$) AS INTEGER DECLARE PUBLIC FUNCTION GetSecondFromDate (szDate$) AS INTEGER DECLARE PUBLIC FUNCTION GetVersionOfFile (szFile$) AS STRING DECLARE PUBLIC FUNCTION GetVersionNthField (szVersion$, nField%) AS LONG DECLARE PUBLIC FUNCTION GetSizeOfFile (szFile$) AS LONG DECLARE PUBLIC FUNCTION FindTargetOnEnvVar (szFile$, szEnvVar$) AS STRING DECLARE PUBLIC FUNCTION FindFileInTree (szFile$, szDir$) AS STRING DECLARE PUBLIC FUNCTION DoesDirExist (szDir$) AS INTEGER DECLARE PUBLIC FUNCTION DoesIniSectionExist (szFile$, szSect$) AS INTEGER DECLARE PUBLIC FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) AS INTEGER DECLARE PUBLIC FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) AS STRING DECLARE PUBLIC FUNCTION GetConfigSmartdrvSize () AS INTEGER DECLARE PUBLIC FUNCTION GetConfigRamdriveSize () AS INTEGER DECLARE PUBLIC FUNCTION GetConfigNumBuffers () AS INTEGER DECLARE PUBLIC FUNCTION GetConfigNumFiles () AS INTEGER DECLARE PUBLIC FUNCTION GetConfigLastDrive () AS STRING DECLARE PUBLIC FUNCTION IsDriverInConfig (szDrv$) AS INTEGER DECLARE PUBLIC FUNCTION GetProcessorType () AS INTEGER DECLARE PUBLIC SUB GetParallelPortsList (szSymbol$) DECLARE PUBLIC SUB GetSerialPortsList (szSymbol$) DECLARE PUBLIC FUNCTION Has87MathChip () AS INTEGER DECLARE PUBLIC FUNCTION HasMonochromeDisplay () AS INTEGER DECLARE PUBLIC FUNCTION HasMouseInstalled () AS INTEGER DECLARE PUBLIC SUB SetBitmap(szDll$, Bitmap%) DECLARE PUBLIC SUB SetAbout(szAbout1$, szAbout2$) DECLARE PUBLIC FUNCTION UIStartDlg(szDll$, Dlg%, szDlgProc$, HelpDlg%, szHelpProc$) AS STRING DECLARE PUBLIC SUB UIPop (n%) DECLARE PUBLIC SUB UIPopAll DECLARE PUBLIC SUB SetTitle (sz$) DECLARE PUBLIC SUB SetSymbolValue (szSymbol$, szValue$) DECLARE PUBLIC SUB RemoveSymbol (szSym$) DECLARE PUBLIC FUNCTION GetSymbolValue (szSymbol$) AS STRING DECLARE PUBLIC FUNCTION GetListLength(szSymbol$) AS INTEGER DECLARE PUBLIC FUNCTION GetListItem(szSymbol$, n%) AS STRING DECLARE PUBLIC SUB AddListItem(szSymbol$, szItem$) DECLARE PUBLIC SUB ReplaceListItem(szSymbol$, n%, szItem$) DECLARE PUBLIC FUNCTION InitFrame (szCmdLine$) AS INTEGER DECLARE PUBLIC FUNCTION InitSetup (szCmdLine$) AS INTEGER DECLARE PUBLIC FUNCTION ShowWaitCursor () AS LONG DECLARE PUBLIC SUB RestoreCursor (hPrev&) DECLARE PUBLIC SUB WriteToFile(szFile$,sz$) '** these are some functions to deal with 32 bit type dir names DECLARE PUBLIC FUNCTION GetShortPathName(ByVal szLong$, szShort$) AS LONG DECLARE PUBLIC FUNCTION Lot_Regedit LIB "lcomstf.dll" ALIAS "_Lot_Regedit@8" (ByVal szFile$,ByVal szFile$) AS LONG DECLARE PUBLIC FUNCTION Lot_GetShortPathName LIB "lcomstf.dll" ALIAS "_Lot_GetShortPathName@12" (ByVal szLong$,ByVal szShort$,ByVal cchBuffer&) AS LONG DECLARE PUBLIC FUNCTION Lot_CreateIniKeyValue LIB "lcomstf.dll" ALIAS "_Lot_CreateIniKeyValue@20" (ByVal szFile$,ByVal szSect$,ByVal szKey$,ByVal szValue$,ByVal cmo&) AS LONG DECLARE PUBLIC FUNCTION Lot_CleanPath (path$) AS INTEGER DECLARE PUBLIC FUNCTION Lot_GetNthFieldFromIniString (szLine$, iField%, sp$) AS STRING DECLARE PUBLIC FUNCTION Lot_RegCreateKeyEx( ByVal hKey&, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION Lot_RegDelAllSubKeys( ByVal hKey&, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION Lot_DoesRegKeyExistEx(ByVal hKey&, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION Lot_DeleteRegKeyEx( ByVal hKey&, ByVal szKey$) AS LONG DECLARE PUBLIC FUNCTION Lot_CreateRegKeyValueEx(ByVal hKey&, ByVal szSubKey$, ByVal szValueName$,_ ByVal dwType&, ByVal lpValueData as variant, ByVal dwDataLen& ) AS LONG DECLARE PUBLIC FUNCTION Lot_SetRegKeyValueEx(ByVal hKey&, ByVal szSubKey$, ByVal szValueName$,_ dwType&,ByVal lpValueData, ByVal dwDataLen& ) AS LONG DECLARE PUBLIC FUNCTION Lot_GetRegKeyValueEx(ByVal hKey&, ByVal szSubKey$,ByVal szValueName$,_ dwType&, lpBuf as variant, cbBuf&) AS LONG DECLARE PUBLIC FUNCTION Lot_CreateDirectory LIB "mscuistf.dll" ALIAS "_Lot_CreateDirectory@4" (ByVal szDir$) AS LONG DECLARE PUBLIC SUB SetListItem (szSymbol$, n%, szListItem$) DECLARE PUBLIC FUNCTION NullTrim (szString$) AS STRING DECLARE PUBLIC FUNCTION CreateBuffer (Length&) AS STRING ' called from main to start off everything DECLARE PUBLIC SUB SetUpAPI DECLARE PUBLIC SUB ASSERT (assertion%, msg$) ''JMD: Replace old MS Setup functions PUBLIC FUNCTION FValidFATPath (ByVal szPath$) AS INTEGER FValidFATPath = Lot_ValidPath (szPath$) END FUNCTION PUBLIC FUNCTION FValidPath (ByVal szPath$) AS INTEGER FValidPath = Lot_ValidPath (szPath$) END FUNCTION %rem '******************SUPPORT FUNCTIONS **************************** PUBLIC FUNCTION LEFTBP(sz$, n%) AS STRING LEFTBP = LEFT$(sz$, n%) END FUNCTION %endrem '************************************************************************* '** PUBLIC FUNCTION Lot_TrimEndSlash (path$) AS STRING '** '** Purpose: trims '** Author: MMETH '** Arguments: path$ '** Returns: the modified path '************************************************************************* PUBLIC FUNCTION Lot_TrimEndSlash (path$) AS STRING DIM l% l% = LEN(path$) If l% <> 0 THEN If MID$(path$, l%, 1) = "\" Then Lot_TrimEndSlash = LEFT$ (path$, l%-1) Else Lot_TrimEndSlash = path$ End If End If END FUNCTION '**************************************************************** PUBLIC FUNCTION NullTrim (szString$) AS STRING DIM l% l% = INSTR (szString, CHR$(0)) IF l% > 0 THEN NullTrim = RTrim$(LEFT$ (szString, l% - 1)) ELSEIF l% = 0 THEN NullTrim = RTrim$(szString) ELSE NullTrim = "" END IF END FUNCTION '**************************************************************** ' Need this function to allow us to full buffers with anything ' Right now we can't fill them with nulls. PUBLIC FUNCTION CreateBuffer (Length&) AS STRING CreateBuffer = STRING$(Length&, " ") END FUNCTION '***************************WRAPPERS FUNCTIONS AND SUBROUTINES*********** 'MS WRAPPERS FUNCTIONS AND SUBROUTINES PUBLIC FUNCTION InitSetup(szCmdLine$) AS INTEGER '** Purpose: calls InitFrame and InitInstall and sets fFrameInit and '** fInstallInit flags '** Author: '** Arguments: szCmdLine$ '** Returns: the return of InitFrame call '** '************************************************************************* DIM i% %rem fFrameInit = FALSE fInstallInit = FALSE IF hSetup > 0 THEN StfApiErr saeInit, "InitSetup", szCmdLine$ END IF i% = InitFrame(szCmdLine$) fFrameInit = 1 InitInstall fInstallInit = 1 %endrem ''DEBUG i% = InitFrame(szCmdLine$) InitInstall InitSetup = i% END FUNCTION '************************************************************************** PUBLIC FUNCTION InitFrame(szCmdLine$) AS INTEGER '** Purpose: Initialize the frame '** Author: '** Arguments: szCmdLine$ '** Returns: '************************************************************************* DIM i& IF hSetup > 0 THEN %rem StfApiErr saeInit, "InitFrame", szCmdLine$ %endrem ''DEBUG ELSE i& = InitializeFrame(szCmdLine$) IF i& = -1 THEN ' FatalErrorMsg SID_ERR_COMMANDLINE_FORMAT, "", STFQUIT ERROR STFQUIT ELSEIF i& = 0 THEN %rem StfApiErr saeFail, "InitFrame", szCmdLine$ %endrem ''DEBUG '** TV: return value from cmd line parsing was 0. One of the '** cmd line processing failed. ERROR STFQUIT END ELSE InitFrame = CInt(i&) END IF END IF END FUNCTION '************************************************************************** PUBLIC SUB SetBitmap(szDll$, Bitmap%) '** Purpose: '** Author: '** Arguments: szDll$, Bitmap% '************************************************************************* IF FSetBitmap(szDll$, CLng(Bitmap%)) = FALSE THEN ASSERT TRUE, "" END IF END SUB '************************************************************************** PUBLIC SUB SetAbout(szAbout1$, szAbout2$) '** Purpose: '** Author: '** Arguments: szAbout1$, szAbout2$ '************************************************************************* IF FSetAbout(szAbout1$, szAbout2$) = FALSE THEN ASSERT TRUE, "" END IF END SUB '************************************************************************* PUBLIC SUB SetTitle(sz$) '** Purpose: '** Author: '** Arguments: sz$ '************************************************************************* SetWindowText HwndFrame(), sz$ END SUB '************************************************************************* PUBLIC FUNCTION UIStartDlg(szDll$, Dlg%, szDlgProc$, HelpDlg%, szHelpProc$) AS STRING '** Purpose: '** Author: '** Arguments: szDll$, Dlg%, szDlgProc$, HelpDlg%, szHelpProc$ '** Returns: Value of the symbol for the event, e.g. "ID_OK" '** '** NOTE: This version calls FDoDialog3, which allows multiple DLLs '** '************************************************************************* %rem if szDll$ = "" then n% = 1 elseif szDlgProc$ = "" then n% = 3 else n% = 0 end if if n% > 0 then BadArgErr n%, "UIStartDlg", szDll$+", "+STR$(Dlg%)+", "+szDlgProc$+", "+STR$(HelpDlg%)+", "+szHelpProc$ end if %endrem ''DEBUG ' IF FDoDialog(HwndFrame(), szDll$, CLng(Dlg%), szDlgProc$, CLng(HelpDlg%), szHelpProc$) = FALSE THEN IF FDoDialog3(HwndFrame(), szDll$, CLng(Dlg%), szDlgProc$ ) = FALSE THEN ASSERT TRUE, "" ERROR STFQUIT ELSE UIStartDlg = GetSymbolValue(SYM_DLGEVENT$) END IF END FUNCTION '************************************************************************* PUBLIC SUB UIPop (n%) '** Purpose: '** Author: '** Arguments: n% '************************************************************************* IF FKillNDialogs3(CLng(n%)) = FALSE THEN ASSERT TRUE, "" END IF END SUB '************************************************************************* PUBLIC SUB UIPopAll '** Purpose: '** Author: '** Arguments: None '************************************************************************* ' This is not needed if calling FDoDialog3 IF FKillNDialogs3(32767) = FALSE THEN ASSERT TRUE, "" END IF END SUB '************************************************************************* PUBLIC FUNCTION GetSymbolValue(szSymbol$) AS STRING '** Purpose: '** Author: '** Arguments: szSymbol$ '** Returns: '** '************************************************************************* %rem if szSymbol$ = "" then BadArgErr 1, "GetSymbolValue", szSymbol$ end if %endrem ''DEBUG DIM szValue As String : szValue = CreateBuffer(cbSymValMax) DIM Length% Length% = CInt(CbGetSymbolValue(szSymbol$, szValue$, cbSymValMax)) IF Length% >= cbSymValMax THEN ErrorMsg SID_ERR_GETSYMBOLVALUE, LSI_INFO(13) & _ " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT ELSEIF (Length% = 0) THEN szValue$="" END IF GetSymbolValue = LEFTBP(szValue$, Length%) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetListLength(szSymbol$) AS INTEGER '** Purpose: '** Author: '** Arguments: szSymbol$ '** Returns: '** '************************************************************************* %rem if szSymbol$ = "" then BadArgErr 1, "GetListLength", szSymbol$ end if %endrem ''DEBUG GetListLength = UsGetListLength(szSymbol$) IF szSymbol$ = "" THEN ErrorMsg SID_ERR_GETLISTLENGTH, LSI_INFO(13) & _ " : " & LSI_INFO(12) & " : " & LSI_INFO(11) & CHR(10) &_ "GetListLength(" & szSymbol$ & ")" ERROR STFQUIT END IF END FUNCTION '************************************************************************* PUBLIC FUNCTION GetListItem(szListSymbol$, nItem%) AS STRING '** Purpose: '** Author: '** Arguments: szListSymbol$, nItem% '** Returns: '** '************************************************************************* %rem if szListSymbol$ = "" then BadArgErr 1, "GetListItem", szListSymbol$+", "+STR$(nItem%) end if if nItem% <= 0 or nItem% > GetListLength(szListSymbol$) then BadArgErr 2, "GetListItem", szListSymbol$+", "+STR$(nItem%) end if %endrem ''DEBUG DIM szListItem$, Length& szListItem$ = CreateBuffer(cbSymValMax) Length& = CbGetListItem(szListSymbol$, CLng(nItem%), szListItem$, cbSymValMax) GetListItem = szListItem$ IF Length& >= cbSymValMax THEN ErrorMsg SID_ERR_GETLISTITEM, LSI_INFO(13) & _ " : " & LSI_INFO(12) & " : " & LSI_INFO(11) & CHR(10) &_ "GetListItem(" & szListSymbol$ & ", " & CSTR(nItem%) & ")" ERROR STFQUIT ELSEIF Length& <= 0 THEN szListItem$ = "" Length& = 0 END IF if nItem% <= 0 or nItem% > GetListLength(szListSymbol$) then ErrorMsg SID_ERR_GETLISTITEM2, LSI_INFO(13) & _ " : " & LSI_INFO(12) & " : " & LSI_INFO(11) & CHR(10) &_ "GetListItem(" & szListSymbol$ & ", " & CSTR(nItem%) & ")" ERROR STFQUIT end if GetListItem = LEFTBP( szListItem$, CInt(Length&) ) END FUNCTION '************************************************************************* PUBLIC SUB AddListItem(szSymbol$, szItem$) '** Purpose: '** Author: '** Arguments: szSymbol$, szItem$ '************************************************************************* %rem if szSymbol$ = "" then BadArgErr 1, "AddListItem", szSymbol$+", "+szItem$ end if %endrem ''DEBUG IF FAddListItem(ByVal szSymbol$,ByVal szItem$) = FALSE THEN ErrorMsg SID_ERR_ADDLISTITEM,_ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC SUB ReplaceListItem(szSymbol$, n%, szItem$) '** Purpose: '** Author: '** Arguments: szSymbol$, n%, szItem$ '************************************************************************* %rem if szSymbol$ = "" then nArg% = 1 elseif (n% <= 0) OR (n% > GetListLength(szSymbol$)) then nArg% = 2 else nArg% = 0 end if if nArg% > 0 then BadArgErr nArg%, "ReplaceListItem", szSymbol$+", "+STR$(n%)+", "+szItem$ end if %endrem ''DEBUG IF FReplaceListItem(szSymbol$, CLng(n%), szItem$) = FALSE THEN ErrorMsg SID_ERR_REPLACELISTITEM, _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF END SUB '************************************************************************** PUBLIC SUB SetSymbolValue(szSymbol$, szValue$) '** Purpose: '** Author: '** Arguments: szSymbol$, szValue$ '************************************************************************* DIM LocalValue$ LocalValue$ = TRIM$(szValue$) %rem if LocalValue$ = "" then BadArgErr 1, "SetSymbolValue", szSymbol$+", "+szValue$ end if %endrem ''DEBUG IF szSymbol$ = "" THEN ErrorMsg SID_ERR_SETSYMBOLVALUE, "Symbol name empty, value is " & szValue$ EXIT SUB END IF IF FSetSymbolValue(szSymbol$, LocalValue$) = FALSE THEN ErrorMsg SID_ERR_SETSYMBOLVALUE, _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC SUB RemoveSymbol(szSym$) '** Purpose: '** Author: '** Arguments: szSym$ '************************************************************************* %rem if szSym$ = "" then BadArgErr 1, "RemoveSymbol", szSym$ end if %endrem ''DEBUG IF FRemoveSymbol(szSym$) = FALSE THEN ErrorMsg SID_ERR_REMOVESYMBOL, _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC FUNCTION ShowWaitCursor () AS LONG '** Purpose: '** Author: '** Arguments: None '** Returns: '** '************************************************************************* ' ShowWaitCursor = HShowWaitCursor() ShowWaitCursor = 0 END FUNCTION '************************************************************************* PUBLIC SUB RestoreCursor (hPrev&) '** Purpose: '** Author: '** Arguments: hPrev& '************************************************************************* DIM i& ' i& = FRestoreCursor(hPrev&) i& = 1 IF i& = 0 THEN ErrorMsg SID_ERR_RESTORECURSOR, "" ERROR STFERR END IF END SUB '************************************************************************* PUBLIC SUB InitInstall '** Purpose: '** Author: '** Arguments: None '************************************************************************* IF hSetup > 0 THEN %rem StfApiErr saeInit, "InitInstall", "" %endrem ''DEBUG ELSEIF FInitializeInstall(HinstFrame(), HwndFrame()) = FALSE THEN %rem StfApiErr saeFail, "InitInstall", "" %endrem ''DEBUG END END IF END SUB '************************************************************************* PUBLIC SUB CreateDir (szDir$, cmo%) '** Purpose: '** Author: '** Arguments: szDir$, cmo% '************************************************************************* DIM logfile$ %rem if FValidFATDir(szDir$) = FALSE then BadArgErr 1, "CreateDir", szDir$+", "+STR$(cmo%) end if %endrem ''DEBUG IF Lot_CreateDirectory(szDir$) <> NO_ERROR THEN ErrorMsg SID_ERR_CREATEDIR, szDir$ & " " & CStr(cmo%) & CHR(10) &_ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF logfile$ = GetSymbolValue(SYM_LOGFILE$) If logfile$ <> "" THEN OpenLogFile logfile$,1 WriteToLogFile "** Successfully created " + szDir$+ " ;with cmo% = " + CStr(cmo%) CloseLogFile END IF END SUB '************************************************************************* PUBLIC SUB RemoveIniSection (szFile$, szSect$, cmo%) '** Purpose: '** Author: '** Arguments: szFile$, szSect$, cmo% '************************************************************************* DIM logfile$ %rem if FValidIniFile(szFile$) = FALSE then n% = 1 elseif FValidInfSect(szSect$) = FALSE then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "RemoveIniSection", szFile$+", "+szSect$+", "+STR$(cmo%) end if %endrem ''DEBUG logfile$ = GetSymbolValue(SYM_LOGFILE$) IF FRemoveIniSection(szFile$, szSect$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_REMOVEINISECTION, "** Failed removing ini entry from " & szFile$ & CHR(10) &_ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFERR END IF If logfile$ <> "" THEN OpenLogFile logfile$,1 WriteToLogFile "** Successfully removed from " + szFile$+ " ;with cmo% = " + CStr(cmo%) WriteToLogFile "[" + szSect$ +"]" CloseLogFile END IF END SUB '************************************************************************* PUBLIC SUB CreateIniKeyValue (szFile$, szSect$, szKey$, szValue$, cmo%) '** Purpose: '** Author: '** Arguments: szFile$, szSect$, szKey$, szValue$, cmo% '************************************************************************* DIM logfile$ %rem if FValidIniFile(szFile$) = FALSE then n% = 1 elseif FValidInfSect(szSect$) = FALSE then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "CreateIniKeyValue", szFile$+", "+szSect$+", "+szKey$+", "+szValue$+", "+STR$(cmo%) end if %endrem ''DEBUG logfile$ = GetSymbolValue(SYM_LOGFILE$) IF Lot_CreateIniKeyValue(szFile$, szSect$, szKey$, szValue$, CLng(cmo%)) = FALSE THEN ' IF FCreateIniKeyValue(szFile$, szSect$, szKey$, szValue$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_CREATEINIKEYVALUE, "** Failed writing to " & szFile$ & CHR(10) & _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF If logfile$ <> "" THEN OpenLogFile logfile$,1 WriteToLogFile "** Successfully wrote to " + szFile$+ " ;with cmo% = " + CStr(cmo%) WriteToLogFile "[" + szSect$ +"]" WriteToLogFile szKey$ +"="+ szValue$ CloseLogFile END IF END SUB '************************************************************************* PUBLIC SUB RemoveIniKey (szFile$, szSect$, szKey$, cmo%) '** Purpose: '** Author: '** Arguments: szFile$, szSect$, szKey$, cmo% '************************************************************************* DIM logfile$ %rem if FValidIniFile(szFile$) = FALSE then n% = 1 elseif FValidInfSect(szSect$) = FALSE then n% = 2 elseif szKey$ = "" then n% = 3 else n% = 0 end if if n% > 0 then BadArgErr n%, "RemoveIniKey", szFile$+", "+szSect$+", "+szKey$+", "+STR$(cmo%) end if %endrem ''DEBUG logfile$ = GetSymbolValue(SYM_LOGFILE$) IF FRemoveIniKey(szFile$, szSect$, szKey$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_REMOVEINIKEY, "** Failed removing ini entry from " & szFile$ & CHR(10) &_ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFERR END IF If logfile$ <> "" THEN OpenLogFile logfile$,1 WriteToLogFile "** Successfully Removed from " + szFile$+ " ;with cmo% = " + CStr(cmo%) WriteToLogFile "[" + szSect$ +"]" WriteToLogFile szKey$ +"=" CloseLogFile END IF END SUB '************************************************************************* PUBLIC SUB CreateSysIniKeyValue (szFile$, szSect$, szKey$, szValue$, cmo%) '** Purpose: '** Author: '** Arguments: szFile$, szSect$, szKey$, szValue$, cmo% '************************************************************************* DIM logfile$ %rem if FValidFATPath(szFile$) = FALSE then n% = 1 elseif FValidInfSect(szSect$) = FALSE then n% = 2 elseif szKey$ = "" then n% = 3 else n% = 0 end if if n% > 0 then BadArgErr n%, "CreateSysIniKeyValue", szFile$+", "+szSect$+", "+szKey$+", "+szValue$+", "+STR$(cmo%) end if %endrem ''DEBUG logfile$ = GetSymbolValue(SYM_LOGFILE$) IF FCreateSysIniKeyValue(szFile$, szSect$, szKey$, szValue$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_CREATESYSINIKEYVALUE, "** Failed writing to " & szFile$ & CHR(10) & _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF If logfile$ <> "" THEN OpenLogFile logfile$,1 WriteToLogFile "** Successfully did a CreateSysIniKeyValue to " + szFile$+ " ;with cmo% = " + CStr(cmo%) WriteToLogFile "[" + szSect$ +"]" WriteToLogFile szKey$ +"="+ szValue$ CloseLogFile END IF END SUB '************************************************************************* PUBLIC SUB CreateProgmanGroup (szGroup$, szPath$, cmo%) '** Purpose: '** Author: '** Arguments: szGroup$, szPath$, cmo% '************************************************************************* %rem if szGroup$ = "" or len(szGroup$) > 24 then BadArgErr 1, "CreateProgmanGroup", szGroup$+", "+STR$(Cmd%)+", "+STR$(cmo%) end if %endrem ''DEBUG IF FCreateProgManGroup(szGroup$, szPath$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_CREATEPROGMANGROUP, szGroup$ & CHR(10) & _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) END IF END SUB '************************************************************************* PUBLIC SUB ShowProgmanGroup (szGroup$, Cmd%, cmo%) '** Purpose: '** Author: '** Arguments: szGroup$, Cmd%, cmo% '************************************************************************* %rem if szGroup$ = "" or len(szGroup$) > 24 then BadArgErr 1, "ShowProgmanGroup", szGroup$+", "+STR$(Cmd%)+", "+STR$(cmo%) end if %endrem ''DEBUG IF FShowProgManGroup(szGroup$, STR$(Cmd%), CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_SHOWPROGMANGROUP, "" END IF END SUB '************************************************************************* PUBLIC SUB StampResource (szSect$, szKey$, szDst$, wResType%, wResId%, szData$, cbData%) '** Purpose: '** Author: '** Arguments: szSect$, szKey$, szDst$, wResType%, wResId%, szData$, cbData% '************************************************************************* %rem if FValidInfSect(szSect$) = FALSE then n% = 1 elseif szKey$ = "" then n% = 2 elseif FValidFATDir(szDst$) = FALSE then n% = 3 else n% = 0 end if if n% > 0 then BadArgErr n%, "StampResource", szSect$+", "+szKey$+", "+szDst$+", "+STR$(wResType%)+", "+STR$(wResId%)+", "+szData$+", "+STR$(cbData%) end if %endrem ''DEBUG IF FStampResource (szSect$, szKey$, szDst$, CLng(wResType%), CLng(wResId%), szData$, CLng(cbData%)) = FALSE THEN ErrorMsg SID_ERR_STAMPRESOURCE, "" ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC SUB CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) '** Purpose: '** Author: '** Arguments: szGroup$, szItem$, szCmd$, szOther$, cmo% '************************************************************************* DIM szItemNew$ szItemNew$ = szItem$ IF szOther$ <> "" THEN szItemNew$ = szItem$ + "," + szOther$ END IF %rem if szGroup$ = "" or len(szGroup$) > 24 then BadArgErr 1, "CreateProgmanItem", szGroup$+", "+STR$(Cmd%)+", "+STR$(cmo%) end if %endrem ''DEBUG IF FCreateProgManItem(CHR$(34)+szGroup$+CHR$(34), szItemNew$, szCmd$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_CREATEPROGMANITEM, szItemNew$ & CHR(10) & _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) END IF szItemNew$ = "" END SUB '************************************************************************* PUBLIC SUB AddDos5Help (szProgName$, szProgHelp$, cmo%) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem if szProgName$ = "" OR MID$(szProgName$, 1, 1) = "@" OR LEN(szProgName$) > 8 then n% = 1 elseif INSTR(szProgName$, " ") <> 0 OR INSTR(szProgName$, CHR$(9)) <> 0 then n% = 1 elseif szProgHelp$ = "" then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "AddDos5Help", szProgName$+", "+szProgHelp$+", "+STR$(cmo%) end if %endrem ''DEBUG IF FAddDos5Help (szProgName$, szProgHelp$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_ADDDOS5HELP, "" ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC SUB CopyFile (szFullPathSrc$, szFullPathDst$, cmo%, fAppend%) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* dim rc% %rem if FValidFATPath(szFullPathSrc$) = FALSE then n% = 1 elseif FValidFATPath(szFullPathDst$) = FALSE then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "CopyFile", szFullPathSrc$+", "+szFullPathDst$+", "+STR$(cmo%)+", "+STR$(fAppend%) end if %endrem ''DEBUG rc% = Win32CopyFile(szFullPathSrc$, szFullPathDst$, 0) IF rc% = FALSE THEN ErrorMsg SID_ERR_COPYFILE, szFullPathSrc$ & LdString(SID_TO) & szFullPathDst$ & CHR(10) & _ LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC SUB RemoveFile (szFullPathSrc$, cmo%) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem if FValidFATPath(szFullPathSrc$) = FALSE then BadArgErr 1, "RemoveFile", szFullPathSrc$+", "+STR$(cmo%) end if %endrem ''DEBUG ' IF YnrcRemoveFile(szFullPathSrc$, CLng(cmo%)) = ynrcNo THEN IF Lot_DeleteFile(szFullPathSrc$, cmo%) = FALSE THEN 'ErrorMsg SID_ERR_REMOVEFILE, szFullPathSrc$ END IF END SUB '************************************************************************* PUBLIC SUB BackupFile (szFullPath$, szBackup$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem if FValidFATPath(szFullPath$) = FALSE then n% = 1 elseif szBackup$ = "" then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "BackupFile", szFullPath$+", "+szBackup$ end if %endrem ''DEBUG IF YnrcBackupFile(szFullPath$, szBackup$, cmoNone) = ynrcNo THEN ErrorMsg SID_ERR_BACKUPFILE, szFullPath$ + LdString(SID_TO) + szBackup$ ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC SUB RenameFile (szFullPath$, szBackup$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem if FValidFATPath(szFullPath$) = FALSE then n% = 1 elseif szBackup$ = "" then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "RenameFile", szFullPath$+", "+szBackup$ end if %endrem ''DEBUG IF YnrcBackupFile(szFullPath$, szBackup$, cmoNone) = ynrcNo THEN ErrorMsg SID_ERR_RENAMEFILE, szFullPath$ + LdString(SID_TO) + szBackup$ ERROR STFQUIT END IF END SUB '************************************************************************* %rem PUBLIC SUB AddSpecialFileToCopyList (szSect$, szKey$, szSrc$, szDest$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* if FValidInfSect(szSect$) = FALSE then n% = 1 elseif szKey$ = "" then n% = 2 elseif FValidFATDir(szSrc$) = FALSE then n% = 3 elseif FValidFATPath(szDest$) = FALSE then n% = 4 else n% = 0 end if if n% > 0 then BadArgErr n%, "AddSpecialFileToCopyList", szSect$+", "+szKey$+", "+szSrc$+", "+szDest$ end if IF FAddSpecialFileToCopyList (szSect$, szKey$, szSrc$, szDest$) = FALSE THEN ErrorMsg SID_ERR_ADDSPECIALFILETOCOPYLIST, szSect$ + " , " + szKey$ ERROR STFQUIT END IF END SUB %endrem PUBLIC SUB OpenLogFile (szFile$, fAppend%) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem if FValidFATPath(szFile$) = FALSE then BadArgErr 1, "OpenLogFile", szFile$+", "+STR$(fAppend%) end if %endrem ''DEBUG IF FOpenLogFile(szFile$, CLng(fAppend%)) = FALSE THEN ErrorMsg SID_ERR_OPENLOGFILE, szFile$ END IF END SUB '************************************************************************* PUBLIC SUB CloseLogFile '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* IF FCloseLogFile() = FALSE THEN ErrorMsg SID_ERR_CLOSELOGFILE, "" ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC SUB WriteToLogFile (szStr$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* IF FWriteToLogFile(szStr$, 1) = FALSE THEN ErrorMsg SID_ERR_WRITETOLOGFILE, szStr$ ERROR STFQUIT END IF END SUB '************************************************************************* PUBLIC FUNCTION FindFileUsingFileOpen (szFile$) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM szBuf$, wRet& szBuf$ = STRING$(512, 32) wRet& = WFindFileUsingFileOpen(szFile$, szBuf$, CLng(len(szBuf$))) IF wRet& = 0 THEN FindFileUsingFileOpen = NullTrim(szBuf$) ELSEIF wRet& = 1 THEN FindFileUsingFileOpen = "" ELSE ErrorMsg SID_ERR_FINDFILEUSINGFILEOPEN, szFile$ ERROR STFQUIT END IF szBuf$ = "" END FUNCTION '************************************************************************* PUBLIC FUNCTION IsLongDirPath (szDir$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM ret& IsLongDirPath = TRUE IF szDir$ <> "" THEN IF GetSymbolValue(szDir$) <> "" THEN RemoveSymbol szDir$ END IF SetSymbolValue SYM_NOLONGDIR$, "TRUE" ret&=FCleanFatPath(szDir$) IF ret& <> FALSE THEN IsLongDirPath = FALSE ELSE IsLongDirPath = TRUE END IF RemoveSymbol SYM_NOLONGDIR$ END IF END FUNCTION PUBLIC FUNCTION IsDirWritable (szDir$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* ' DIM szShort$ ,ret& ' ret& = GetShortPathName( szDir$, szShort$) ' IsDirWritable = CInt(Lot_IsDirWritable(szShort$)) IsDirWritable = CInt(Lot_IsDirWritable(szDir$)) END FUNCTION '************************************************************************* PUBLIC FUNCTION IsFileWritable (szFile$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem if FValidFATDir(szFile$) = FALSE then BadArgErr 1, "IsFileWritable", szFile$ end if %endrem ''DEBUG IsFileWritable = CInt(FIsFileWritable(szFile$)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetWindowsMajorVersion AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetWindowsMajorVersion = CInt(GetVersion()) MOD 256 END FUNCTION '************************************************************************* PUBLIC FUNCTION GetWindowsMinorVersion AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetWindowsMinorVersion = CInt(GetVersion()) / 256 END FUNCTION '************************************************************************* PUBLIC FUNCTION IsNewShell AS INTEGER '** Purpose: Determine if new Windows 95 shell in use (SUR) '** Author: JMD '** Returns: TRUE if new Windows 95 shell in use (SUR) '** '************************************************************************* ' IsNewShell = (GetVersion() < 0) IsNewShell = (Lot_IsNewShell = 1) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetWindowsMode AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetWindowsMode = 2 END FUNCTION '************************************************************************* PUBLIC FUNCTION GetWindowsDir AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM szBufAl$, cbBuf&, szBuf$, rv& szBufAl$ = CreateBuffer(256) cbBuf& = GetWindowsDirectory(szBufAl$, 256) IF cbBuf& = 0 THEN GetWindowsDir = "" ErrorMsg SID_ERR_GETWINDOWSDIR, "" ERROR STFQUIT ELSE IF cbBuf& > 255 THEN ErrorMsg SID_ERR_GETWINDOWSDIR2, "" ERROR STFQUIT END IF szBuf$ = NullTrim(szBufAl$) if Right(szBuf$,1) <> "\" THEN szBuf$ = szBuf$ + "\" GetWindowsDir = szBuf$ END IF END FUNCTION '************************************************************************* PUBLIC FUNCTION GetWindowsSysDir() AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM szBufAl$, cbBuf&, szBuf$, rv& szBufAl$ = CreateBuffer(256) cbBuf& = GetSystemDirectory(szBufAl$, 256) IF cbBuf& = 0 THEN ErrorMsg SID_ERR_GETWINDOWSSYSDIR, "" ERROR STFQUIT ELSE IF cbBuf& > 255 THEN ErrorMsg SID_ERR_GETWINDOWSSYSDIR2, "" ERROR STFQUIT END IF szBuf$ = NullTrim(szBufAl$) if Right(szBuf$,1) <> "\" THEN szBuf$ = szBuf$ + "\" GetWindowsSysDir = szBuf$ END IF END FUNCTION '************************************************************************* PUBLIC FUNCTION IsWindowsShared AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM szWin$, szSys$ szWin$ = GetWindowsDir() szSys$ = GetWindowsSysDir() IF LEN(szWin$) = 0 THEN ErrorMsg SID_ERR_ISWINDOWSSHARED, "" ERROR STFQUIT END IF IF LEN(szSys$) <= LEN(szWin$) THEN IsWindowsShared = TRUE ELSE szSys$ = MID$(szSys$, 1, LEN(szWin$)) IF szWin$ = szSys$ THEN IsWindowsShared = FALSE ELSE IsWindowsShared = TRUE END IF END IF END FUNCTION '************************************************************************* PUBLIC FUNCTION GetScreenWidth AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetScreenWidth = CInt(GetSystemMetrics(SM_CXSCREEN)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetScreenHeight AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetScreenHeight = CInt(GetSystemMetrics(SM_CYSCREEN)) END FUNCTION '************************************************************************* PUBLIC SUB PrependToPath (szSrc$, szDst$, szDir$, cmo%) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem if (FValidFATPath(szSrc$) = FALSE) AND (szSrc$ <> "") then n% = 1 elseif FValidFATPath(szDst$) = FALSE then n% = 2 elseif FValidFATDir(szDir$) = FALSE then n% = 3 else n% = 0 end if if n% > 0 then BadArgErr n%, "PrependToPath", szSrc$+", "+szDst$+", "+szDir$+", "+STR$(cmo%) end if %endrem ''DEBUG IF FPrependToPath (szSrc$, szDst$, szDir$, CLng(cmo%)) = FALSE THEN ErrorMsg SID_ERR_PREPENDTOPATH, _ szSrc$ & " : " & szDst$ & " : " & szDir$ ERROR STFQUIT END IF END SUB '************************************************************************** '*************************** Error Handlers ***************************** '************************************************************************** %rem -------------------------------------------------------- '************************************************************************** PUBLIC SUB StfApiErr (nMsg%, szApi$, szArgs$) ''DEBUG only '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* select case nMsg% case saeFail lpText$ = "Failed" case saeInit lpText$ = "Already Initialized" case saeNYI lpText$ = "NYI" case else lpText$ = "Bad Arg "+LTRIM$(STR$(nMsg% - saeArg)) end select lpText$ = lpText$ + ": "+ szApi$ if szArgs$ <> "" then lpText$ = lpText + " (" + szArgs$ + ")" end if lpCaption$ = "MS-Setup Toolkit API Error" res& = DoMsgBox(lpText$, lpCaption$, MB_TASKMODAL+MB_ICONHAND+MB_OK) print lpText$ lpText$ = "" lpCaption$ = "" END SUB '************************************************************************** PUBLIC SUB BadArgErr (nArg%, szApi$, szArgs$) ''DEBUG only '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* StfApiErr nArg%+saeArg, szApi$, szArgs$ ERROR STFQUIT END SUB '************************************************************************** '** REVIEW: Move this function into common lib (we'll need it there too) '************************************************************************** PUBLIC FUNCTION FValidInfSect (szSect$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* if (szSect$ = "") OR (INSTR(1,szSect$,"]") <> 0) then FValidInfSect = FALSE else FValidInfSect = TRUE end if END FUNCTION '************************************************************************** '** REVIEW: Move this function into common lib (we'll need it there too) '************************************************************************** PUBLIC FUNCTION FValidIniFile (szFile$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* if (FValidFATPath(szFile$) = FALSE) AND (UCASE$(szFile$) <> gWININI$) then FValidIniFile = FALSE else FValidIniFile = TRUE end if END FUNCTION '************************************************************************** PUBLIC FUNCTION FValidDrive (szDrive$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* if szDrive$ = "" then FValidDrive = FALSE elseif INSTR(1,szDrive$,"\\") = 1 then ' UNC path FValidDrive = TRUE elseif ASC(UCASE$(szDrive$)) - ASC("A") < 0 then FValidDrive = FALSE elseif ASC(UCASE$(szDrive$)) - ASC("A") > 25 then FValidDrive = FALSE elseif LEN(szDrive$) = 1 then FValidDrive = TRUE elseif INSTR(2,szDrive$,":\") = 2 then FValidDrive = TRUE elseif INSTR(1,szDrive$,":") = 2 then FValidDrive = TRUE else FValidDrive = FALSE end if END FUNCTION '************************************************************************** %endrem -------------------------------------------------------------- PUBLIC SUB SetRegKeyValue(szKey$, szValue$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM i%, logfile$ logfile$ = GetSymbolValue(SYM_LOGFILE$) IF RegSetValue(HKEY_CLASSES_ROOT, szKey$, REG_SZ, szValue$, CLng(len(szKey$))) > ERROR_SUCCESS THEN i% = EercErrorHandler(GRC_API_FAILED, 1, "SetRegKeyValue", "", "") ErrorMsg SID_ERR_SETREGKEYVALUE, szKey$ + LdString(SID_TO) + szValue$ '' Shouldn't be fatal ERROR STFQUIT END IF If logfile$ <> "" THEN OpenLogFile logfile$,1 WriteToLogFile "** Successfully SetRegKeyValue " + szKey$+ ", "+ szValue$ CloseLogFile END IF END SUB '************************************************************************** '************************************************************************* PUBLIC FUNCTION IsDriveValid (szDrive$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidDrive(szDrive$) = FALSE then BadArgErr 1, "IsDriveValid", szDrive$ end if %endrem ' ''DEBUG IsDriveValid = CInt(FIsValidDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)) END FUNCTION '************************************************************************* PUBLIC FUNCTION IsDriveLocalHard (szDrive$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidDrive(szDrive$) = FALSE then BadArgErr 1, "IsDriveLocalHard", szDrive$ end if %endrem ' ''DEBUG IsDriveLocalHard = CInt(FIsLocalHardDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)) END FUNCTION '************************************************************************* PUBLIC FUNCTION IsDriveRemovable (szDrive$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidDrive(szDrive$) = FALSE then BadArgErr 1, "IsDriveRemovable", szDrive$ end if %endrem ' ''DEBUG IsDriveRemovable = CInt(FIsRemoveDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)) END FUNCTION '************************************************************************* PUBLIC FUNCTION IsDriveNetwork (szDrive$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidDrive(szDrive$) = FALSE then BadArgErr 1, "IsDriveNetwork", szDrive$ end if %endrem ' ''DEBUG IsDriveNetwork = CInt(FIsRemoteDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetTotalSpaceForDrive (szDrive$) AS LONG '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidDrive(szDrive$) = FALSE then BadArgErr 1, "GetTotalSpaceForDrive", szDrive$ end if %endrem ' ''DEBUG GetTotalSpaceForDrive = LcbTotalDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetFreeSpaceForDrive (szDrive$) AS LONG '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidDrive(szDrive$) = FALSE then BadArgErr 1, "GetFreeSpaceForDrive", szDrive$ end if %endrem ' ''DEBUG GetFreeSpaceForDrive = Lot_FreeDrive(szDrive$) ' GetFreeSpaceForDrive = LcbFreeDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1) END FUNCTION '************************************************************************* PUBLIC SUB GetValidDrivesList (szSymbol$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szSymbol$ = "" then BadArgErr 1, "GetValidDrivesList", szSymbol$ end if %endrem ' ''DEBUG if FGetValidDrivesList(szSymbol$) = FALSE then ErrorMsg SID_ERR_GETVALIDDRIVESLIST, "" ERROR STFQUIT end if END SUB '************************************************************************* PUBLIC SUB GetLocalHardDrivesList (szSymbol$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szSymbol$ = "" then BadArgErr 1, "GetLocalHardDrivesList", szSymbol$ end if %endrem ' ''DEBUG if FGetLocalHardDrivesList(szSymbol$) = FALSE then ErrorMsg SID_ERR_GETLOCALHARDDRIVESLIST, "" ERROR STFQUIT end if END SUB '************************************************************************* PUBLIC SUB GetRemovableDrivesList (szSymbol$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szSymbol$ = "" then BadArgErr 1, "GetRemovableDrivesList", szSymbol$ end if %endrem ' ''DEBUG if FGetRemovableDrivesList(szSymbol$) = FALSE then ErrorMsg SID_ERR_GETREMOVABLEDRIVESLIST, "" ERROR STFQUIT end if END SUB '************************************************************************* PUBLIC SUB GetNetworkDrivesList (szSymbol$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szSymbol$ = "" then BadArgErr 1, "GetNetworkDrivesList", szSymbol$ end if %endrem ' ''DEBUG if FGetNetworkDrivesList(szSymbol$) = FALSE then ErrorMsg SID_ERR_GETNETWORKDRIVESLIST, "" ERROR STFQUIT end if END SUB '************************************************************************* PUBLIC FUNCTION GetEnvVariableValue (szEnvVar$) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szEnvVar$ = "" then BadArgErr 1, "GetEnvVariableValue", szEnvVar$ end if %endrem ' ''DEBUG DIM cb%, szBuf$, cbRet% cb% = 1024 szBuf$ = STRING$(cb%, 32) cbRet% = CInt(GetEnvironmentVariable(szEnvVar$, szBuf$, CLng(cb%))) GetEnvVariableValue = NullTrim(szBuf$) %rem 'DEBUG IF cbRet% >= cb% THEN '' StfApiErr saeOvfl, "GetEnvVariableValue", szEnvVar$ ErrorMsg SID_ERR_GETENVVARIABLEVALUE, "" ERROR STFQUIT END IF %endrem ' ''DEBUG szBuf$ = "" END FUNCTION '************************************************************************* PUBLIC FUNCTION GetNumWinApps () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetNumWinApps = CInt(WGetNumWinApps()) END FUNCTION '************************************************************************* PUBLIC FUNCTION DoesFileExist (szFileName$, mode%) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidFATPath(szFileName$) = FALSE then BadArgErr 1, "DoesFileExist", szFileName$+", "+STR$(mode%) end if %endrem ' ''DEBUG ' DoesFileExist = CInt(Lot_DoesFileExist(szFileName$, CLng(mode%))) DoesFileExist = CInt(Lot_DoesFileExist(szFileName$)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetDateOfFile (szFile$) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidFATPath(szFile$) = FALSE then BadArgErr 1, "GetDateOfFile", szFile$ end if %endrem ' ''DEBUG DIM cb%, szBuf$, cbRet& cb% = 20 szBuf$ = STRING$(cb%, 32) cbRet& = CbGetDateOfFile(szFile$, szBuf$, CLng(cb%)) GetDateOfFile = NullTrim(szBuf$) %rem 'DEBUG IF CInt(cbRet&) >= cb% THEN '' StfApiErr saeOvfl, "GetDateOfFile", szFile$ ErrorMsg SID_ERR_GETDATEOFFILE, "" ERROR STFQUIT END IF %endrem ' ''DEBUG szBuf$ = "" END FUNCTION '************************************************************************* PUBLIC FUNCTION GetYearFromDate (szDate$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szDate = "" then BadArgErr 1, "GetYearFromDate", szDate$ end if %endrem ' ''DEBUG GetYearFromDate = VAL(MID$(szDate$, 1, 4)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetMonthFromDate (szDate$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szDate = "" then BadArgErr 1, "GetMonthFromDate", szDate$ end if %endrem ' ''DEBUG GetMonthFromDate = VAL(MID$(szDate$, 6, 2)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetDayFromDate (szDate$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szDate = "" then BadArgErr 1, "GetDayFromDate", szDate$ end if %endrem ' ''DEBUG GetDayFromDate = VAL(MID$(szDate$, 9, 2)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetHourFromDate (szDate$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szDate = "" then BadArgErr 1, "GetHourFromDate", szDate$ end if %endrem ' ''DEBUG GetHourFromDate = VAL(MID$(szDate$, 12, 2)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetMinuteFromDate (szDate$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szDate = "" then BadArgErr 1, "GetMinuteFromDate", szDate$ end if %endrem ' ''DEBUG GetMinuteFromDate = VAL(MID$(szDate$, 15, 2)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetSecondFromDate (szDate$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szDate = "" then BadArgErr 1, "GetSecondFromDate", szDate$ end if %endrem ' ''DEBUG GetSecondFromDate = VAL(MID$(szDate$, 18, 2)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetVersionOfFile (szFile$) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidFATPath(szFile$) = FALSE then BadArgErr 1, "GetVersionOfFile", szFile$ end if %endrem ' ''DEBUG DIM cb%, szBuf$, cbRet& cb% = 30 szBuf$ = STRING$(cb%, 32) cbRet& = CbGetVersionOfFile(szFile$, szBuf$, CLng(cb%)) GetVersionOfFile = NullTrim(szBuf$) %rem 'DEBUG IF CInt(cbRet&) >= cb% THEN '' StfApiErr saeOvfl, "GetVersionOfFile", szFile$ ErrorMsg SID_ERR_GETVERSIONOFFILE, "" ERROR STFQUIT END IF %endrem ' ''DEBUG szBuf$ = "" END FUNCTION '************************************************************************* PUBLIC FUNCTION GetVersionNthField (szVersion$, nField%) AS LONG '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if (nField% < 1) OR (nField% > 4) then BadArgErr 2, "GetVersionNthField", szVersion$+", "+STR$(nField%) end if %endrem ' ''DEBUG GetVersionNthField = LGetVersionNthField(szVersion$, CLng(nField%)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetSizeOfFile (szFile$) AS LONG '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidFATPath(szFile$) = FALSE then BadArgErr 1, "GetSizeOfFile", szFile$ end if %endrem ' ''DEBUG GetSizeOfFile = LcbGetSizeOfFile(szFile$) END FUNCTION '************************************************************************* PUBLIC FUNCTION FindTargetOnEnvVar (szFile$, szEnvVar$) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if CchlValidFATSubPath(szFile$) = 0 then n% = 1 elseif szEnvVar$ = "" then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "FindTargetOnEnvVar", szFile$+", "+szEnvVar$ end if %endrem ' ''DEBUG DIM cb%, szBuf$, cbRet& cb% = 512 szBuf$ = STRING$(cb%, 32) cbRet& = CbFindTargetOnEnvVar(szFile$, szEnvVar$, szBuf$, CLng(cb%)) IF CInt(cbRet&) >= cb% THEN ErrorMsg SID_ERR_FINDTARGETONENVVAR, "" ERROR STFQUIT END IF szBuf$ = NullTrim(szBuf$) IF MID$(szBuf$, 1, 1) = "\" THEN szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$ ELSEIF Len(szBuf$) > 0 AND MID$(szBuf$, 2, 1) <> ":" THEN szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$ END IF FindTargetOnEnvVar = szBuf$ szBuf$ = "" END FUNCTION '************************************************************************* PUBLIC FUNCTION FindFileInTree (szFile$, szDir$) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if CchlValidFATSubPath(szFile$) = 0 then n% = 1 elseif FValidFATDir(szDir$) = FALSE then n% = 2 else n% = 0 end if if n% > 0 then BadArgErr n%, "FindFileInTree", szFile$+", "+szDir$ end if %endrem ' ''DEBUG DIM cb%, szBuf$, cbRet& cb% = 512 szBuf$ = STRING$(cb%, 32) cbRet& = CbFindFileInTree(szFile$, szDir$, szBuf$, CLng(cb%)) FindFileInTree = NullTrim(szBuf$) %rem 'DEBUG IF CInt(cbRet&) >= cb% THEN '' StfApiErr saeOvfl, "FindFileInTree", szFile$+", "+szDir$ ErrorMsg SID_ERR_FINDFILEINTREE, "" ERROR STFQUIT END IF %endrem ' ''DEBUG szBuf$ = "" END FUNCTION '************************************************************************* PUBLIC FUNCTION GetConfigSmartdrvSize () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetConfigSmartdrvSize = CInt(WGetConfigSmartdrvSize()) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetConfigRamdriveSize () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetConfigRamdriveSize = CInt(WGetConfigRamdriveSize ()) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetConfigNumBuffers () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetConfigNumBuffers = CInt(WGetConfigNumBuffers()) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetConfigNumFiles () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* GetConfigNumFiles = CInt(WGetConfigNumFiles()) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetConfigLastDrive () AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM chRet& chRet& = WGetConfigLastDrive() if chRet& = 0 then GetConfigLastDrive = "" else GetConfigLastDrive = CHR$(chRet&) end if END FUNCTION '************************************************************************* PUBLIC FUNCTION IsDriverInConfig (szDrv$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szDrv$ = "" then BadArgErr 1, "IsDriverInConfig", szDrv$ end if %endrem ' ''DEBUG IsDriverInConfig = CInt(FIsDriverInConfig(szDrv$)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetProcessorType () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM rSysInf as SysInfoType GetProcessorType = 0 GetSystemInfo rSysInf IF rSysInf.dwProcessorType = PROCESSOR_INTEL_PENTIUM THEN GetProcessorType = 4 ELSEIF rSysInf.dwProcessorType = PROCESSOR_INTEL_486 THEN GetProcessorType = 4 ELSEIF rSysInf.dwProcessorType = PROCESSOR_INTEL_386 THEN GetProcessorType = 3 ELSEIF rSysInf.dwProcessorType = PROCESSOR_INTEL_860 THEN GetProcessorType = 1 END IF END FUNCTION '************************************************************************* PUBLIC SUB GetParallelPortsList (szSymbol$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szSymbol$ = "" then BadArgErr 1, "GetParallelPortsList", szSymbol$ end if %endrem ' ''DEBUG if FGetParallelPortsList(szSymbol$) = FALSE then ErrorMsg SID_ERR_GETPARALLELPORTSLIST, "" ERROR STFQUIT end if END SUB '************************************************************************* PUBLIC SUB GetSerialPortsList (szSymbol$) '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if szSymbol$ = "" then BadArgErr 1, "GetSerialPortsList", szSymbol$ end if %endrem ' ''DEBUG if FGetSerialPortsList(szSymbol$) = FALSE then ErrorMsg SID_ERR_GETSERIALPORTSLIST, "" ERROR STFQUIT end if END SUB '************************************************************************* PUBLIC FUNCTION Has87MathChip () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* Has87MathChip = CInt(FHas87MathChip()) END FUNCTION '************************************************************************* PUBLIC FUNCTION HasMonochromeDisplay () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* HasMonochromeDisplay = CInt(FHasMonochromeDisplay()) END FUNCTION '************************************************************************* PUBLIC FUNCTION HasMouseInstalled () AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* HasMouseInstalled = CInt(FHasMouseInstalled()) END FUNCTION '************************************************************************* PUBLIC FUNCTION DoesDirExist (szDir$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidFATDir(szDir$) = FALSE then BadArgErr 1, "DoesDirExist", szDir$ end if %endrem ' ''DEBUG DoesDirExist = CInt(Lot_DoesDirExist(szDir$)) END FUNCTION '************************************************************************* PUBLIC FUNCTION DoesIniSectionExist (szFile$, szSect$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidIniFile(szFile$) = FALSE then BadArgErr 1, "DoesIniSectionExist", szFile$+", "+szSect$ end if %endrem ' ''DEBUG DoesIniSectionExist = CInt(FDoesIniSectionExist(szFile$, szSect$)) END FUNCTION '************************************************************************* PUBLIC FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) AS INTEGER '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidIniFile(szFile$) = FALSE then n% = 1 elseif szKey$ = "" then n% = 3 else n% = 0 end if if n% > 0 then BadArgErr n%, "DoesIniKeyExist", szFile$+", "+szSect$+", "+szKey$ end if %endrem ' ''DEBUG DoesIniKeyExist = CInt(FDoesIniKeyExist(szFile$, szSect$, szKey$)) END FUNCTION '************************************************************************* PUBLIC FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) AS STRING '** Purpose: '** '** '** Author: '** Arguments: '** '** '** Returns: '** '************************************************************************* %rem 'DEBUG if FValidIniFile(szFile$) = FALSE then n% = 1 elseif szKey$ = "" then n% = 3 else n% = 0 end if if n% > 0 then BadArgErr n%, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$ end if %endrem ' ''DEBUG DIM cb&, szBuf$, cbRet& cb& = 512 szBuf$ = CreateBuffer(cb&) cbRet& = GetPrivateProfileString (szSect$, szKey$, "", szBuf$, cb&, szFile$) GetIniKeyString = NullTrim(szBuf$) %rem 'DEBUG IF CInt(cbRet&) >= cb% THEN '' StfApiErr saeOvfl, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$ ErrorMsg SID_ERR_GETINIKEYSTRING, "" ERROR STFQUIT END IF %endrem ' ''DEBUG szBuf$ = "" END FUNCTION '************************************************************************* PUBLIC SUB SetListItem (szSymbol$, n%, szListItem$) '** Purpose: '** Author: '** Arguments: '************************************************************************* DIM ListLen%, i% ListLen% = GetListLength(szSymbol) IF n% < 0 THEN ErrorMsg SID_ERR_GETLISTITEM2, LSI_INFO(13) & _ " : " & LSI_INFO(12) & " : " & LSI_INFO(11) ERROR STFQUIT ELSEIF n% <= ListLen% THEN ReplaceListItem szSymbol$, n%, szListItem$ ELSE FOR i% = ListLen%+1 TO n%-1 STEP 1 AddListItem szSymbol$, "" NEXT AddListItem szSymbol$, szListItem$ END IF END SUB '*********************************************************************** '** '** SUB ErrorMsg (nMsg%, szErr$) '** '** Description: '** Display an error message '** '** Explicit Parameters: '** nMsg% The error message number to display. Use 0 if none '** szErr$ An extra error message that is appended after a '** space only the message in nMsg% '** '** Implicit Parameters: '** '*********************************************************************** PUBLIC SUB ErrorMsg (nMsg%, szErr$) DIM sz$, notused& IF nMsg% <> 0 THEN sz$ = LdString(nMsg%) IF szErr$ <> "" THEN sz$ = sz$ + " " + szErr$ ELSE sz$ = szErr$ END IF 'MessageBox sz$, MB_SYSTEMMODAL + MB_OK + MB_ICONEXCLAMATION, LdString(SID_TKT_STD_TITLE) notused = DoMsgBox (sz$, LdString(SID_TKT_STD_TITLE) , MB_OK + MB_ICONEXCLAMATION) END SUB '*********************************************************************** '** '** SUB RegErrorMsg (msg&, szKey$, szItem$, szValue$) '** '** Description: '** Display an error message '** '** Explicit Parameters: '** '** Implicit Parameters: '** '*********************************************************************** PUBLIC SUB RegErrorMsg (msg%, szKey$, szItem$, szValue$) DIM sz$, notused& sz$ = LdString(msg%)+szKey$ If NOT szItem$ ="" Then sz$ = sz$+"("+szItem$+") " End If If NOT szValue$ ="" Then sz$ = sz$+": "+szValue$ End If notused = DoMsgBox (sz$, LdString(SID_TKT_REG_ERR_TITLE) , MB_OK + MB_ICONEXCLAMATION) END SUB '*********************************************************************** '** '** Name: FatalErrorMsg '** Description: '** Display an error message and exit the script '** '** Explicit Parameters: '** nMsg% The error message number to display. Use 0 if none '** szErr$ An extra error message that is appended after a '** space only the message in nMsg% '** err% Number to be passed to ERROR function '** '** Implicit Parameters: '** '*********************************************************************** PUBLIC SUB FatalErrorMsg (nMsg%, szErr$, nErr%) ErrorMsg nMsg%, szErr$ ERROR nErr% END SUB '*********************************************************************** '** '** Name: ErrorMsgNoDlgExit '** Description: '** Display an error message and set symbol to no exit dlg '** '** Explicit Parameters: '** nMsg% The error message number to display. Use 0 if none '** szErr$ An extra error message that is appended after a '** space only the message in nMsg% '** '** Out symbols: '** __LASTSTATUS Set to "Q" to tell script not to quit '** '** Implicit Parameters: '** '*********************************************************************** PUBLIC SUB ErrorMsgNoDlgExit (nMsg%, szErr$) ErrorMsg nMsg%, szErr$ SetListItem "__LASTSTATUS", 1, "Q" END SUB PUBLIC SUB LdStringInit () '** Purpose: Ensure the initialization of SYM_CUIDLL and loading of libraries ' before any LdString calls '** Author: Jack Donohue '** Arguments: None '** Returns: None '************************************************************************* DIM cuidll$, t$, i%, s$, hDll& DIM szBuf$, cbBuf&, wRet& if fLdStringInit = 0 Then fLdStringInit = 1 t$ = GetSymbolValue(SYM_STF_CWDDIR$) cuidll$ = GetIniKeyString(t$+gINSTALLINI$, "TOOLKIT", SYM_CUIDLL$) If cuidll$ = "" Then cuidll$ = "MSCUISTF.DLL" End If SetSymbolValue SYM_CUIDLL$, cuidll$ i% = 1 s$ = "Start" WHILE (s$ <> "") s$ = Lot_GetNthFieldFromIniString (GetSymbolValue(SYM_CUIDLL$), i%, "") if s$ <> "" then hDll& = GetModuleHandle(s$) If hDll& = 0 Then hDll& = LoadLibrary(s$) End if If hDll& = 0 Then print "Couldn't get module handle:" s$ End If end if i% = i% + 1 WEND End If END SUB PUBLIC FUNCTION LdString (TextID%) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '************************************************************************* DIM rc&, s$, i%, hDll&, cb& ' Maximum string size because of RED limitation cb& = 256 ' Modify routine to search in other DLLs if string not found ' --------------------------- if fLdStringInit = 0 Then LdStringInit End If g_strbuf$ = CreateBuffer(cb&) rc& = LoadString(HinstCui(), CLng(TextID%), g_strbuf$, cb&-1) ' Not found in generic dll If rc& = 0 Then i% = 2 WHILE (TRUE) s$ = Lot_GetNthFieldFromIniString (GetSymbolValue(SYM_CUIDLL$), i%, "") if s$ <> "" then hDll& = GetModuleHandle(s$) If hDll& = 0 Then hDll& = LoadLibrary(s$) End if If hDll& <> 0 Then g_strbuf$ = CreateBuffer(cb&) rc& = LoadString(hDll&, CLng(TextID%), g_strbuf$, cb&-1) If rc& <> 0 Then goto FoundTheString End If End If else goto label1 end if i% = i% + 1 WEND End If label1: ASSERT rc& <> 0, "String " + STR(TextID%) + " Not Found" FoundTheString: LdString = LEFTBP(g_strbuf$, CINT(rc&)) g_strbuf$ = "" END FUNCTION '** FUNCTION Lot_CleanPath (path$) AS INTEGER '** '** Purpose: Clean a FAT path. Removes .. and . Makes path lower case '** and ensures that the path has a trailing backslash. '** '** Author: DND '** Arguments: path$. The path to modify '** Returns: TRUE if path is valid '************************************************************************* PUBLIC FUNCTION Lot_CleanPath (path$) AS INTEGER DIM rv%, lastchar$ rv% = FCleanFatPath(path$) IF rv% <> FALSE THEN path = NullTrim(path$) lastchar$ = RIGHT$(path$, 1) IF lastchar$ <> "\" THEN path$ = path$ + "\" path$ = LCASE$(path$) Lot_CleanPath = TRUE ELSE Lot_CleanPath = FALSE END IF END FUNCTION 'This was MS API but is modified by Marcel( (takes a delimiter char) '************************************************************************* PUBLIC FUNCTION Lot_GetNthFieldFromIniString (szLine$, iField%, sp$) AS STRING '** Purpose: '** Author: '** Arguments: '** Returns: '** '************************************************************************* DIM szStart$, i%, iNew% IF sp$ = "" THEN sp$ = "," END IF IF iField% < 1 THEN ErrorMsg SID_ERR_LOT_GNFFIS, "" ERROR STFQUIT END IF szStart$ = szLine$ IF iField% <> 1 THEN FOR i% = 2 TO iField% STEP 1 iNew% = INSTR(szStart$, sp$) IF iNew% = 0 THEN Lot_GetNthFieldFromIniString = "" GOTO GNFFIS_END END IF szStart$ = MID$(szStart$, (iNew% + 1),100) NEXT END IF iNew% = INSTR(szStart$, sp$) IF iNew% <> 0 THEN szStart$ = MID$(szStart$, 1, (iNew% - 1)) END IF ' tqi - not sure we want to change this - depends upon what is handed in! ' don't know the delimiters on it.??? - caller responsible for trimming? ' can't find it's use -tqi Lot_GetNthFieldFromIniString = LTRIM$(RTRIM$(szStart$)) GNFFIS_END: END FUNCTION '************************************************************************* '**************** Setup Basic String Functions ********************* '************************************************************************* '************************************************************************ DIM gDEBUG% PUBLIC SUB SetUpAPI '*******EXECUTABLE CODE****************** 'This initializes the toolkit. ' This is called from initialize in main, as the very first action 'TRAP CleanupTrap From "MSSHLSTF.DLL" 'End Trap DIM cuidll$, gCursorSave&, notused% gCursorSave& = ShowWaitCursor() hSetup = InitSetup(COMMAND$) IF ENVIRON$(gLOTUS_DEBUG) <> "" THEN gDEBUG%=TRUE ELSE gDEBUG%=FALSE END IF 'ON ERROR GOTO QUIT 'JMD ' This symbol now returns a list of strings which can be parsed using ' Lot_GetNthFieldFromIniString ' ---------------------------- if fLdStringInit = 0 Then LdStringInit End If cuidll$ = Lot_GetNthFieldFromIniString (GetSymbolValue(SYM_CUIDLL$), 1, "") SetBitmap cuidll$, LOGO notused% = FLotusInitialize (LSI_INFO(4)) '** DND: Set the K and MB strings gStrK$ = LdString(SID_KBYTE_CHAR) gStrMB$ = LdString(SID_MBYTE_CHAR) END SUB PUBLIC SUB ASSERT (assertion%, msg$) DIM notused& If assertion% = FALSE Then If gDEBUG% = TRUE Then notused& = DoMsgBox (LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & _ LSI_INFO(11) + CHR(10) + msg$ , _ "ASSERT!!", MB_OK + MB_ICONEXCLAMATION ) 'MessageBox LSI_INFO(13) & " : " & LSI_INFO(12) & " : " & _ 'LSI_INFO(11) + CHR(10) + msg$ , _ 'MB_OK + MB_ICONEXCLAMATION, "ASSERT!!" ERROR STFQUIT End If End If END SUB '************************************************************************* PUBLIC SUB WriteToFile(szFile$,sz$) '** Purpose: Writes the string sz$ to the file szFile$ '** Author: MZ,TV '** Arguments: szFile$,sz$ '** Returns: '** '************************************************************************* IF FWriteToFile(szFile$,sz$) = FALSE THEN ErrorMsg SID_ERR_WRITETOLOGFILE, szFile$ + ":" + sz$ ERROR STFQUIT END IF END SUB '************************************************************************** PUBLIC FUNCTION Lot_RegCreateKeyEx(ByVal hKey&,ByVal szKey$) AS LONG '** Purpose: '** Author: Pam Donahue '** Arguments: '** Returns: '** '************************************************************************* Lot_RegCreateKeyEx = CreateRegKeyEx(hKey&,szKey$) END FUNCTION '************************************************************************** PUBLIC FUNCTION Lot_RegDelAllSubKeys(ByVal hKey&,ByVal szKey$) AS LONG '** Purpose: '** Author: Pam Donahue '** Arguments: '** Returns: '** '************************************************************************* Lot_RegDelAllSubKeys = DeleteAllSubKeys(hKey&,szKey$) END FUNCTION '************************************************************************** PUBLIC FUNCTION Lot_DoesRegKeyExistEx(ByVal hKey&,ByVal szKey$) AS LONG '** Purpose: '** Author: Pam Donahue '** Arguments: '** Returns: '** '************************************************************************* Lot_DoesRegKeyExistEx = DoesRegKeyExistEx(hKey&,szKey$) END FUNCTION '************************************************************************** PUBLIC FUNCTION Lot_DeleteRegKeyEx(ByVal hKey&,ByVal szKey$) AS LONG '** Purpose: '** Author: Pam Donahue '** Arguments: '** Returns: '** '************************************************************************* Lot_DeleteRegKeyEx = DeleteRegKeyEx(hKey&,szKey$) END FUNCTION '************************************************************************** PUBLIC FUNCTION Lot_CreateRegKeyValueEx(ByVal hKey&, ByVal szSubKey$,_ ByVal szValueName$, ByVal dwType&,_ ByVal lpValueData as variant, ByVal dwDataLen& ) AS LONG '** Purpose: '** Author: Pam Donahue '** Arguments: '** Returns: '** '************************************************************************* Dim regstatus&, notused& szSubKey$ = Lot_TrimEndSlash (szSubKey$) if DoesRegKeyExistEx(ByVal hKey&, ByVal szSubKey$) <> 1 then regstatus = CreateRegKeyEx(hKey&,szSubKey$) end if SELECT CASE dwType& CASE REG_SZ Lot_CreateRegKeyValueEx = CreateRegKeyValueExS(hKey&,szSubKey$,szValueName$,dwType&,dwDataLen&,lpValueData) CASE REG_EXPAND_SZ Lot_CreateRegKeyValueEx = CreateRegKeyValueExS(hKey&,szSubKey$,szValueName$,dwType&,dwDataLen&,lpValueData) CASE REG_DWORD Lot_CreateRegKeyValueEx = CreateRegKeyValueExD(hKey&,szSubKey$,szValueName$,dwType&,dwDataLen&,lpValueData) CASE ELSE notused& = DoMsgBox("Lot_CreateRegKeyValueEx: ValueData illegal type", "WRONG PARAMTER VALUE" ,MB_TASKMODAL+MB_ICONHAND+MB_OK) END SELECT END FUNCTION '************************************************************************** PUBLIC FUNCTION Lot_SetRegKeyValueEx(ByVal hKey&, ByVal szSubKey$,_ ByVal szValueName$, dwType&,_ ByVal lpValueData as variant,ByVal dwDataLen&) AS LONG '** Purpose: '** Author: Pam Donahue '** Arguments: '** Returns: '** '************************************************************************* Dim notused& SELECT CASE dwType& CASE REG_SZ Lot_SetRegKeyValueEx = SetRegKeyValueExS(hKey&,szSubKey$,szValueName$,dwType&,lpValueData,dwDataLen&) CASE REG_EXPAND_SZ Lot_SetRegKeyValueEx = SetRegKeyValueExD(hKey&,szSubKey$,szValueName$,dwType&,lpValueData,dwDataLen&) CASE REG_DWORD Lot_SetRegKeyValueEx = SetRegKeyValueExD(hKey&,szSubKey$,szValueName$,dwType&,lpValueData,dwDataLen&) CASE ELSE notused& = DoMsgBox("Lot_SetRegKeyValueEx: ValueData illegal type", "WRONG PARAMTER VALUE" ,MB_TASKMODAL+MB_ICONHAND+MB_OK) END SELECT END FUNCTION '************************************************************************** PUBLIC FUNCTION Lot_GetRegKeyValueEx(ByVal hKey&, ByVal szSubKey$,_ ByVal szValueName$, dwType&,_ lpBuf as variant, cbBuf&) AS LONG '** Purpose: '** Author: Pam Donahue '** Arguments: '** Returns: '** '************************************************************************* dim dwBuf&, cbStrBuf& dim strBuf AS STRING dim requestType& cbStrBuf& = 1024 strBuf$ = CreateBuffer(cbStrBuf&) requestType& = dwType Lot_GetRegKeyValueEx = GetRegKeyValueEx(hKey&,szSubKey$,_ szValueName$,dwType&,cbStrBuf&,dwBuf&,strBuf$) IF Lot_GetRegKeyValueEx = ERROR_SUCCESS AND dwType <> REG_NONE THEN if dwType = REG_DWORD then lpBuf = dwBuf else lpBuf = strBuf end if END IF END FUNCTION '************************************************************************** '** Purpose: Retrieves the alias for long dir names '** Author: Greg Lutz '** Arguments: '** Returns: '** '************************************************************************* PUBLIC FUNCTION GetShortPathName(ByVal szLong$, szShort$) AS LONG DIM fixed$ fixed$ = CreateBuffer(256) GetShortPathName = Lot_GetShortPathName(szLong$, fixed$, 256) 'Print "fixed " fixed$ If GetShortPathName& = FALSE THEN szShort$ = szLong$ Else szShort$ = fixed$ End If END FUNCTION '************************************************************************* PUBLIC FUNCTION EnableWindow (ByVal hwnd&, ByVal fEnable&) AS INTEGER '** Purpose: Wrapper to prevent trying to enable null windows. If hwnd = 0 then EnableWindow = 0 Else EnableWindow = WEnableWindow(hwnd,fEnable) End If END FUNCTION