home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-28 | 41.8 KB | 1,502 lines |
- '**************************************************************************
- '* HP ScanJet/DeskScan II v2.2 Setup
- '*
- '* (c) Copyright Hewlett-Packard Company, 1991-1995.
- '* All rights are reserved. Copying or other reproduction of
- '* this program except for archival purposes is prohibited
- '* without the prior written consent of Hewlett-Packard Company.
- '*
- '* RESTRICTED RIGHTS LEGEND
- '*
- '* Use, duplication, or disclosure by the Government is subject to
- '* restrictions as set forth in paragraph (b) (3) (B) of the Rights
- '* in Technical Data and Computer Software clause in DAR 7-104.9(a).
- '*
- '* HEWLETT-PACKARD COMPANY
- '* Greeley, Colorado
- '*
- '**************************************************************************
-
-
- ''$DEFINE DEBUG '' Define for script development/debugging
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'ds2util.inc'
- '$INCLUDE 'msdetect.inc'
-
-
- '' ********** CONSTANTS **********
-
- '' ***** Bitmap ID from DIALOGS.RC *****
-
- CONST LOGO = 1
-
- '' ***** Dialog ID's *****
-
- CONST WELCOME = 100
- CONST ASKQUIT = 200
- CONST DESTPATH = 300
- CONST EXITFAILURE = 400
- CONST EXITQUIT = 600
- CONST EXITSUCCESS = 700
- CONST OPTIONS = 800
- CONST APPHELP = 900
- CONST APPHELP1 = 901
- CONST APPHELP2 = 902
- CONST APPHELP3 = 903
- CONST APPHELP4 = 904
- CONST APPHELP5 = 905
- CONST APPHELP6 = 906
-
- CONST MODIFYCONFIG = 1010
- CONST MODIFYSYSTEMINI = 1020
- CONST INSERTREF = 1050
- CONST REMOVEHIPERF = 1060
- CONST HIPERFNAMES = 1070
- CONST MODIFYIICSYSTEMINI = 1080
-
- CONST GROUPLIST = 2000
- CONST CARDOPTIONS = 2010
- CONST ERRORSPACE = 2030
-
- CONST CHECK = 2500
-
- CONST CUSTINST = 6200
- CONST BADPATH = 6400
-
- CONST CDCONFIRMINFO = 7300
-
- CONST ERR_WINDOWSVERSION = 8000
- CONST ERR_WINDOWSMODE = 8001
- CONST ERR_CORRUPTSOURCES = 8002
- CONST ERR_DOSVERSION = 8003
-
- CONST STR_OPTIONALSCSICARD = 8100
- CONST STR_DIR = 8101
- CONST STR_PROGMANGROUP = 8102
- CONST STR_SCANNER = 8103
- CONST STR_INTERFACECARD = 8104
- CONST STR_SCSIADDRESS = 8105
- CONST STR_SCANNERTEST = 8106
- CONST STR_READMETXT = 8107
- CONST STR_SJPLUSCARD = 8108
- CONST STR_GROUPSTRING = 8109
- CONST STR_DESKSCAN = 8110
- CONST STR_HPSCREENCALIBRATION = 8111
- CONST STR_SETUP = 8112
- CONST STR_TITLE = 8113
- CONST STR_HPINTERFACECARD = 8114
- CONST STR_ABOUT1 = 8115
- CONST STR_ABOUT2 = 8116
- CONST STR_EISA = 8117
- CONST STR_MCA = 8118
- CONST STR_ISA = 8119
- CONST STR_NOTEPADEXE = 8120
- CONST STR_HPDSINI = 8121
-
-
-
- '' ***** GLOBALS *****
-
- GLOBAL ExtraCosts$ '' List of extra costs to add per drive.
- GLOBAL DestCost& '' Calc'd disk space required to install files
- GLOBAL WinCost& ''
- GLOBAL DestFree& '' Amount of free space on the destination disk
- GLOBAL WinFree& ''
-
- GLOBAL DriversList$
-
- GLOBAL ASPIFound%
- GLOBAL CAMFound%
-
- GLOBAL MajVer% '' Major version number (Windows or DOS)
- GLOBAL MinVer% '' Minor version number (Windows or DOS)
- GLOBAL WinMode%
-
- GLOBAL WinDir$ '' Windows directory.
- GLOBAL TwainDir$ '' Directory for the TWAIN Data Source.
-
- GLOBAL DEST$ '' Default destination directory.
- GLOBAL OptScanner(2) AS STRING '' Scanner installation option.
- GLOBAL ScannerPick$ '' Text for 'ScannerChoice'.
- GLOBAL ScannerChoice% '' 1 for ScanJet II or 3 family,
- '' 2 for ScanJet Plus,
- GLOBAL AskModSysIni% '' 1 if the SYSTEM.INI file should be mod'd
- GLOBAL ConfigFile$
-
- GLOBAL OPTSETUP$ '' Setup type option selection.
- GLOBAL OPTCard$ '' Option to use existing card.
- GLOBAL OPTCardText(3) AS STRING '' Text for selected card option.
- GLOBAL DEFAULTGROUP$ '' Default group name.
- GLOBAL GROUP$ '' Selected group name.
- GLOBAL SystemArchitecture$ '' Detected architecture.
- GLOBAL LISTMADE% '' True if group names list has been
- '' made, False otherwise.
- GLOBAL DS2Cui$
-
- ''GLOBAL MUSTREBOOT% '' 1 if CONFIG.SYS or SYSTEM.INI modified.
- '' '' 0 if neither file modified.
- ''GLOBAL MANUALMOD% '' 1 if user must modify SYSTEM.INI or
- '' '' CONFIG.SYS. 0 if not needed.
-
-
- '' ***** SUBROUTINES *****
-
- DECLARE SUB Install
- DECLARE SUB MyRemoveFiles
- DECLARE SUB CalcCopyCost
- DECLARE SUB MakeCopyList
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
-
-
- ''***************************************************************************
- ''*********** BEGINNING OF SCRIPT **********
- ''***************************************************************************
-
- INIT:
- dim dlg%
- errStr$ = STRING$(256,0)
- Setup$ = STRING$(128,0)
- DS2Cui$ = "ds2cui.dll" '' Custom UI stuff for DS2
- '' MUSTREBOOT% = 0
- '' MANUALMOD% = 0
-
-
- i% = AcquireString(STR_SETUP, Setup$, 128)
-
- About1$ = STRING$(256,0)
- i% = AcquireString(STR_ABOUT1, About1$, 256)
-
- About2$ = STRING$(128,0)
- i% = AcquireString(STR_ABOUT2, About2$, 128)
-
- SetAbout About1$, About2$
-
- About1$ = STRING$(0,0) '' release string's memory
- About2$ = STRING$(0,0)
-
-
- '' Verify DOS version: Must be DOS 5.0 or better...
-
- MajVer% = GetDOSMajorVersion()
- MinVer% = GetDOSMinorVersion()
-
- IF (MajVer% < 5) THEN
- i% = FAcquireString(ERR_DOSVERSION, errStr$, 256)
- i% = DoMsgBox(errStr$, Setup$, MB_TASKMODAL+MB_ICONHAND+MB_OK)
- dlg% = EXITFAILURE
- GOTO QUITL1
- END IF
-
-
- '' Verify Windows version and mode: Must be Windows 3.1 or better...
-
- MajVer% = GetWindowsMajorVersion()
- MinVer% = GetWindowsMinorVersion()
-
- IF (MajVer% < 3) OR ((MajVer% = 3) AND (MinVer% < 1)) THEN
- i% = FAcquireString(ERR_WINDOWSVERSION, errStr$, 256)
- i% = DoMsgBox(errStr$, Setup$, MB_TASKMODAL+MB_ICONHAND+MB_OK)
- dlg% = EXITFAILURE
- GOTO QUITL1
- END IF
-
- WinMode% = GetWindowsMode()
-
- IF WinMode% = 0 THEN
- i% = AcquireString(ERR_WINDOWSMODE, errStr$, 256)
- i% = DoMsgBox(errStr$, Setup$, MB_TASKMODAL+MB_ICONHAND+MB_OK)
- dlg% = EXITFAILURE
- GOTO QUITL1
- END IF
-
-
- '' Display main window frame maximized.
-
- dim hWnd%
- dim j%
-
- hWnd% = HwndFrame()
- j% = MoveWindow(hWnd%, 0, 0, GetScreenWidth(), GetScreenHeight(), 0)
-
-
- '' Create place holders for setup information that will be displayed
- '' in a "ConfirmInfo" dialog. One "AddListItem" is needed for each
- '' piece of data that will be displayed. The NULLs will be replaced
- '' based on information entered by the user.
-
- AddListItem "ConfirmTextIn", ""
- AddListItem "ConfirmTextIn", ""
- AddListItem "ConfirmTextIn", ""
- AddListItem "ConfirmTextIn", ""
- AddListItem "ConfirmTextIn", ""
- AddListItem "ConfirmTextIn", ""
-
-
- '' Initialize a bunch of variables and strings and stuff...
-
- OptScanner(0) = "ScanJet IIp, IIc, IIcx, 3p, 3c "
- '' OptScanner(0) = "ScanJet IIp, IIc, IIcx, 3p "
- OptScanner(1) = "ScanJet Plus "
- ScannerChoice% = 1 '' ScanJet II or 3 family
- ScannerPick$ = OptScanner(ScannerChoice% - 1)
-
- DriversList$ = "SJDrivers"
- SystemArchitecture$ = "ISA"
- SetSymbolValue "SystemArchitecture", SystemArchitecture$
-
- AddListItem DriversList$, "SJDRIVER.SYS"
- AddListItem DriversList$, "MINI400I.SYS"
- AddListItem DriversList$, "SJIIX.SYS"
- AddListItem DriversList$, "SJII.SYS"
-
- SetSymbolValue "SJIIDriverFound", "0" '' "1" if HP SCSI card found
- SetSymbolValue "RemingtonCardFound", "0" '' "1" if Remington is found
- SetSymbolValue "WIN31VxD", "WIN400I.386"
- SetSymbolValue "ScannerVxD", "HPSCANR.386"
- SetSymbolValue "InstalledCard", "0"
-
- WinDir$ = GetWindowsDir()
-
- SetSymbolValue "ConfigTemp", "C:\CONFIG.TMP"
- SetSymbolValue "AutoexecTemp", "C:\AUTOEXEC.TMP"
- SetSymbolValue "SysIniTemp", WinDir$+"SYSTEM.TMP"
- SetSymbolValue "SysIniThrowAwayFile", WinDir$+"SYSTEM.HP~"
-
- SetSymbolValue "ConfigBackup", "C:\CONFIG.HP"
- SetSymbolValue "AutoexecBackup","C:\AUTOEXEC.HP"
- SetSymbolValue "SysIniBackup", WinDir$+"SYSTEM.HP"
-
- HELPPROC$ = "FHelpDlgProc" '' Define Help procedures
- HELP1PROC$ = "FHelp1DlgProc"
- HELP2PROC$ = "FHelp2DlgProc"
- HELP3PROC$ = "FHelp3DlgProc"
- HELP4PROC$ = "FHelp4DlgProc"
- HELP5PROC$ = "FHelp5DlgProc"
- HELP6PROC$ = "FHelp6DlgProc"
-
-
- '' Set up the background bitmap and the window title...
-
- SetBitmap DS2Cui$, LOGO
- Title$ = STRING$(64,0)
- i% = AcquireString(STR_TITLE, Title$, 64)
- SetTitle Title$
- Title$ = STRING$(0,0)
-
-
- '' Handle the .INF file...
-
- szInf$ = STRING$(144,0)
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
-
- IF szInf$ = "" THEN '' Get the PATH for the .INF file...
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SCANJET.INF"
- END IF
-
- ReadInfFile szInf$ '' Read the .INF file..
- szInf$ = STRING$(0,0)
-
-
-
- '' Some more initialization stuff...
-
- groupStr$ = STRING$(64,0)
- i% = AcquireString(STR_GROUPSTRING, groupStr$, 64)
- DEFAULTGROUP$ = groupStr$
- GROUP$ = DEFAULTGROUP$
- groupStr$ = STRING$(0,0)
-
- LISTMADE% = 0
- OPTSETUP$ = "1"
- OPTCard$ = "1" '' HP SCSI card (Remington or Fred)
- SetSymbolValue "OPTCard", OPTCard$
-
- '' Initialize the Interface Card Name String array...
-
- cardStr$ = STRING$(256,0)
- i% = AcquireString(STR_HPINTERFACECARD, cardStr$, 256)
- OPTCardText(0) = cardStr$
- i% = AcquireString(STR_OPTIONALSCSICARD, cardStr$, 256)
- OPTCardText(1) = cardStr$
- i% = AcquireString(STR_SJPLUSCARD, cardStr$, 256)
- OPTCardText(2) = cardStr$
- cardStr$ = STRING$(0,0)
-
- ASPIFound% = 0
-
- DEST$ = "C:\DESKSCAN"
- TwainDir$ = WinDir$ + "TWAIN\"
- SetSymbolValue "InstallDir", DEST$
- SetSymbolValue "TwainDir", TwainDir$
-
- AddListItem "SettingsTextIn", DEST$
- AddListItem "SettingsTextIn", GROUP$
- AddListItem "SettingsTextIn", OPTCardText(0)
- AddListItem "SettingsTextIn", OptScanner(0)
-
- AddListItem "DiskSpaceData", MID$(DEST$, 1, 2)
- AddListItem "DiskSpaceData", ""
- AddListItem "DiskSpaceData", ""
- AddListItem "DiskSpaceData", MID$(WinDir$, 1, 2)
- AddListItem "DiskSpaceData", ""
- AddListItem "DiskSpaceData", ""
-
- DestCost& = 0
- WinCost& = 0
- DestFree& = 0
- WinFree& = 0
-
-
-
- WELCOME:
- '' **********************
- '' *** Welcome dialog ***
- '' **********************
- dim sz$ '' dynamic-length string
- sz$ = UIStartDlg(DS2Cui$, WELCOME, "FInfoDlgProc", APPHELP6, HELP6PROC$)
-
- IF sz$ = "CONTINUE" THEN '' Pressed the "Continue" button
- UIPop 1
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO WELCOME
-
- ELSE '' Pressed the "Exit" button
- '' UIPop 1
- GOSUB ASKQUIT
- GOTO WELCOME
- END IF
-
- IF IsItEISA = 1 THEN '' Get information about the system.
- SystemArchitecture$ = "EISA"
- EISAStr$ = STRING$(128,0)
- i% = AcquireString(STR_EISA, EISAStr$, 128)
- SetSymbolValue "SystemArchitecture", EISAStr$
- EISAStr$ = STRING$(0,0)
-
- ELSEIF IsItMCA = 2 THEN
- SystemArchitecture$ = "MCA"
- MCAStr$ = STRING$(128,0)
- i% = AcquireString(STR_MCA, MCAStr$, 128)
- SetSymbolValue "SystemArchitecture", MCAStr$
- MCAStr$ = STRING$(0,0)
-
- ELSE
- SystemArchitecture$ = "ISA"
- ISAStr$ = STRING$(128,0)
- i% = AcquireString(STR_ISA, ISAStr$, 128)
- SetSymbolValue "SystemArchitecture", ISAStr$
- ISAStr$ = STRING$(0,0)
- END IF
-
-
- ASPIFound% = FindASPI
- CAMFound% = FindCAM
-
-
-
-
- CHOOSESCANNER: '' Select which scanner(s) is/are being installed.
- ScannerPick$ = ""
- ScannerChoice% = 0
-
- CHOOSESCANNERL1: '' Is the scanner a ScanJet Plus or ScanJet II/3 family?
- '' ********************************
- '' *** Scanner Selection dialog ***
- '' ********************************
- sz$ = UIStartDlg(DS2Cui$, OPTIONS, "FRadioDlgProc", APPHELP1, HELP1PROC$)
- szChoice$ = GetSymbolValue("ButtonChecked")
-
-
- IF (szChoice$ = "1") THEN
- ScannerChoice% = 1 '' ScanJet II or 3 family Scanner
- IF (FCheckForRemington() <> 0) THEN
- SetSymbolValue "RemingtonCardFound", "1"
- SetSymbolValue "InstalledCard", "3"
- ELSE
- SetSymbolValue "InstalledCard", "4"
- ENDIF
- '' We decide in the ds2cui.c:ModifyConfig() routine whether the
- '' interface card is a Remington or Fred card and (i would think)
- '' set OPTCard$ accordingly (though I haven't found the code that
- '' does it yet--klb 940607).
-
- ELSE
- OPTCard$ = "3" '' ScanJet Plus Card
- ScannerChoice% = 2 '' ScanJet Plus Scanner
- SetSymbolValue "InstalledCard", "1"
- SetSymbolValue "OPTCard", OPTCard$
- ReplaceListItem "SettingsTextIn", 3, OPTCardText(2)
- ReplaceListItem "SettingsTextIn", 4, OptScanner(ScannerChoice% - 1)
- END IF
-
- ScannerPick$ = OptScanner(ScannerChoice% - 1)
-
- IF sz$ = "CONTINUE" THEN '' Pressed the "Continue" button
- UIPop 1
- MakeCopyList '' Build the default file copy list
- CalcCopyCost '' Compute req'd disk space
- GOTO OPTION
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CHOOSESCANNERL1
-
- ELSE '' Pressed the "Exit" button
- GOSUB ASKQUIT
- GOTO CHOOSESCANNER
- END IF
-
-
-
- OPTION: '' Installation Settings confirmation dialog
-
- OPTL1:
- '' ************************************
- '' *** Installation Settings dialog ***
- '' ************************************
- sz$ = UIStartDlg(DS2Cui$, CUSTINST, "FCustomOptDlgProc", APPHELP2, HELP2PROC$)
-
- OPTSETUP$ = GetSymbolValue("ButtonChecked")
- UIPop 1
-
- IF sz$ = "CONTINUE" THEN '' Pressed the 'Continue' button
- OPTSETUP$ = "1"
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO OPTL1
-
- ELSEIF sz$ = "CUSTOM" THEN '' Pressed the 'Modify' button
- OPTSETUP$ = "2"
-
- ELSE '' Pressed the 'Exit' button
- UIPop 1
- GOSUB ASKQUIT
- GOTO OPTION
- END IF
-
-
- CHECKDISKSPACE: '' for the quick path, we still need to check disk space
-
- IF (OPTSETUP$ = "1") THEN
- IF DestFree& < DestCost& THEN
- '' **************************************
- '' *** Insufficient Disk Space Dialog ***
- '' **************************************
- sz$ = UIStartDlg(DS2Cui$, ERRORSPACE, "FDiskErrorDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN '' Pressed the "Exit" button
- GOSUB ASKQUIT
- GOTO CHECKDISKSPACE
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CHECKDISKSPACE
-
- ELSE '' Pressed the "OK" button
- UIPop 2
- GOTO GETPATH
- END IF
-
- ELSE
- UIPop 1
- END IF
-
- GOTO STARTINSTALL
- END IF
-
-
-
- GETPATH:
- SetSymbolValue "EditTextIn", DEST$
- SetSymbolValue "EditFocus", "END"
-
- GETPATHL1:
- '' ***********************************************
- '' *** Installation Directory Selection dialog ***
- '' ***********************************************
- sz$ = UIStartDlg(DS2Cui$, DESTPATH, "FEditDlgProc", APPHELP3, HELP3PROC$)
- DEST$ = LTRIM$(RTRIM$(GetSymbolValue("EditTextOut")))
-
- SetSymbolValue "InstallDir", DEST$
-
- IF sz$ = "CONTINUE" THEN
- IF IsDirWritable(DEST$) = 0 THEN
- GOSUB BADPATH
- GOTO GETPATHL1
- END IF
- MakeCopyList '' disk or directory may have changed
- CalcCopyCost '' target disk may have changed
- GOTO TESTSPACE
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETPATHL1
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO OPTION
-
- ELSE
- UIPop 1
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF
-
-
-
-
- TESTSPACE:
- IF (DestFree& < DestCost&) THEN
- '' **************************************
- '' *** Insufficient Disk Space Dialog ***
- '' **************************************
- sz$ = UIStartDlg(DS2Cui$, ERRORSPACE, "FDiskErrorDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN '' Pressed the "Exit" button
- GOSUB ASKQUIT
- GOTO TESTSPACE
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO TESTSPACE
-
- ELSE '' Pressed the "OK" button
- UIPop 2
- GOTO GETPATH
- END IF
-
- ELSE
- UIPop 1 '' is this needed? klb 940615
- END IF
-
- '' If express setup and did the destination because of a disk space
- '' problem, then we need to go do the installation.
-
- IF OPTSETUP$ = "1" THEN
- GOTO STARTINSTALL
- END IF
-
-
-
- GETGROUPNAME:
- IF LISTMADE% = 0 THEN
- AddListItem "ListGroupsIn", DEFAULTGROUP$
- LISTMADE% = 1
- END IF
-
- SetSymbolValue "ListGroupsOut", DEFAULTGROUP$
-
- GETGROUPNAMEL1:
- '' *******************************************
- '' *** Select Program Manager Group dialog ***
- '' *******************************************
- sz$ = UIStartDlg(DS2Cui$, GROUPLIST, "FGroupsDlgProc", APPHELP4, HELP4PROC$)
-
- GROUP$ = GetSymbolValue("EditGroupOut")
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- GOTO CARDOPTION
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETGROUPNAMEL1
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO GETPATH
-
- ELSE
- UIPop 1
- GOSUB ASKQUIT
- GOTO GETGROUPNAME
- END IF
-
-
-
- CARDOPTION:
- IF (ScannerChoice% = 2) THEN '' ScanJet Plus == 2
- OPTCard$ = "3" '' ScanJet Plus interface card
- SetSymbolValue "InstalledCard", "1"
- SetSymbolValue "OPTCard", OPTCard$
- SetSymbolValue "RemingtonCardFound", "0"
- GOTO CONFIRMINFO '' already know the card so skip the dlg
- END IF
-
- SetSymbolValue "RadioDefault", OPTCard$
-
- CARDOPTIONL1:
- '' *********************************************
- '' *** Scanner Interface Card Options dialog ***
- '' *********************************************
- sz$ = UIStartDlg(DS2Cui$, CARDOPTIONS, "FCardOptDlgProc", APPHELP5, HELP5PROC$)
-
- OPTCard$ = GetSymbolValue("ButtonChecked")
-
- SetSymbolValue "OPTCard", OPTCard$
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- IF OPTCard$ = "1" THEN
- IF (FCheckForRemington() <> 0) THEN
- SetSymbolValue "InstalledCard", "3"
- SetSymbolValue "RemingtonCardFound", "1"
- ELSE
- SetSymbolValue "InstalledCard", "4"
- ENDIF
-
- ELSEIF OPTCard$ = "2" THEN
- SetSymbolValue "InstalledCard", "0"
- SetSymbolValue "RemingtonCardFound", "0"
- END IF
- GOTO CONFIRMINFO
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CARDOPTIONL1
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO GETGROUPNAME
-
- ELSE
- UIPop 1
- GOSUB ASKQUIT
- GOTO CARDOPTION
- END IF
-
-
-
- CONFIRMINFO:
- genericStr$ = STRING$(64,0)
- i% = AcquireString(STR_DIR, genericStr$, 64)
- ReplaceListItem "ConfirmTextIn", 1, genericStr$+": "+DEST$
-
- i% = AcquireString(STR_PROGMANGROUP, genericStr$, 64)
- ReplaceListItem "ConfirmTextIn", 2, genericStr$+": "+GROUP$
-
- i% = AcquireString(STR_SCANNER, genericStr$, 64)
- ReplaceListItem "ConfirmTextIn", 3, genericStr$+": "+ScannerPick$
-
- i% = AcquireString(STR_INTERFACECARD, genericStr$, 64)
- IF OPTCard = "1" THEN
- ReplaceListItem "ConfirmTextIn", 4, genericStr$+": "+OPTCardText(0)
-
- ELSEIF OPTCard = "2" THEN
- ReplaceListItem "ConfirmTextIn", 4, genericStr$+": "+OPTCardText(1)
-
- ELSEIF OPTCard = "3" THEN
- ReplaceListItem "ConfirmTextIn", 4, genericStr$+": "+OPTCardText(2)
-
- ELSE
- ReplaceListItem "ConfirmTextIn", 4, genericStr$+": "+OPTCardText(0)
- END IF
-
- genericStr$ = STRING$(0,0)
-
-
- '' *******************************
- '' *** Verify Settings dialogs ***
- '' *******************************
- sz$ = UIStartDlg(DS2Cui$, CDCONFIRMINFO, "FConfirmDlgProc", 0, "")
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- GOTO STARTINSTALL
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CONFIRMINFO
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO GETPATH
- END IF
-
-
-
- STARTINSTALL: '' Begin installation
- Install '' Call the installation control subroutine
-
-
-
- QUIT:
- ON ERROR GOTO ERRQUIT
- dlg% = 0
-
- IF ERR = 0 THEN
- '' IF AskModSysIni% = 0 THEN
- '' dlg% = EXITSUCCESS1 '' Don't tell them to reboot
- '' ELSE
- dlg% = EXITSUCCESS '' Tell them to reboot
- '' END IF
-
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
-
- ELSE
- dlg% = EXITFAILURE
- END IF
-
- QUITL1:
- '' *********************************************************************
- '' The dialog that's displayed depends on the value of dlg% set in QUIT:
- '' *********************************************************************
- sz$ = UIStartDlg(DS2Cui$, dlg%, "FInfo0DlgProc", 0, "")
-
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
-
- UIPop 1
-
-
-
- ALL_DONE: '' Check whether README.TXT got copied.
- '' If not, don't bother trying to show it.
- ReadmeTxtStr$ = STRING$(16,0)
- i% = AcquireString(STR_READMETXT, ReadmeTxtStr$, 16)
- i% = DoesFileExist(MakePath(DEST$, ReadmeTxtStr$), femExists)
-
- IF i% = 1 THEN
- NotePadExeStr$ = STRING$(16,0)
- i% = AcquireString(STR_NOTEPADEXE, NotePadExeStr$, 16)
- RUN NotePadExeStr$+" "+MakePath(DEST$, ReadmeTxtStr$), NOWAIT
- NotePadExeStr$ = STRING$(0,0)
- END IF
-
- ReadmeTxtStr$ = STRING$(0,0)
- errStr$ = STRING$(0,0)
-
- MyRemoveFiles '' Delete installer files not used by Bamm-Bamm.
-
- END '' This is an exit point for the script.
-
-
-
- ERRQUIT:
- i% = AcquireString(ERR_CORRUPTSOURCES, errStr$, 256)
- i% = DoMsgBox(errStr$, Setup$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
-
- errStr$ = STRING$(0,0)
-
- MyRemoveFiles '' Delete installer files not used by Bamm-Bamm.
-
- END '' This is an exit point for the script.
-
-
-
- BADPATH:
- '' **********************************************
- '' *** Unknown Path or Directory Error dialog ***
- '' **********************************************
- sz$ = UIStartDlg(DS2Cui$, BADPATH, "FInfo0DlgProc", 0, "")
-
- IF sz$ = "REACTIVATE" THEN
- GOTO BADPATH
-
- ELSE
- UIPop 1 '' Only one button--Pop the error alert
- END IF
-
- RETURN
-
-
-
- ASKQUIT:
- '' *******************************
- '' *** Incomplete Setup dialog ***
- '' *******************************
- sz$ = UIStartDlg(DS2Cui$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN '' Pressed the "Quit" button
- UIPopAll
- ERROR STFQUIT
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
-
- ELSE
- UIPop 1 '' Pressed the "Back" button--Pop the error alert
- END IF
-
- RETURN
-
- '' ****************************************
- '' ********** END OF MAIN SCRIPT **********
- '' ****************************************
-
-
-
- '*************************************************************************
- '** Subroutine: CalcCopyCost
- '** Purpose: Computes the amount of disk space needed to copy the files
- '** the files in the copy list.
- '** Arguments: none.
- '** Returns: none.
- '*************************************************************************
- SUB CalcCopyCost STATIC
-
- '' How much disk space will we need to copy all these files?
-
- CostPerDisk$ = "CostPerDisk"
- StillNeed& = GetCopyListCost(ExtraCosts$, CostPerDisk$,"")
- '' DestCost& = 1536000 '' 1.5 MB required to install Bamm-Bamm
- DestCost& = 0
- WinCost& = 0
- cost& = 0
-
- FOR i% = 1 to 26 STEP 1
- cost& = VAL(GetListItem(CostPerDisk$, i%))
-
- '$IFDEF DEBUG
- '' k% = DoMsgBox("drive ("+CHR$(i% + ASC("A")-1)+") cost ("+str$(cost&)+").", "Copy Costs", MB_TASKMODAL+MB_OK+MB_ICONINFORMATION)
- '$ENDIF
-
- NEXT i%
-
- DestDrive$ = MID$(DEST$, 1, 1)
- i% = ASC(ucase$(DestDrive$)) - ASC("A") + 1
- DestCost& = VAL(GetListItem(CostPerDisk$, i%))
-
- ReplaceListItem "DiskSpaceData", 1, " " + DestDrive$ + ":"
- ReplaceListItem "DiskSpaceData", 2, STR$(DestCost& / 1024) + " K"
- drive$ = MID$(DEST$, 1, 1)
- DestFree& = GetFreeSpaceForDrive(drive$)
-
- IF (DestFree& < 0) THEN
- DestFree& = 0
- END IF
-
- ReplaceListItem "DiskSpaceData", 3, STR$(DestFree& / 1024) + " K"
-
- WinDrive$ = MID$(WinDir$, 1, 1)
- ndrive% = ASC(ucase$(WinDrive$)) - ASC("A") + 1
- WinCost& = VAL(GetListItem(CostPerDisk$, ndrive%))
-
- '$IFDEF DEBUG
- '' i% = DoMsgBox("Windows drive ('"+str$(ndrive%)+"') index in list.", "Copy Costs", MB_TASKMODAL+MB_OK+MB_ICONINFORMATION)
- '$ENDIF
-
- ReplaceListItem "DiskSpaceData", 5, STR$(WinCost& / 1024) + " K"
-
- WinFree& = GetFreeSpaceForDrive(WinDrive$)
-
- IF (WinFree& < 0) THEN
- WinFree& = 0
- END IF
-
- ReplaceListItem "DiskSpaceData", 6, STR$(WinFree& / 1024) + " K"
-
- CostPerDisk$ = ""
-
- END SUB
-
-
-
- '*************************************************************************
- '** Subroutine: MakeCopyList
- '** Purpose: Builds the copy list.
- '** Arguments: none.
- '** Returns: none.
- '*************************************************************************
- SUB MakeCopyList STATIC
-
- ClearCopyList '' Start with a clean copy list
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR") '' Get our SOURCE directory
-
- '' Add all the files to the copy list that we copy in all cases...
-
- ''$IFDEF 1
- AddSectionFilesToCopyList "Setup Files", SrcDir$, DEST$
- AddSectionFilesToCopyList "Files", SrcDir$, DEST$
- AddSectionFilesToCopyList "Utility Files", SrcDir$, DEST$
- AddSectionFilesToCopyList "Windows", SrcDir$, WinDir$
- AddSectionFilesToCopyList "Windows:System", SrcDir$, WinDir$+"SYSTEM\"
- AddSectionFilesToCopyList "Windows:TWAIN", SrcDir$, TwainDir$
- ''$ENDIF
-
- '' Here's how to check for NT -- IF (IsItNT()) THEN ...
- '' Where should we put files on an NT system?
- '' How can we keep from installing DOS and Windows drivers on an NT system?
- '' Do any dialogs need to change for installation on an NT system?
- '' AddSectionFilesToCopyList "NT Files", SrcDir$, DEST$
-
- '' Add files that are specific to EISA or MCA backplane computers...
-
- IF SystemArchitecture$ = "EISA" THEN
-
- IF ScannerChoice% = 1 THEN '' ScanJet II or 3 family scanner...
- IF GetSymbolValue("RemingtonCardFound") = "1" THEN
- AddSectionFilesToCopyList "Remington Card EISA", SrcDir$, DEST$
- ELSE
- AddSectionFilesToCopyList "Fred Card EISA", SrcDir$, DEST$
- ENDIF
-
- ELSEIF ScannerChoice% = 2 THEN
- AddSectionFilesToCopyList "ScanJet Plus EISA", SrcDir$, DEST$
- END IF
-
- ELSEIF SystemArchitecture$ = "MCA" THEN
-
- IF ScannerChoice% = 1 THEN '' ScanJet II or 3 family scanner...
- IF GetSymbolValue("RemingtonCardFound") = "1" THEN
- AddSectionFilesToCopyList "Remington Card MCA", SrcDir$, DEST$
- ELSE
- AddSectionFilesToCopyList "Fred Card MCA", SrcDir$, DEST$
- ENDIF
-
- ELSEIF ScannerChoice% = 2 THEN
- AddSectionFilesToCopyList "ScanJet Plus MCA", SrcDir$, DEST$
- END IF
- END IF
-
-
- '' Add the driver files that match the type of interface card specified...
-
- IF ScannerChoice% = 1 THEN '' ScanJet II or 3 family scanner...
-
- IF GetSymbolValue("RemingtonCardFound") = "1" THEN
- AddSectionFilesToCopyList "Remington Card Utils", SrcDir$, DEST$
- AddSectionFilesToCopyList "Remington Card Drivers", SrcDir$, DEST$
- ELSE
- AddSectionFilesToCopyList "Fred Card Drivers", SrcDir$, DEST$
- ENDIF
-
- ELSEIF ScannerChoice% = 2 THEN
-
- AddSectionFilesToCopyList "ScanJet Plus Utils", SrcDir$, DEST$
- AddSectionFilesToCopyList "ScanJet Plus Drivers", SrcDir$, DEST$
- END IF
-
- END SUB
-
-
-
- '*************************************************************************
- '** Subroutine: Install
- '** Purpose: Performs all installation operations.
- '** Arguments: none.
- '** Returns: none.
- '** History:
- '** 940516 klb Added AcquireString() call for STR_NOTEPADEXE (local var
- '** is NotePadExeStr$).
- '** Changed hard-coded reference to "readme.txt" to result
- '** of AcquireString() on STR_READMETXT.
- '** Added label CONFIG:
- '** Commented out the CopyFile() immediately after CONFIG:.
- '** Replaced the UIPop 1 command in CONFIG: with a big
- '** IF/THEN/ELSE to treat the modification more intelligently.
- '** Commented out all the AUTOEXEC modify stuff because we're
- '** adding HPDS25.INI file support to the TWAIN stuff.
- '** Commented out all the old SYSTEM.INI code and replaced it
- '** wholesale with the SYSINI: block from the Kennel code.
- '** Commented out all the CONFIG.SYS modification stuff and
- '** replaced it wholesale with Kennel code (hope it works).
- '** Added UIPop1 to ELSE in GETREFDISKL1:.
- '** 940518 klb Added code to write the HPDS25.INI file.
- '** 940621 klb Deleted the line that was writing initialization info to
- '** the INI file -- this is wholly handled in WriteHPDSINI()
- '** now and shouldn't happen here.
- '** Added a CopyFile call so that the INI file created in the
- '** Windows directory is copied to the install directory. That
- '** way, if the INI file gets trashed in the Windows directory,
- '** the user can just copy the original from the install dir
- '** and, assuming that DeskScan hasn't been moved, life will
- '** once again be wonderful.]
- '** 940628 klb Third-party SCSI card (InstalledCard$ == 0) set ConfigFile$
- '** to the ScanJet Plus configuration file (!hwp1461.cfg)
- '** instead of the Fred file (!hwp2080.cfg). So, I changed the
- '** string to the correct file name.
- '**
- '*************************************************************************
- SUB Install STATIC
-
- CreateDir DEST$, cmoVital '' Create the destination directory...
-
- CopyFilesInCopyList '' Copy files from distrib disk to dest disk
-
- '' Create the Program Manager Group with the name specified by the user...
-
- CreateProgmanGroup GROUP$, "", cmoNone
- ShowProgmanGroup GROUP$, 1, cmoNone
-
-
- '' Create the Program Manager Group Icons...
-
- NameStr$ = STRING$(128,0)
- NotePadExeStr$ = STRING$(16,0)
-
- i% = AcquireString(STR_DESKSCAN, NameStr$, 128)
- CreateProgManItem GROUP$, NameStr$, MakePath(DEST$, "DESKSCAN.EXE"), "", cmoOverwrite
-
- i% = AcquireString(STR_SCSIADDRESS, NameStr$, 128)
- CreateProgManItem GROUP$, NameStr$, MakePath(DEST$, "SCSIADDR.EXE"), "", cmoOverwrite
-
- i% = AcquireString(STR_SCANNERTEST, NameStr$, 128)
- CreateProgManItem GROUP$, NameStr$, MakePath(DEST$, "SCANTEST.EXE"), "", cmoOverwrite
-
- i% = AcquireString(STR_READMETXT, NameStr$, 128)
- i% = AcquireString(STR_NOTEPADEXE, NotePadExeStr$, 16)
- CreateProgManItem GROUP$, NameStr$, NotePadExeStr$+" "+MakePath(DEST$, NameStr$), "", cmoOverwrite
-
- NotePadExeStr$ = STRING$(0,0)
- NameStr$ = STRING$(0,0)
-
-
- '' write our TWAIN data source .ini file...
-
- DSIniStr$ = STRING$(16,0)
- i% = AcquireString(STR_HPDSINI, DSIniStr$, 16)
- i% = WriteHPDSINI()
-
- '' Make a copy of the INI file in the install directory so recovery is easy
-
- CopyFile WinDir$+DSIniStr$, DEST$+"\"+DSIniStr$, cmoOverwrite, 0
- DSIniStr$ = STRING$(0,0)
-
- '' Make a copy of the TWAIN data source file into the install directory...
-
- CopyFile TWAINDir$+"HPDS22.DS", DEST$+"\HPDS22.DS", cmoOverwrite, 0
-
-
-
- CONFIG:
- AskModSysIni% = 0
-
- '' Make a temporary copy of the CONFIG.SYS. If we aren't told to modify
- '' the SYS file, we'll delete it and the user won't know it was there...
-
- CopyFile "C:\CONFIG.SYS", GetSymbolValue("ConfigBackup"), cmoOverwrite, 0
-
- '' ********************************
- '' *** Modify CONFIG.SYS dialog ***
- '' ********************************
-
- sz$ = UIStartDlg(DS2Cui$, MODIFYCONFIG, "FModifyConfigDlgProc", 0, "")
-
- IF (sz$ = "CONTINUE") THEN '' User wants us to mod CONFIG for them...
- UIPop 1 '' FModifyConfigDlgProc() updated 'ConfigTemp'...
- CopyFile GetSymbolValue("ConfigTemp"), "C:\CONFIG.SYS", cmoOverwrite,0
- RemoveFile GetSymbolValue("ConfigTemp"), cmoNone
- '' MUSTREBOOT% = 1
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CONFIG
-
- ELSE '' User wants us to leave CONFIG file alone...
- UIPop 1 '' CONFIG file not mod'd so delete the temp file...
- RemoveFile GetSymbolValue("ConfigBackup"), cmoNone
- '' MANUALMOD% = 1
- END IF
-
- ''
- '' The 'InstalledCard' symbol's values are defined in ds2cui.h.
- '' Since we "know" which card is being used, decide now whether the user
- '' may want us to modify their SYSTEM.INI file for them.
- ''
- InstalledCard$ = GetSymbolValue("InstalledCard")
-
- IF InstalledCard$="0" THEN '' No Card detected...
- AskModSysIni% = 1 '' Assume it'll be a Fred card eventually
-
- ELSEIF InstalledCard$="1" THEN '' ScanJet Plus card
- AskModSysIni% = 0
-
- ELSEIF InstalledCard$="2" THEN '' SJ Plus card in certain Gateway CPUs
- AskModSysIni% = 0
-
- ELSEIF InstalledCard$="3" THEN '' Remington SCSI card
- '' AskModSysIni% = 0
- AskModSysIni% = 1 '' Add EMMExclude line
-
- ELSEIF InstalledCard$="4" THEN '' Fred SCSI card
- AskModSysIni% = 1 '' Add high-performance drivers
-
- ELSEIF InstalledCard$="5" THEN '' 3rd-party SCSI card
- AskModSysIni% = 0
- END IF
-
-
-
-
- CHECKSYSINIFORHIPERF: '' Our high-performance drivers (VxDs) in SYSTEM.INI?
-
- CopyFile WinDir$+"SYSTEM.INI", GetSymbolValue("SysIniThrowAwayFile"), cmoOverwrite, 0
- i% = FCheckForHiPerfDrivers()
-
- '' Regardless of the outcome of the search, dispose of our temp file...
- RemoveFile GetSymbolValue("SysIniThrowAwayFile"), cmoNone
-
- IF i% = 0 THEN '' >0 means one or more of our VxDs were found
- GOTO SYSINI '' 0 means none of our VxDs were found
- END IF
-
- '' ****************************************************
- '' *** Remove Unused Drivers from SYSTEM.INI dialog ***
- '' ****************************************************
- sz$ = UIStartDlg(DS2Cui$, REMOVEHIPERF, "FRemoveHiPerfDlgProc", 0, "")
-
- IF sz$ = "CONTINUE" THEN '' Pressed the "Yes" button
- UIPop 1
- CopyFile WinDir$+"SYSTEM.INI", GetSymbolValue("SysIniBackup"), cmoOverwrite, 0
- i% = FRemoveHiPerfDrivers()
-
- IF i% = 0 THEN '' FRemoveHiPerfDrivers() failed...
- RemoveFile GetSymbolValue("SysIniBackup"), cmoNone
- '$IFDEF DEBUG
- i% = DoMsgBox("FRemoveHiPerDrivers() failed to remove VxDs!", "DEBUG", MB_OK+MB_TASKMODAL)
- '$ENDIF
-
- ELSE '' VxDs removed OK so save our changes...
- RemoveFile WinDir$+"SYSTEM.INI", cmoNone
- RenameFile GetSymbolValue("SysIniTemp"), "SYSTEM.INI"
- '' MUSTREBOOT% = 1
- ENDIF
-
- GOTO SYSINI '' in any event, go on...
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CHECKSYSINIFORHIPERF
-
- ELSEIF sz$ = "EXIT" THEN '' Pressed the "Exit" button
- UIPop 1
- GOSUB ASKQUIT2
- GOTO CHECKSYSINIFORHIPERF
-
- ELSEIF sz$ = "CANCEL" THEN '' Pressed the "No" button
- UIPop 1
- '' MANUALMOD% = 1
- GOTO MANUALSYSINI
-
- ELSE
- UIPop 1
- END IF
-
-
-
- MANUALSYSINI:
- '' ****************************************************
- '' *** Manually update SYSTEM.INI dialog ***
- '' ****************************************************
- sz$ = UIStartDlg(DS2Cui$, HIPERFNAMES, "FManualSysIniDlgProc", 0, "")
-
- '' Process the result of "FManualSysIniDlgProc"
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- GOTO SYSINI
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO CHECKSYSINIFORHIPERF
-
- ELSEIF sz$= "REACTIVATE" THEN
- GOTO MANUALSYSINI
-
- ELSE
- UIPop 1
- GOTO SYSINI
- END IF
-
-
-
-
- SYSINI:
- IF AskModSysIni% = 0 THEN '' gate the SYSTEM.INI mod dialog
- GOTO EISA_MCA_FILES
- END IF
-
- ''
- '' The 'InstalledCard' symbol's values are defined in ds2cui.h.
- ''
- InstalledCard$ = GetSymbolValue("InstalledCard")
-
-
- '' ********************************
- '' *** Modify SYSTEM.INI dialog ***
- '' ********************************
- IF InstalledCard$ = "3" THEN '' Remington SCSI Card
- sz$ = UIStartDlg(DS2Cui$, MODIFYIICSYSTEMINI, "FYesNoDlgProc", 0, "")
- ELSE '' Fred SCSI Card
- sz$ = UIStartDlg(DS2Cui$, MODIFYSYSTEMINI, "FYesNoDlgProc", 0, "")
- END IF
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- '' MUSTREBOOT% = 1
- CopyFile WinDir$+"SYSTEM.INI", GetSymbolValue("SysIniBackup"), cmoOverwrite,0
- i% = ModifySysIni()
-
- IF i% <> 0 THEN '' only if ModifySysIni() suceeds...
- RemoveFile WinDir$+"SYSTEM.INI", cmoNone
- RenameFile GetSymbolValue("SysIniTemp"), "SYSTEM.INI"
-
- ELSE
- RemoveFile GetSymbolValue("SysIniTemp"), cmoNone
- END IF
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO SYSINI
-
- ELSE
- UIPop 1
- '' MANUALMOD% = 1
- END IF
-
-
- EISA_MCA_FILES:
- ''
- '' The 'InstalledCard' symbol's values are defined in ds2cui.h.
- ''
- InstalledCard$ = GetSymbolValue("InstalledCard")
-
- IF InstalledCard$ = "5" THEN '' 3rd party SCSI
- GOTO DONE
- ENDIF
-
- IF (SystemArchitecture$ = "MCA") THEN
- IF InstalledCard$ = "0" THEN '' No card found, assume Fred card
- ConfigFile$ = "@631f.adf"
-
- ELSEIF InstalledCard$ = "1" THEN '' ScanJet Plus card
- ConfigFile$ = "@601f.adf"
-
- ELSEIF InstalledCard$ = "2" THEN '' ScanJet Plus card in some Gateways
- ConfigFile$ = "@601f.adf"
-
- ELSEIF InstalledCard$ = "3" THEN '' Remington SCSI card
- ConfigFile$ = "@621f.adf"
-
- ELSEIF InstalledCard$ = "4" THEN '' Fred SCSI card
- ConfigFile$ = "@631f.adf"
- END IF
-
- '' GOTO DONE '' Don't ask for EISA Reference Disk
-
- ELSEIF (SystemArchitecture$ = "EISA") THEN
- IF InstalledCard$ = "0" THEN '' No card found, assume Fred card
- ConfigFile$ = "!hwp2080.cfg"
-
- ELSEIF InstalledCard$ = "1" THEN '' ScanJet Plus card
- ConfigFile$ = "!hwp1461.cfg"
-
- ELSEIF InstalledCard$ = "2" THEN '' ScanJet Plus card in some Gateways
- ConfigFile$ = "!hwp1461.cfg"
-
- ELSEIF InstalledCard$ = "3" THEN '' Remington SCSI card
- ConfigFile$ = "!hwp2002.cfg"
-
- ELSEIF InstalledCard$ = "4" THEN '' Fred SCSI card
- ConfigFile$ = "!hwp2080.cfg"
- END IF
-
- GOTO GETREFDISK
-
- ELSE '' System Architecture is "ISA"
- GOTO DONE
- ENDIF
-
-
-
- GETREFDISK:
- SetSymbolValue "EditTextIn", "A:\"
- SetSymbolValue "EditFocus", "END"
-
- GETREFDISKL1:
- '' ************************************
- '' *** Backup Reference Disk dialog ***
- '' ************************************
- sz$ = UIStartDlg(DS2Cui$, INSERTREF, "FRefDiskDlgProc", 0, "")
- refDisk$ = GetSymbolValue("EditTextOut")
- tStr$ = refDisk$
-
- IF (MID$(refDisk$,LEN(refDisk$)) <> "\") THEN
- refDisk$ = tStr$ + "\"
- END IF
-
- IF (sz$ = "CONTINUE") THEN
- UIPop 1
-
- IF (IsDirWritable(refDisk$) = 0) THEN
- GOSUB BADPATH
- GOTO GETREFDISKL1
- END IF
-
- CopyFile MakePath(DEST$,ConfigFile$), MakePath(refDisk$,ConfigFile$), cmoNone, 0
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETREFDISKL1
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO DONE
-
- ELSE
- UIPop 1
- GOSUB ASKQUIT2
- GOTO GETREFDISK
- END IF
-
- GOTO DONE
-
-
-
- BADPATH:
- '' ****************************************
- '' *** Unknown Path or Directory dialog ***
- '' ****************************************
- sz$ = UIStartDlg(DS2Cui$, BADPATH, "FInfo0DlgProc", 0, "")
-
- IF sz$ = "REACTIVATE" THEN
- GOTO BADPATH
- END IF
-
- UIPop 1
- RETURN
-
-
-
- ASKQUIT2:
- '' *******************************
- '' *** Incomplete Setup dialog ***
- '' *******************************
- sz$ = UIStartDlg(DS2Cui$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT2
-
- ELSE
- UIPop 1
- END IF
-
- RETURN
-
-
-
- DONE:
- END SUB
-
-
-
- '*************************************************************************
- '** Subroutine: MakePath
- '** 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
-
-
-
-
- '*************************************************************************
- '** Subroutine: MyRemoveFiles
- '** Purpose: Deletes any files from the destination disk that are
- '** used by the Installer but not by the scanning software.
- '** Arguments: none.
- '** Returns: none.
- '** History: 940427 klb Created.
- '*************************************************************************
- SUB MyRemoveFiles STATIC
-
- oldcursor% = ShowWaitCursor()
-
- IF (DoesFileExist(MakePath(DEST$, "scanjet.inf"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "scanjet.inf"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "scanjet.mst"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "scanjet.mst"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "ddeml.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "ddeml.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "_mstest.exe"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "_mstest.exe"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "ds2cui.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "ds2cui.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "ds2util.inc"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "ds2util.inc"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "ds2util.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "ds2util.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "setup.exe"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "setup.exe"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "setup.lst"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "setup.lst"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "setupapi.inc"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "setupapi.inc"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "mscomstf.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "mscomstf.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "msdetect.inc"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "msdetect.inc"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "msdetstf.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "msdetstf.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "msinsstf.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "msinsstf.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "msshlstf.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "msshlstf.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "msuilstf.dll"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "msuilstf.dll"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(DEST$, "expand.exe"), femExists) = 1) THEN
- RemoveFile MakePath(DEST$, "expand.exe"), cmoForce
- END IF
-
- IF (DoesFileExist(MakePath(TwainDir$, "hpdsii.ds"), femExists) = 1) THEN
- RenameFile MakePath(TwainDir$, "hpdsii.ds"), "hpdsii.old"
- END IF
-
- IF (DoesFileExist(MakePath(TwainDir$, "hpds21.ds"), femExists) = 1) THEN
- RenameFile MakePath(TwainDir$, "hpds21.ds"), "hpds21.old"
- END IF
-
- RestoreCursor oldcursor
-
- END SUB
-