home *** CD-ROM | disk | FTP | other *** search
-
-
- '**************************************************************************
- '* Non-Locked Rolex install script
- '**************************************************************************
-
- '* Mark Young
- '* This install script hacked from Max's Locked MaxFaster Install Script
- '* 05/15/93
- '*
- '* 11/02/93 - add modifications to address installing
- '* over previous versions ( 2.x, etc. )
- '* 1) move *.ZCN, *.TRN, *.UD to \OmniPro\DATA directory
- '* 2) rename *.MD to *.NDX
- '* 3) delete *.DLL, *.PLX, *.EXE from \OmniPro directory
- '*
- '*
- '* 11/08/93 - changed minimum disk space requirement to 10mg from 8mg
- '*
- '* 11/14/93 - changed procedure for reading disk from serial
- '* added call to the registration dialog
- '* added new dialog after registration
- '*
- '* 11/19/93 - added new file section WINFILES that installs to \WINDOWS
- '*
- '* 11/19/93 - added preliminary implementation of new dialog that
- '* will appear after a cancelled registration
- '*
- '* 12/17/93 - added a whole bunch of comments - stripped out useless code
- '*
- '* 12/20/93 - added code to remove OP30 line from WIN.INI if user specifies
- '* the path designated in [OmniPage] - OP30 - as installation
- '* directory for OmniPage Professional 5.0
- '*
-
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
- '// product name used to set installer main dialog title
- CONST INSTALLNAME = "OmniPage Professional"
-
- '// minimum disk space required for installation of product
- '// user will not be able to install unless this figure
- '// is less than the available disk space on specified drive
- '// - value is in bytes, NOT kilobytes or megabytes
- CONST DISKSPACEREQ = 10000000
-
- '// for maximizing installer screen
- CONST WS_VISIBLE = &H10000000
- CONST WS_BORDER = &H00800000
- CONST WS_CLIPCHILDREN = &H02000000
- CONST GWL_STYLE = -16
- CONST SW_SHOWMAXIMIZED = 3
- CONST SW_RESTORE = 9
-
-
- ''Dialog ID's
- CONST ASKQUIT = 200 '// ask user if they really want to quit
- CONST DESTPATH = 300 '// get installation directory from user
- CONST EXITFAILURE = 400
- CONST EXITQUIT = 600
- CONST EXITSUCCESS = 700 '// tell user installation was successful
- CONST OPTIONS = 800 '// not used in Rolex install
- CONST APPHELP = 900
- CONST NOTENH = 1000 '// tell user enhanced mode is required
- CONST WARN_OVERWRITE = 1100
- CONST BADPATH = 6400 '// tell user why install path is unusable
- CONST REGISTER = 2000
- CONST BADDISKSERIAL = 2001
- CONST BADUSERSERIAL = 2002
- CONST POSTREGINSTRUCT = 3001
- CONST OMNIRUN = 6500
-
- '// for registration cancelled dialog
- CONST REGCANCELDLG = 4000
- GLOBAL REGCANCELERR%
-
- 'string constants
- CONST INSTALLSTR = 1
- CONST ABOUTSTR = 2
- CONST NOINSTALLSTR = 3
-
- GLOBAL DEST$ '// user specified installation directory.
- GLOBAL DISK_SERIAL$ '// to store serial # read from disk
-
- '// functions and procedures defined within this file ( SETUP.MST )
- DECLARE SUB Install
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE FUNCTION GetString (id%) AS STRING
-
- '// this function returns zero if there is MinSpace& available
- '// in directory NewPath$, otherwise returns (-1)
- DECLARE FUNCTION NotEnoughDiskSpace( NewPath$, MinSpace& ) as INTEGER
-
-
- '// end of functions and procedures defined within this file ( SETUP.MST )
-
- 'declare functions used to get strings from the custom ui dll
- DECLARE FUNCTION LoadString LIB "user" (iInst%, iRes%, lpStr$, iSize%) AS INTEGER
- DECLARE FUNCTION LoadLibrary LIB "kernel" (lpFile$) AS INTEGER
- DECLARE FUNCTION FindWindow LIB "user" (lpClassStr$, lpWinStr$) AS INTEGER
- DECLARE SUB FreeLibrary LIB "kernel" (iInst%)
-
-
-
- '// for maximizing installer screen
- DECLARE FUNCTION ShowWindow LIB "user" (hWnd%, iShow% ) as INTEGER
- DECLARE FUNCTION SetWindowLong LIB "user" (hWnd%, offset%, style& ) as LONG
-
-
- 'declare the installation functions used in the library deinst.dll
- DECLARE FUNCTION CaereDeinstall LIB "deinst.dll" (lpMode$, lpDir$) As INTEGER
- DECLARE FUNCTION CaereGetSerial LIB "deinst.dll" (lpDrive$, lpSerial$) AS INTEGER
- DECLARE SUB CaereCancelInstall LIB "deinst.dll"
-
-
- '// for installing over existing application ( Max wrote these !! )
- DECLARE FUNCTION CopyFiles LIB "FUTIL.dll" ( target$, dest$ ) AS INTEGER
- DECLARE FUNCTION RenameFiles LIB "FUTIL.dll" ( target$, dest$ ) AS INTEGER
- DECLARE FUNCTION DeleteFiles LIB "FUTIL.dll" ( target$ ) AS INTEGER
-
-
- '// for handling serial number and registration
- DECLARE FUNCTION GetSerialFromFloppy LIB "MSCUISTF.DLL" ( theDrive$, theSerial$ ) as INTEGER
- DECLARE FUNCTION GetRegistration LIB "MSCUISTF.DLL" ( theINIFile$, theSerial$ ) as INTEGER
- DECLARE SUB GetWarrantyInfo LIB "MSCUISTF.DLL" ( theUserName$, theCompName$, isIEVersion$ )
-
-
- INIT:
-
- '// global flag to communicate that registration was cancelled
- REGCANCELERR% = 0
-
- CUIDLL$ = "mscuistf.dll" '// Custom user interface dll
- HELPPROC$ = "FHelpDlgProc" '// Help dialog procedure
-
- '// set the main window title, this will differ for each app
- '// get the string from the ui dll
- SetTitle GetString(INSTALLSTR)
-
- 'set the about box with some caere stuff
- SetAbout GetString(INSTALLSTR), GetString(ABOUTSTR)
-
- '// specify the bitmap to add to install splash - bmp is in MSCUISTF.DLL
- SetBitmap CUIDLL$, 1
-
- '// to maximize install screen
- hWnd% = HwndFrame()
- k& = SetWindowLong( hWnd%, GWL_STYLE, WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN )
- j% = ShowWindow( hWnd%, SW_SHOWMAXIMIZED )
-
- '// turn on beeping
- i% = SetBeepingMode(1)
-
- '// get the source directory for installation
- INSTALL_DISK_DRIVE$ = GetSymbolValue("STF_SRCDIR")
-
- '// get the source drive for installation
- INSTALL_DISK_DRIVE$ = MID$( INSTALL_DISK_DRIVE$, 1, 1 )
-
-
- '// check whether user is running in enhanced mode
- NOTENHANCED:
-
- 'make sure we are in enhanced mode or don't install
- IF GetWindowsMode() <> 2 THEN
-
- '// tell user they must be running in enhanced mode
- sz$ = UIStartDlg(CUIDLL$, NOTENH, "FInfo0DlgProc", 0, "")
-
- '// put away frontmost dialog
- UIPop 1
-
- ' exit the install script
- END
-
- ENDIF
-
- OMNIPAGERUNNING:
-
- '// check to see if omnipage is already running on their target machine
- IF (FindWindow("OmniPagePro", NULL)) THEN
-
- '// tell user they must exit omnipage before they can install
- sz$ = UIStartDlg(CUIDLL$, OMNIRUN, "FInfo0DlgProc", 0, "")
-
- '// handle installation termination
- GOTO ERRQUIT
-
- ENDIF
-
-
- '// get serial number from install diskette
- GETSERIAL:
-
- '// get serial # from diskette
- DISK_SERIAL$ = "2804b-c00-003289 "
-
- '// this function will look for serial number on current diskette
- '// - if not found or not valid, prompts user to insert proper diskette
- serial_result% = 0
- 'GetSerialFromFloppy( INSTALL_DISK_DRIVE$, DISK_SERIAL$ )
-
- '// if there was a problem getting serial number
- '// or user pressed CANCEL within dialog prompting user
- '// to "insert floppy with serial number",
- '// then abort installation
- IF ( serial_result% = -1 ) THEN
-
- '// specify this was a user cancelled installation
- ERROR STFERR
-
- '// handle installation termination
- GOTO QUIT
-
- ENDIF
-
- '// close frontmost dialog
- UIPop 1
-
- '// construct default installation path
- INSTALLDIR:
-
- '// get previous installation path of OmniPage from WIN.INI
- DEST$ = GetIniKeyString("WIN.INI", "OmniPage", "OP30" )
-
- '// create previous full path to OmniPage application
- TDEST$ = MakePath( DEST$, "OP.EXE" )
-
- '// if previous OmniPage application exists in directory specified
- '// in WIN.INI then use that directory as default install directory
- IF ( DoesFileExist( TDEST$, femExists )) THEN
-
- '// leave path DEST$ alone !!
-
- ELSE
-
- '// use OMNIPRO\ as default install directory
- DEST$ = "C:\OMNIPRO"
-
- ENDIF
-
- '// read in the SETUP information file
- '// this contains application file list from LAYOUT files
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- END IF
- ReadInfFile szInf$
-
- '// set default path for dialog where user specifies install directory
- GETPATH:
-
- '// stuff default installation directory into dialog
- SetSymbolValue "EditTextIn", DEST$
-
- '// make sure the edit text cell is selected
- SetSymbolValue "EditFocus", "END"
-
- '// get the directory from user to install the application
- GETPATHL1:
-
- '// display dialog for user to specify installation directory
- sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
-
- '// get the specified installation directory from edit text cell
- DEST$ = GetSymbolValue("EditTextOut")
-
- '// if user pressed CONTINUE button in dialog to specify install directory
- IF sz$ = "CONTINUE" THEN
-
- '// if specified install directory is invalid
- '// or user does not have write privileges
- '// display bath path dialog and redisplay the dialog
- '// where user specifies installation directory
- IF IsDirWritable(DEST$) = 0 THEN
-
- '// tell user why this directory cannot be used for installation
- GOSUB BADPATH
-
- '// let user reenter installation directory
- GOTO GETPATHL1
-
- END IF
-
- '// put away frontmost dialog
- UIPop 1
-
- '// user pressed EXIT button in dialog to specify install directory
- ELSE
-
- '// ask user if they really want to quit
- GOSUB ASKQUIT
-
- '// return to dialog where user specifies installation directory
- GOTO GETPATH
-
- ENDIF
-
- '// PROCEED WITH INSTALLATION - INSTALL PATH CAN BE CREATED
-
- '// strip trailing backslash from specified install directory
- IF ( MID$( DEST$,LEN(DEST$),1 ) = "\" ) THEN
- DEST$ = MID$( DEST$,1,LEN(DEST$)-1 )
- ENDIF
-
- '// if there is insufficient disk space available in
- '// specified installation directory give an error dialog
- '// and redisplay diealog where user specifies installation directory
- IF ( NotEnoughDiskSpace( DEST$, DISKSPACEREQ )) THEN
-
- '// return to dialog where user specifies installation directory
- GOTO GETPATH
-
- ENDIF
-
- '// if installation directory already exists warn user that
- '// many files will be deleted and others will be moved
- IF ( DoesDirExist( DEST$ )) THEN
-
- '// warn the user that existing directory will be mungged
- sz$ = UIStartDlg(CUIDLL$, WARN_OVERWRITE, "FEditDlgProc", APPHELP, HELPPROC$ )
-
- '// if user pressed other than CONTINUE button in the DIALOG
- '// redisplay dialog to specify installation directory
- IF sz$ <> "CONTINUE" THEN
-
- '// put away frontmost dialog
- UIPop 1
-
- '// redisplay dialog to specify installation directory
- GOTO INSTALLDIR
-
- ENDIF
-
- '// put away frontmost dialog
- UIPop 1
-
- ENDIF
-
- 'call the function defined below which installs the application files
- Install
-
- '// determine which QUIT state is appropriate
- QUIT:
-
- ON ERROR GOTO ERRQUIT
-
- '// select proper dialog to display when installation is terminated
-
- '// successful install completed
- IF ERR = 0 THEN
-
- dlg% = EXITSUCCESS
-
- '// user terminated install process
- ELSEIF ERR = STFQUIT THEN
-
- '// user terminated install process during registration
- IF ( REGCANCELERR% = 1 ) THEN
-
- dlg% = REGCANCELDLG
-
- '// user cancelled install process before registration
- ELSE
-
- dlg% = EXITQUIT
-
- ENDIF
-
- '// there was a fatal error during installation
- ELSE
-
- dlg% = EXITFAILURE
-
- ENDIF
-
- '// drop through, now that proper dialog has been selected
-
- '// terminate installation process
- QUITL1:
-
- '// display dialog selected above in QUIT: section
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
-
- '// put away frontmost dialog
- UIPop 1
-
- '// if installation was successful
- IF ( dlg% = EXITSUCCESS ) THEN
-
- '// exit the install script
- END
-
- ENDIF
-
-
- '// drop through and display install termination dialog
-
- '// code to handle a cancelled installation
- ERRQUIT:
-
- '// cancel the install process
- CaereCancelInstall
-
- '// exit the install script
- END
-
- '// code to handle an invalid specified installation directory
- BADPATH:
-
- '// display dialog explaining why installation directory cannot be used
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
-
- '// put away frontmost dialog
- UIPop 1
-
- '// resume script execution from GOSUB call
- RETURN
-
- '// code to handle asking user if they want to quit
- ASKQUIT:
-
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- '// user pressed EXIT button in dialog
- IF sz$ = "EXIT" THEN
-
- '// close all dialogs
- UIPopAll
-
- '// specify that user cancelled installation
- ERROR STFQUIT
-
- '// user did not press EXIT button in dialog
- ELSE
-
- '// put away frontmost dialog and proceed with installation
- UIPop 1
-
- ENDIF
-
- '// resume script execution from GOSUB call
- RETURN
-
- '// termination of MAIN() body of code in installation script
- RETURN
-
-
- '**
- '** Purpose:
- '** Builds the copy list and performs all installation operations.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB Install STATIC
-
- '// if we are installing over directory specified
- '// in WIN.INI - [OmniPage] - OP30=PreviousInstallPath$
- '// then remove line OP30=PreviousInstallPath$
- OldOP30Path$ = GetIniKeyString("WIN.INI", "OmniPage", "OP30" )
- IF ( UCASE$( OldOP30Path$ ) = UCASE$( DEST$ ) ) THEN
- RemoveIniKey "WIN.INI", "OmniPage", "OP30", cmoNone
- ENDIF
-
- '// get path to files waiting to be installed
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- '// create primary installation directory
- CreateDir DEST$, cmoNone
-
- '// create subdirectory within primary installation directory
- ScanDEST$ = MakePath( DEST$, "SCANNERS" )
- CreateDir ScanDEST$, cmoNone
-
- '// add files from "files" group ( in SETUP.LYT ) to copy list
- AddSectionFilesToCopyList "FILES", SrcDir$, DEST$
-
- '// add files from "scanners" group ( in SETUP.LYT ) to copy list
- AddSectionFilesToCopyList "SCANNERS", SrcDir$, ScanDEST$
-
- '// add files from "win_sys" group ( in SETUP.LYT ) to copy list
- WINSYS_DEST$ = GetWindowsDir()
- WINSYS_DEST$ = WINSYS_DEST$ + "SYSTEM"
- AddSectionFilesToCopyList "SYSTEM", SrcDir$, WINSYS_DEST$
-
- '// add files from "winfiles" group ( in SETUP.LYT ) to copy list
- WIN_DEST$ = GetWindowsDir()
- AddSectionFilesToCopyList "WINFILES", SrcDir$, WIN_DEST$
-
- '// create DATA subdirectory within primary installation directory
- '// add path designation to WIN.INI
- DataPATH$ = MakePath( DEST$, "DATA" )
- CreateDir DataPATH$, cmoNone
- CreateIniKeyValue "WIN.INI", "OmniPage", "DataPath", DataPATH$, cmoOverwrite
-
- '// create OLD_META subdirectory with primary installation directory
- '// move existing metafiles to there
- MetaPATH$ = MakePath( DEST$, "OLD_META" )
- CreateDir MetaPATH$, cmoNone
-
- '// add files from "data" group ( in SETUP.LYT ) to the copy list
- AddSectionFilesToCopyList "DATA", SrcDir$, DATAPATH$
-
-
- '// NEW STUFF for installing over existing directory
-
- '// copy old metafiles to backup directory
- i% = CopyFiles( DEST$ + "\*.MET", MetaPATH$ )
- i% = DeleteFiles( DEST$ + "\*.MET" )
-
- '// preserve existing dictionaries for use with Pro 5.0
- i% = RenameFiles( DEST$ + "\*.MD", DEST$ + "\*.NDX" )
- i% = DeleteFiles( DEST$ + "\*.MD" )
-
- '// move training files into subdir
- i% = CopyFiles( DEST$ + "\*.TRN", DATAPATH$ )
- i% = DeleteFiles( DEST$ + "\*.TRN" )
-
-
- '// move user dictionary files into subdir
- i% = CopyFiles( DEST$ + "\*.UD", DATAPATH$ )
- i% = DeleteFiles( DEST$ + "\*.UD" )
-
-
- '// move zone content files into subdir
- i% = CopyFiles( DEST$ + "\*.ZCN", DATAPATH$ )
- i% = DeleteFiles( DEST$ + "\*.ZCN" )
-
-
- '// zap most of the non-metafile stuff from previous installs
- i% = DeleteFiles( DEST$ + "\*.DLL" )
- i% = DeleteFiles( DEST$ + "\*.PLX" )
- i% = DeleteFiles( DEST$ + "\*.EXE" )
-
- '// copy files from install disks to specified installation directory
- CopyFilesInCopyList
-
- '// setup the program manager group with new progman items
- CreateProgmanGroup "Caere Applications", "", cmoNone
- ShowProgmanGroup "Caere Applications", 1, cmoNone
- CreateProgmanItem "Caere Applications", "OmniPage Professional", MakePath(DEST$, "omnipage.exe"), "", cmoOverwrite
- CreateProgmanItem "Caere Applications", "Image Assistant", MakePath(DEST$, "photop.exe"), "", cmoOverwrite
-
- '// write stuff out to INI file
- '// create path for INI file
- INI_PATH$ = MakePath( DataPATH$, "OMNIPAGE.INI" )
-
-
- '// perform registration process and write some info to OmniPage.INI
-
- '// create path for REG INFO file
- RegPATH$ = MakePath( DEST$, "WARRANTY.TXT" )
-
- '// perform the registration process
- '// this returns zero if cancelled, otherwise returns 1
- '// - if "print" is first argument, registration info is printed
- '// - if <filename> is first argument, registration info is sent to file
- reg_result% = GetRegistration( "print", DISK_SERIAL$ )
-
-
- '// initialize temporary flag for analyzing registration result
- REGCANCELERR% = 0
-
- '// exit this subroutine ::: IF ( reg_result% <> [success code] )
- IF ( reg_result% = 0 ) THEN
-
- '// make sure that we put up the proper dialog when quitting
- REGCANCELERR% = 1
-
- '// set error to normal termination
- ERROR STFQUIT
-
- '// no gotos allowed outside local scope !!!
-
- ELSE
-
- '// proceed with registration process
-
- '// initialize strings to be passed back by GetWarrantyInfo()
- user_name$ = " "
- comp_name$ = " "
- is_IEVersion$ = " "
-
- '// collect information from completed registration process
- GetWarrantyInfo user_name$, comp_name$, is_IEVersion$
-
- '// write info to win.ini file for associations to extensions
- ExtDEST$ = MakePath( DEST$, "omnipage.exe ^.met" )
- CreateIniKeyValue "WIN.INI", "Extensions", "met", ExtDEST$, cmoOverwrite
-
- '// write registration info out to OMNIPAGE.INI
- CreateIniKeyValue INI_PATH$, "Registration", "serial", DISK_SERIAL$, cmoOverwrite
- CreateIniKeyValue INI_PATH$, "Registration", "name", user_name$, cmoOverwrite
- CreateIniKeyValue INI_PATH$, "Registration", "company", comp_name$, cmoOverwrite
-
- '// if user registered as NON-US version set alternate ( NON-US )
- '// default dictionary and default page size within OMNIPAGE.INI
- IF ( MID$( is_IEVersion$,1,1 ) = "1" ) THEN
- CreateIniKeyValue INI_PATH$, "LOCALIZATIONSET", "MainDictionary", "ukeng.ndx", cmoOverwrite
- CreateIniKeyValue INI_PATH$, "LOCALIZATIONSET", "PageSize", "2", cmoOverwrite
- ENDIF
-
- ENDIF
-
- END SUB
-
-
-
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
-
-
- '**
- '** Purpose:
- '** Returns string resource with given ID# from MSCUISTF.DLL.
- '**
- '** Arguments:
- '** String resource ID#
- '**
- '** Returns:
- '** String associated with given resource ID#
- '**
- '*************************************************************************
- FUNCTION GetString (id%) STATIC AS STRING
- 'load up the library
- iInst% = LoadLibrary("MSCUISTF.DLL")
- IF iInst% < 22 THEN
- GOTO ENDGETSTRING
- ENDIF
-
- 'allocate space for the string
- TheString$ = STRING$(256, 32)
-
- 'get the string
- i% = LoadString(iInst%, id%, TheString$, 256)
-
- 'free the library
- FreeLibrary iInst%
-
- ENDGETSTRING:
- GetString = TheString$
- END FUNCTION
-
-
- '**
- '** Purpose:
- '** Check for necessary disk space required for installation of product.
- '**
- '** If overwriting existing installation,
- '** do nothing and return success code of ( 0 ).
- '**
- '** Otherwise, give an error dialog if there is insufficient free disk
- '** and return error of (-1).
- '**
- '** Arguments:
- '** NewPath$ : full path to user specified installation directory
- '**
- '** MinSpace& : minimum bytes necessary for installation of product
- '**
- '** Returns:
- '** 0 : if overwriting previous installation
- '** or there is MinSpace& free on drive specified in NewPath$
- '**
- '** (-1) : not overwriting previous installation and there is not
- '** MinSpace& free on drive specified in NewPath$
- '**
- '*************************************************************************
- FUNCTION NotEnoughDiskSpace( NewPath$, MinSpace& ) STATIC as INTEGER
-
- Result% = 0
-
- '// find previous install path, if any
- '// note: this line is specific to FaxMaster product
- OldPath$ = GetIniKeyString( "WIN.INI","BitFax","BitFaxPath" )
-
- '// remove ending slash from path if necessary
- if ( LEN( OldPath$ ) > 0 ) then
- if ( MID$( OldPath$, LEN( OldPath$ ),1 ) = "\" ) then
- OldPath$ = MID$( OldPath$,1,LEN( OldPath$ ) - 1 )
- endif
- endif
-
- '// remove ending slash from path if necessary
- if ( LEN( NewPath$ ) > 0 ) then
- if ( MID$( NewPath$, LEN( NewPath$ ),1 ) = "\" ) then
- NewPath$ = MID$( NewPath$,1,LEN( NewPath$ ) - 1 )
- endif
- endif
-
- '// if the install is NOT overwriting previous install
- '// of FaxMaster or OmniScan perform check for disk space
- if ( OldPath$ <> NewPath$ ) then
-
- '// grab the drive letter out of the install destination path
- install_drive$ = UCASE$( MID$( NewPath$,1,1 ))
- if ( install_drive$ < "A" ) or ( install_drive$ > "Z" ) then
- install_drive$ = "C"
- endif
-
- '// determine the amount of free space on install drive
- free_space& = GetFreeSpaceForDrive( install_drive$ )
-
- '// check to see if there is not sufficient
- '// available space to complete install
- if ( free_space& < MinSpace& ) then
-
- '// prepare messages for error dialog
- '// by grabbing strings out of MSCUISTF.DLL
-
- str1$ = GetString( 9000 )
- str1$ = str1$ + str$( MinSpace& /1000 )
- str1$ = str1$ + GetString( 9001 )
- str1$ = str1$ + INSTALLNAME
-
- str2$ = GetString( 9002 )
- str2$ = str2$ + STR$( free_space& / 1000 )
- str2$ = str2$ + GetString( 9003 )
- str2$ = str2$ + install_drive
- str2$ = str2$ + GetString( 9004 )
-
- str3$ = STR$( ( MinSpace& - free_space& ) / 1000 )
- str3$ = str3$ + GetString( 9005 )
- str3$ = str3$ + install_drive$
- str3$ = str3$ + GetString( 9006 )
-
- '// put up the dialog that tells user
- '// how to deal with not enough disk space
- i% = DoMsgBox( str1$ + str2$ + str3$, GetString( INSTALLSTR ), MB_OK )
-
- '// make sure that an error is returned by this function
- Result% = (-1)
-
- else
-
- '// make sure that NO error is returned by this function
- Result% = 0
-
- endif
- '// end check for sufficient disk space for install
-
- else
-
- '// make sure that NO error is returned by this function
- Result% = 0
-
- endif
- '// end check for installing to new directory ( not overwriting )
-
- ENDNotEnoughDiskSpace:
-
- NotEnoughDiskSpace = Result%
-
- END FUNCTION
-
-
-