home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 November / VPR9611B.ISO / driver / hp / win31 / copy10n / scanjet.ms_ / scanjet.ms
Text File  |  1994-12-19  |  46KB  |  1,606 lines

  1. '**************************************************************************
  2. '*                    HP ScanJet/DeskScan II v2.1 Setup
  3. '*
  4. '* (c) Copyright Hewlett-Packard Company, 1991-1994.
  5. '* All rights are reserved. Copying or other reproduction of
  6. '* this program except for archival purposes is prohibited
  7. '* without the prior written consent of Hewlett-Packard Company.
  8. '*
  9. '*                   RESTRICTED RIGHTS LEGEND
  10. '*
  11. '* Use, duplication, or disclosure by the Government is subject to 
  12. '* restrictions as set forth in paragraph (b) (3) (B) of the Rights 
  13. '* in Technical Data and Computer Software clause in DAR 7-104.9(a).
  14. '*
  15. '* HEWLETT-PACKARD COMPANY
  16. '* Greeley, Colorado
  17. '*
  18. '**************************************************************************
  19.  
  20. '' #########################################
  21. '' Modified for the Japanese NEC System
  22. '' #########################################
  23.  
  24.  
  25. ''$DEFINE DEBUG                      '' Define for script development/debugging
  26.  
  27. '$INCLUDE 'setupapi.inc'
  28. '$INCLUDE 'ds2util.inc'
  29. '$INCLUDE 'msdetect.inc'
  30.  
  31.  
  32. '' ********** CONSTANTS **********
  33.  
  34. '' ***** Bitmap ID from DIALOGS.RC *****
  35.  
  36. CONST LOGO                             = 1
  37.  
  38. '' ***** Dialog ID's *****
  39.  
  40. CONST WELCOME                        = 100
  41. CONST ASKQUIT                        = 200
  42. CONST DESTPATH                        = 300
  43. CONST EXITFAILURE                    = 400
  44. CONST EXITQUIT                        = 600
  45. CONST EXITSUCCESS                    = 700
  46. CONST OPTIONS                        = 800
  47. CONST APPHELP                        = 900
  48. CONST APPHELP1                        = 901
  49. CONST APPHELP2                        = 902
  50. CONST APPHELP3                        = 903
  51. CONST APPHELP4                        = 904
  52. CONST APPHELP5                        = 905
  53. CONST APPHELP6                        = 906
  54. CONST LICENSE                        = 907
  55.  
  56. CONST MODIFYCONFIG                = 1010
  57. CONST MODIFYSYSTEMINI            = 1020
  58. CONST INSERTREF                    = 1050
  59. CONST REMOVEHIPERF                = 1060
  60. CONST HIPERFNAMES                    = 1070
  61. CONST MODIFYIICSYSTEMINI        = 1080
  62.  
  63. CONST GROUPLIST                    = 2000
  64. CONST CARDOPTIONS                    = 2010
  65. CONST ERRORSPACE                    = 2030
  66.  
  67. CONST CHECK                            = 2500
  68.  
  69. CONST CUSTINST                        = 6200
  70. CONST BADPATH                        = 6400
  71.  
  72. CONST CDCONFIRMINFO                = 7300
  73.  
  74. CONST ERR_WINDOWSVERSION        = 8000
  75. CONST ERR_WINDOWSMODE            = 8001
  76. CONST ERR_CORRUPTSOURCES        = 8002
  77. CONST ERR_DOSVERSION                = 8003
  78.  
  79. CONST STR_OPTIONALSCSICARD        = 8100
  80. CONST STR_DIR                        = 8101
  81. CONST STR_PROGMANGROUP            = 8102
  82. CONST STR_SCANNER                    = 8103
  83. CONST STR_INTERFACECARD            = 8104
  84. CONST STR_SCSIADDRESS            = 8105
  85. CONST STR_SCANNERTEST            = 8106
  86. CONST STR_READMETXT                 = 8107
  87. CONST STR_SJPLUSCARD                = 8108
  88. CONST STR_GROUPSTRING            = 8109
  89. CONST STR_DESKSCAN             = 8110
  90. CONST STR_HPSCREENCALIBRATION = 8111
  91. CONST STR_SETUP                = 8112
  92. CONST STR_TITLE                = 8113
  93. CONST STR_HPINTERFACECARD      = 8114
  94. CONST STR_ABOUT1               = 8115
  95. CONST STR_ABOUT2               = 8116
  96. CONST STR_EISA                 = 8117
  97. CONST STR_MCA                  = 8118
  98. CONST STR_ISA                  = 8119
  99. CONST STR_NOTEPADEXE           = 8120
  100. CONST STR_HPDSINI                    = 8121
  101. CONST STR_LICENSETXT             = 8123
  102. CONST STR_DSGROUPSTRING     = 8124
  103.  
  104.  
  105. '' ***** GLOBALS *****
  106.  
  107. GLOBAL ExtraCosts$                '' List of extra costs to add per drive.
  108. GLOBAL DestCost&                    '' Calc'd disk space required to install files
  109. GLOBAL WinCost&                    '' 
  110. GLOBAL DestFree&                    '' Amount of free space on the destination disk
  111. GLOBAL WinFree&                    '' 
  112.  
  113. GLOBAL DriversList$
  114. GLOBAL szDrives$
  115. GLOBAL szDeskScan$
  116.  
  117. GLOBAL ASPIFound%
  118. GLOBAL CAMFound%
  119.  
  120. GLOBAL MajVer%                            '' Major version number (Windows or DOS)
  121. GLOBAL MinVer%                            '' Minor version number (Windows or DOS)
  122. GLOBAL WinMode%
  123.  
  124. GLOBAL WinDir$                            '' Windows directory.
  125. ''GLOBAL TwainDir$                        '' Directory for the TWAIN Data Source.
  126.  
  127. GLOBAL DEST$                            '' Default destination directory.
  128. GLOBAL OptScanner(2) AS STRING    '' Scanner installation option.
  129. GLOBAL ScannerPick$                    '' Text for 'ScannerChoice'.
  130. GLOBAL ScannerChoice%                '' 1 for ScanJet II or 3 family,
  131.                                              '' 2 for ScanJet Plus,
  132. GLOBAL AskModSysIni%                    '' 1 if the SYSTEM.INI file should be mod'd
  133. GLOBAL ConfigFile$
  134.  
  135. GLOBAL OPTSETUP$                        '' Setup type option selection.
  136. GLOBAL OPTCard$                        '' Option to use existing card.
  137. GLOBAL OPTCardText(3) AS STRING    '' Text for selected card option.
  138. GLOBAL DEFAULTGROUP$                    '' Default group name.
  139. GLOBAL GROUP$                            '' Selected group name.
  140. GLOBAL SystemArchitecture$            '' Detected architecture.
  141. GLOBAL LISTMADE%                        '' True if group names list has been
  142.                                             '' made, False otherwise.
  143. GLOBAL DS2Cui$
  144.  
  145. ''GLOBAL MUSTREBOOT%                    '' 1 if CONFIG.SYS or SYSTEM.INI modified.
  146. ''                                            '' 0 if neither file modified.
  147. ''GLOBAL MANUALMOD%                        '' 1 if user must modify SYSTEM.INI or
  148. ''                                            '' CONFIG.SYS.  0 if not needed.
  149.  
  150.  
  151. '' ***** SUBROUTINES *****
  152.  
  153. DECLARE SUB Install
  154. DECLARE SUB MyRemoveFiles
  155. DECLARE SUB CalcCopyCost
  156. DECLARE SUB MakeCopyList
  157. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  158.  
  159.  
  160. ''***************************************************************************
  161. ''***********                 BEGINNING OF SCRIPT                  **********
  162. ''***************************************************************************
  163.  
  164. INIT:
  165.     dim dlg%
  166.     errStr$     = STRING$(256,0)
  167.     Setup$      = STRING$(128,0)
  168.     DS2Cui$     = "ds2cui.dll"        '' Custom UI stuff for DS2
  169. ''    MUSTREBOOT% = 0
  170. ''    MANUALMOD%  = 0
  171.  
  172.  
  173.     i% = AcquireString(STR_SETUP, Setup$, 128)
  174.  
  175.     About1$ = STRING$(256,0)
  176.     i% = AcquireString(STR_ABOUT1, About1$, 256)
  177.  
  178.     About2$ = STRING$(128,0)
  179.     i% = AcquireString(STR_ABOUT2, About2$, 128)
  180.  
  181.     SetAbout About1$, About2$
  182.  
  183.     About1$ = STRING$(0,0)                    '' release string's memory
  184.     About2$ = STRING$(0,0)
  185.     
  186.  
  187.     ''    Verify DOS version:  Must be DOS 5.0 or better...
  188.  
  189.     MajVer% = GetDOSMajorVersion()
  190.     MinVer% = GetDOSMinorVersion()
  191.  
  192.     IF (MajVer% < 5) THEN
  193.         i%   = FAcquireString(ERR_DOSVERSION, errStr$, 256)
  194.         i%   = DoMsgBox(errStr$, Setup$, MB_TASKMODAL+MB_ICONHAND+MB_OK)
  195.         dlg% = EXITFAILURE
  196.         GOTO QUITL1
  197.     END IF
  198.  
  199.  
  200.     ''    Verify Windows version and mode:  Must be Windows 3.1 or better...
  201.  
  202.     MajVer% = GetWindowsMajorVersion()
  203.     MinVer% = GetWindowsMinorVersion()
  204.  
  205.     IF (MajVer% < 3) OR ((MajVer% = 3) AND (MinVer% < 1)) THEN
  206.         i%   = FAcquireString(ERR_WINDOWSVERSION, errStr$, 256)
  207.         i%   = DoMsgBox(errStr$, Setup$, MB_TASKMODAL+MB_ICONHAND+MB_OK)
  208.         dlg% = EXITFAILURE
  209.         GOTO QUITL1
  210.     END IF
  211.  
  212.     WinMode% = GetWindowsMode()
  213.  
  214.     IF WinMode% = 0 THEN
  215.         i%   = AcquireString(ERR_WINDOWSMODE, errStr$, 256)
  216.         i%   = DoMsgBox(errStr$,  Setup$, MB_TASKMODAL+MB_ICONHAND+MB_OK)
  217.         dlg% = EXITFAILURE
  218.         GOTO QUITL1
  219.     END IF
  220.  
  221.  
  222.     ''    Display main window frame maximized.
  223.  
  224.     dim hWnd%
  225.     dim j%
  226.  
  227.     hWnd% = HwndFrame()
  228.     j%    = MoveWindow(hWnd%, 0, 0, GetScreenWidth(), GetScreenHeight(), 0) 
  229.  
  230.  
  231.     ''    Create place holders for setup information that will be displayed
  232.     ''    in a "ConfirmInfo" dialog.  One "AddListItem" is needed for each
  233.     ''    piece of data that will be displayed.  The NULLs will be replaced
  234.     ''    based on information entered by the user.
  235.  
  236.     AddListItem "ConfirmTextIn", ""
  237.     AddListItem "ConfirmTextIn", ""
  238.     AddListItem "ConfirmTextIn", ""
  239.     AddListItem "ConfirmTextIn", ""
  240.     AddListItem "ConfirmTextIn", ""
  241.     AddListItem "ConfirmTextIn", ""
  242.  
  243.  
  244.     '' Initialize a bunch of variables and strings and stuff...
  245.  
  246.     OptScanner(0)  = "ScanJet IIp, IIc, IIcx, 3p, 3c "
  247. ''    OptScanner(0)  = "ScanJet IIp, IIc, IIcx, 3p "
  248.     OptScanner(1)  = "ScanJet Plus "
  249.     ScannerChoice% = 1                '' ScanJet II or 3 family
  250.     ScannerPick$   = OptScanner(ScannerChoice% - 1)
  251.     
  252.     DriversList$        = "SJDrivers"
  253.     SystemArchitecture$ = "ISA"
  254.     SetSymbolValue "SystemArchitecture", SystemArchitecture$
  255.  
  256.     AddListItem DriversList$, "SJDRIVER.SYS"    
  257.     AddListItem DriversList$, "MINI400I.SYS"    
  258.     AddListItem DriversList$, "SJIIX.SYS"    
  259.     AddListItem DriversList$, "SJII.SYS"
  260.  
  261.     SetSymbolValue "SJIIDriverFound",    "0"    '' "1" if HP SCSI card found
  262.     SetSymbolValue "RemingtonCardFound", "0"    '' "1" if Remington is found
  263.     SetSymbolValue "WIN31VxD",           "WIN400I.386"
  264.     SetSymbolValue "ScannerVxD",         "HPSCANR.386"
  265.     SetSymbolValue "InstalledCard",      "0"
  266.     
  267.     WinDir$ = GetWindowsDir()
  268.  
  269.     SetSymbolValue "ConfigTemp",    "A:\CONFIG.TMP"    
  270.     SetSymbolValue "AutoexecTemp",  "A:\AUTOEXEC.TMP"
  271.     SetSymbolValue "SysIniTemp",    WinDir$+"SYSTEM.TMP"    
  272.     SetSymbolValue "SysIniThrowAwayFile", WinDir$+"SYSTEM.HP~"
  273.     
  274.     SetSymbolValue "ConfigBackup",  "A:\CONFIG.HP"    
  275.     SetSymbolValue "AutoexecBackup","A:\AUTOEXEC.HP"    
  276.     SetSymbolValue "SysIniBackup",  WinDir$+"SYSTEM.HP"    
  277.  
  278.     HELPPROC$  = "FHelpDlgProc"    '' Define Help procedures
  279.     HELP1PROC$ = "FHelp1DlgProc"
  280.     HELP2PROC$ = "FHelp2DlgProc"
  281.     HELP3PROC$ = "FHelp3DlgProc"
  282.     HELP4PROC$ = "FHelp4DlgProc"
  283.     HELP5PROC$ = "FHelp5DlgProc"
  284.     HELP6PROC$ = "FHelp6DlgProc"
  285.  
  286.  
  287.     '' Set up the background bitmap and the window title...
  288.  
  289.     SetBitmap DS2Cui$, LOGO
  290.     Title$ = STRING$(64,0)
  291.     i%     = AcquireString(STR_TITLE, Title$, 64)
  292.     SetTitle Title$
  293.     Title$ = STRING$(0,0)
  294.  
  295.  
  296.     ''    Handle the .INF file...
  297.  
  298.     szInf$ = STRING$(144,0)
  299.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  300.  
  301.     IF szInf$ = "" THEN                '' Get the PATH for the .INF file...
  302.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SCANJET.INF"
  303.     END IF
  304.  
  305.     ReadInfFile szInf$                '' Read the .INF file..
  306.     szInf$ = STRING$(0,0)
  307.  
  308.  
  309.  
  310.     '' Some more initialization stuff...
  311.     LISTMADE% = 0
  312.     OPTSETUP$ = "1"
  313.     OPTCard$  = "1"                    '' HP SCSI card (Remington or Fred)
  314.     SetSymbolValue "OPTCard", OPTCard$
  315.  
  316.     '' Initialize the Interface Card Name String array...
  317.  
  318.     cardStr$       = STRING$(256,0)
  319.     i% = AcquireString(STR_HPINTERFACECARD, cardStr$, 256)
  320.     OPTCardText(0) = cardStr$
  321.     i% = AcquireString(STR_OPTIONALSCSICARD, cardStr$, 256)
  322.     OPTCardText(1) = cardStr$
  323.     i% = AcquireString(STR_SJPLUSCARD, cardStr$, 256)
  324.     OPTCardText(2) = cardStr$
  325.     cardStr$       = STRING$(0,0)
  326.  
  327.     ASPIFound% = 0
  328.  
  329.     groupStr$     = STRING$(64,0)
  330.  
  331.     szDrives$ = STRING$(128,0)
  332.     szDeskScan$ = STRING$(128,0)
  333.  
  334.     szDrives$ = "LocalDrives"
  335.     SetSymbolValue szDrives$, ""
  336.     GetLocalHardDrivesList szDrives$
  337.     NumberOfDrives% = GetListLength( szDrives$ )
  338.  
  339.     FOR j%= 1 TO NumberOfDrives%
  340.         szDeskScan$ = FindFileInTree( "DESKSCAN.EXE", GetListItem( szDrives$, j% )+":\" )
  341.         
  342.         IF LEN(szDeskScan$) > 10 THEN
  343.             DEST$  = MID$( szDeskScan$, 1, LEN(szDeskScan$) - 13 )
  344.             i% = AcquireString(STR_DSGROUPSTRING, groupStr$, 64)
  345.             GOTO DEFAULTDIRDONE
  346.         END IF
  347.     NEXT
  348.  
  349.     DEST$  = "A:\HPCOPY"    
  350.     i%            = AcquireString(STR_GROUPSTRING, groupStr$, 64)
  351.  
  352. DEFAULTDIRDONE:
  353.     DEFAULTGROUP$ = groupStr$
  354.     GROUP$        = DEFAULTGROUP$
  355.     groupStr$     = STRING$(0,0)
  356.     szDrives$     = STRING$(0,0)
  357.     szDeskScan$   = STRING$(0,0)
  358.     
  359.  
  360. ''    DEST$     = "A:\DESKSCAN"
  361. ''    TwainDir$ = WinDir$ + "TWAIN\"  
  362.     SetSymbolValue "InstallDir", DEST$
  363. ''    SetSymbolValue "TwainDir",   TwainDir$
  364.  
  365.     AddListItem "SettingsTextIn", DEST$
  366.     AddListItem "SettingsTextIn", GROUP$
  367.     AddListItem "SettingsTextIn", OPTCardText(0)
  368.     AddListItem "SettingsTextIn", OptScanner(0)
  369.  
  370.     AddListItem "DiskSpaceData", MID$(DEST$, 1, 2)
  371.     AddListItem "DiskSpaceData", ""
  372.     AddListItem "DiskSpaceData", ""
  373.     AddListItem "DiskSpaceData", MID$(WinDir$, 1, 2)
  374.     AddListItem "DiskSpaceData", ""
  375.     AddListItem "DiskSpaceData", ""
  376.  
  377.     DestCost& = 0
  378.     WinCost&  = 0
  379.     DestFree& = 0
  380.     WinFree&  = 0
  381.  
  382.  
  383.  
  384. WELCOME:
  385.     '' **********************
  386.     '' *** Welcome dialog ***
  387.     '' **********************
  388.     dim sz$                                '' dynamic-length string
  389.     sz$ = UIStartDlg(DS2Cui$, WELCOME, "FInfoDlgProc", APPHELP6, HELP6PROC$)
  390.  
  391.     IF sz$ = "CONTINUE" THEN        '' Pressed the "Continue" button
  392.         UIPop 1
  393.  
  394.     ELSEIF sz$ = "REACTIVATE" THEN
  395.         GOTO WELCOME
  396.  
  397.     ELSE                                    '' Pressed the "Exit" button
  398. ''        UIPop 1
  399.         GOSUB ASKQUIT
  400.         GOTO WELCOME
  401.     END IF
  402.  
  403.  
  404. LICENSE:
  405.     '' **********************
  406.     '' *** License dialog ***
  407.     '' **********************
  408.     sz$ = UIStartDlg(DS2Cui$, LICENSE, "FInfoDlgProc", APPHELP6, HELP6PROC$)
  409.  
  410.     IF sz$ = "CONTINUE" THEN        '' Pressed the "Continue" button
  411.         UIPop 1
  412.  
  413.     ELSEIF sz$ = "READ" THEN        '' Pressed the "Read" Button
  414.         LicenseTxtStr$ = STRING$(16,0)
  415.         i% = AcquireString(STR_LICENSETXT, LicenseTxtStr$, 16)
  416.  
  417.         NotePadExeStr$ = STRING$(16,0)
  418.         i% = AcquireString(STR_NOTEPADEXE, NotePadExeStr$, 16)
  419.  
  420.         SrcDir$ = GetSymbolValue("STF_SRCDIR")    '' Get our SOURCE directory
  421.  
  422. ''i% = DoMsgBox( NotePadExeStr$+" "+MakePath(SrcDir$, LicenseTxtStr$), "TESTING", 0 )
  423.         RUN NotePadExeStr$+" "+MakePath(SrcDir$, LicenseTxtStr$)
  424.  
  425.         NotePadExeStr$ = STRING$(0,0)
  426.         LicenseTxtStr$ = STRING$(0,0)
  427.         errStr$       = STRING$(0,0)
  428.     
  429.         GOTO LICENSE
  430.  
  431.     ELSEIF sz$ = "REACTIVATE" THEN
  432.         GOTO LICENSE
  433.  
  434.     ELSE                                    '' Pressed the "Exit" button
  435.         UIPop 1
  436.         GOSUB ASKQUIT
  437.         GOTO LICENSE
  438.     END IF
  439.  
  440.  
  441.  
  442.     IF IsItEISA = 1 THEN                ''    Get information about the system.
  443.         SystemArchitecture$ = "EISA"
  444.         EISAStr$ = STRING$(128,0)
  445.         i% = AcquireString(STR_EISA, EISAStr$, 128)
  446.         SetSymbolValue "SystemArchitecture", EISAStr$
  447.         EISAStr$ = STRING$(0,0)
  448.  
  449.     ELSEIF IsItMCA = 2 THEN
  450.         SystemArchitecture$ = "MCA"
  451.         MCAStr$ = STRING$(128,0)
  452.         i% = AcquireString(STR_MCA, MCAStr$, 128)
  453.         SetSymbolValue "SystemArchitecture", MCAStr$
  454.         MCAStr$ = STRING$(0,0)
  455.  
  456.     ELSE
  457.         SystemArchitecture$ = "ISA"
  458.         ISAStr$ = STRING$(128,0)
  459.         i% = AcquireString(STR_ISA, ISAStr$, 128)
  460.         SetSymbolValue "SystemArchitecture", ISAStr$
  461.         ISAStr$ = STRING$(0,0)
  462.     END IF
  463.  
  464. '' #########################################
  465. '' Next 2 lines commented out for Japanese NEC System
  466. ''    ASPIFound% = FindASPI
  467. ''    CAMFound%  = FindCAM
  468. '' #########################################
  469.  
  470.  
  471. '' #########################################
  472. '' This block added for Japanese NEC System, 
  473. '' They don't have SJ's+ or Remingtons to worry about.
  474. '' This set the value to a 3rd party SCSI card and the SJ II or 3 family
  475.  
  476.     ScannerChoice% = 1    '' ScanJet II or 3 family Scanner
  477.     ScannerPick$ = OptScanner(ScannerChoice% - 1)
  478.     SetSymbolValue "InstalledCard", "5"          '' 3rd party SCSI
  479.     SetSymbolValue "RemingtonCardFound", "0"
  480.     OPTCard$ = "2"
  481.     SetSymbolValue "OPTCard", OPTCard$
  482.     ReplaceListItem "SettingsTextIn", 3, OPTCardText(1)
  483.     ReplaceListItem "SettingsTextIn", 4, OptScanner(ScannerChoice% - 1)
  484.  
  485.     MakeCopyList    '' Build the default file copy list
  486.     CalcCopyCost    '' Compute req'd disk space
  487.     GOTO OPTION
  488. '' #########################################
  489.  
  490.  
  491.  
  492. CHOOSESCANNER:        '' Select which scanner(s) is/are being installed.
  493.     ScannerPick$ = ""
  494.     ScannerChoice% = 0
  495.  
  496. CHOOSESCANNERL1:    '' Is the scanner a ScanJet Plus or ScanJet II/3 family?
  497.     '' ********************************
  498.     '' *** Scanner Selection dialog ***
  499.     '' ********************************
  500.     sz$ = UIStartDlg(DS2Cui$, OPTIONS, "FRadioDlgProc", APPHELP1, HELP1PROC$)
  501.     szChoice$ = GetSymbolValue("ButtonChecked")
  502.  
  503.  
  504.     IF (szChoice$ = "1") THEN
  505.         ScannerChoice% = 1            '' ScanJet II or 3 family Scanner
  506.         IF (FCheckForRemington() <> 0) THEN
  507.             SetSymbolValue "RemingtonCardFound", "1"
  508.             SetSymbolValue "InstalledCard", "3"
  509.         ELSE
  510.             SetSymbolValue "InstalledCard", "4"
  511.         ENDIF
  512.         '' We decide in the ds2cui.c:ModifyConfig() routine whether the 
  513.         '' interface card is a Remington or Fred card and (i would think)
  514.         '' set OPTCard$ accordingly (though I haven't found the code that
  515.         '' does it yet--klb 940607).
  516.  
  517.     ELSE
  518.         OPTCard$       = "3"            '' ScanJet Plus Card
  519.         ScannerChoice% = 2            '' ScanJet Plus Scanner
  520.         SetSymbolValue "InstalledCard", "1"
  521.         SetSymbolValue "OPTCard", OPTCard$
  522.         ReplaceListItem "SettingsTextIn", 3, OPTCardText(2)
  523.         ReplaceListItem "SettingsTextIn", 4, OptScanner(ScannerChoice% - 1)
  524.     END IF
  525.  
  526.     ScannerPick$ = OptScanner(ScannerChoice% - 1)
  527.  
  528.     IF sz$ = "CONTINUE" THEN        '' Pressed the "Continue" button
  529.         UIPop 1
  530.         MakeCopyList                    '' Build the default file copy list
  531.         CalcCopyCost                    ''    Compute req'd disk space
  532.         GOTO OPTION
  533.     
  534.     ELSEIF sz$ = "REACTIVATE" THEN
  535.         GOTO CHOOSESCANNERL1
  536.  
  537.     ELSE                                    '' Pressed the "Exit" button
  538.          GOSUB ASKQUIT
  539.         GOTO CHOOSESCANNER
  540.     END IF
  541.  
  542.  
  543.  
  544. OPTION:            ''    Installation Settings confirmation dialog
  545. '' #########################################
  546. '' This block added for Japanese NEC System, 
  547. ''    OPTSETUP$ = "2"
  548. ''    GOTO GETPATH
  549. '' #########################################
  550.                     
  551. OPTL1:
  552.     '' ************************************
  553.     '' *** Installation Settings dialog *** 
  554.     '' ************************************
  555.     sz$ = UIStartDlg(DS2Cui$, CUSTINST, "FCustomOptDlgProc", APPHELP2, HELP2PROC$)
  556.  
  557.     OPTSETUP$ = GetSymbolValue("ButtonChecked")
  558.     UIPop 1    
  559.  
  560.     IF sz$ = "CONTINUE" THEN            '' Pressed the 'Continue' button
  561.         OPTSETUP$ = "1"
  562.  
  563.     ELSEIF sz$ = "REACTIVATE" THEN
  564.         GOTO OPTL1
  565.  
  566.     ELSEIF sz$ = "CUSTOM" THEN            '' Pressed the 'Modify' button
  567.         OPTSETUP$ = "2"
  568.  
  569.     ELSE                                        '' Pressed the 'Exit' button
  570.         UIPop 1
  571.          GOSUB ASKQUIT
  572.         GOTO OPTION
  573.     END IF
  574.  
  575.  
  576. CHECKDISKSPACE:    '' for the quick path, we still need to check disk space
  577.  
  578.     IF (OPTSETUP$ = "1") THEN
  579.         IF DestFree& < DestCost& THEN
  580.             '' **************************************
  581.             '' *** Insufficient Disk Space Dialog ***
  582.             '' **************************************
  583.             sz$ = UIStartDlg(DS2Cui$, ERRORSPACE, "FDiskErrorDlgProc", 0, "")
  584.  
  585.             IF sz$ = "EXIT" THEN            '' Pressed the "Exit" button
  586.                 GOSUB ASKQUIT
  587.                 GOTO CHECKDISKSPACE
  588.  
  589.             ELSEIF sz$ = "REACTIVATE" THEN
  590.                 GOTO CHECKDISKSPACE
  591.  
  592.             ELSE                                '' Pressed the "OK" button
  593.                  UIPop 2
  594.                 GOTO GETPATH
  595.             END IF
  596.  
  597.         ELSE
  598.             UIPop 1
  599.         END IF
  600.  
  601.         GOTO STARTINSTALL
  602.     END IF
  603.  
  604.  
  605.  
  606. GETPATH:
  607.     SetSymbolValue "EditTextIn", DEST$
  608.     SetSymbolValue "EditFocus", "END"
  609.  
  610. GETPATHL1:
  611.     '' ***********************************************
  612.     '' *** Installation Directory Selection dialog ***
  613.     '' ***********************************************
  614.     sz$   = UIStartDlg(DS2Cui$, DESTPATH, "FEditDlgProc", APPHELP3, HELP3PROC$)
  615.     DEST$ = LTRIM$(RTRIM$(GetSymbolValue("EditTextOut")))
  616.  
  617.     SetSymbolValue "InstallDir", DEST$
  618.  
  619.     IF sz$ = "CONTINUE" THEN
  620.         IF IsDirWritable(DEST$) = 0 THEN
  621.             GOSUB BADPATH
  622.             GOTO GETPATHL1
  623.         END IF
  624.         MakeCopyList                    '' disk or directory may have changed
  625.         CalcCopyCost                    '' target disk may have changed
  626.         GOTO TESTSPACE
  627.  
  628.     ELSEIF sz$ = "REACTIVATE" THEN
  629.         GOTO GETPATHL1
  630.  
  631.     ELSEIF sz$ = "BACK" THEN
  632.         UIPop 1
  633.         GOTO OPTION
  634.  
  635.     ELSE
  636.         UIPop 1
  637.         GOSUB ASKQUIT
  638.         GOTO GETPATH
  639.     END IF
  640.  
  641.     
  642.  
  643.  
  644. TESTSPACE:
  645.     IF (DestFree& < DestCost&) THEN
  646.         '' **************************************
  647.         '' *** Insufficient Disk Space Dialog ***
  648.         '' **************************************
  649.         sz$ = UIStartDlg(DS2Cui$, ERRORSPACE, "FDiskErrorDlgProc", 0, "")
  650.  
  651.         IF sz$ = "EXIT" THEN            '' Pressed the "Exit" button
  652.             GOSUB ASKQUIT
  653.             GOTO TESTSPACE
  654.  
  655.         ELSEIF sz$ = "REACTIVATE" THEN
  656.             GOTO TESTSPACE
  657.  
  658.         ELSE                                '' Pressed the "OK" button
  659.              UIPop 2
  660.             GOTO GETPATH
  661.         END IF
  662.  
  663.     ELSE
  664.         UIPop 1                            '' is this needed?  klb 940615
  665.     END IF
  666.  
  667.     '' If express setup and did the destination because of a disk space 
  668.     '' problem, then we need to go do the installation.
  669.  
  670.     IF OPTSETUP$ = "1" THEN
  671.         GOTO STARTINSTALL
  672.     END IF
  673.  
  674.  
  675.  
  676. GETGROUPNAME:
  677.     IF LISTMADE% = 0 THEN
  678.         AddListItem "ListGroupsIn", DEFAULTGROUP$
  679.         LISTMADE% = 1
  680.     END IF
  681.  
  682.     SetSymbolValue "ListGroupsOut", DEFAULTGROUP$
  683.  
  684. GETGROUPNAMEL1:
  685.     '' *******************************************
  686.     '' *** Select Program Manager Group dialog ***
  687.     '' *******************************************
  688.     sz$    = UIStartDlg(DS2Cui$, GROUPLIST, "FGroupsDlgProc", APPHELP4, HELP4PROC$)
  689.  
  690.     GROUP$ = GetSymbolValue("EditGroupOut")
  691.  
  692.     IF sz$ = "CONTINUE" THEN
  693.         UIPop 1
  694.         GOTO CARDOPTION
  695.  
  696.     ELSEIF sz$ = "REACTIVATE" THEN
  697.         GOTO GETGROUPNAMEL1
  698.  
  699.     ELSEIF sz$ = "BACK" THEN
  700.         UIPop 1
  701.         GOTO GETPATH
  702.  
  703.     ELSE
  704.         UIPop 1
  705.         GOSUB ASKQUIT
  706.         GOTO GETGROUPNAME
  707.     END IF
  708.  
  709.  
  710.  
  711. CARDOPTION:
  712. '' #########################################
  713. '' This block added for Japanese NEC System, 
  714. '' The card option was already set
  715.  
  716.     GOTO CONFIRMINFO
  717.  
  718. '' #########################################
  719.  
  720.     IF (ScannerChoice% = 2) THEN            '' ScanJet Plus == 2
  721.         OPTCard$ = "3"                            '' ScanJet Plus interface card
  722.         SetSymbolValue "InstalledCard", "1"
  723.         SetSymbolValue "OPTCard", OPTCard$
  724.         SetSymbolValue "RemingtonCardFound", "0"
  725.         GOTO CONFIRMINFO                        '' already know the card so skip the dlg
  726.     END IF
  727.  
  728.     SetSymbolValue "RadioDefault", OPTCard$
  729.  
  730. CARDOPTIONL1:                 
  731.     '' *********************************************
  732.     '' *** Scanner Interface Card Options dialog ***
  733.     '' *********************************************
  734.     sz$ = UIStartDlg(DS2Cui$, CARDOPTIONS, "FCardOptDlgProc", APPHELP5, HELP5PROC$)
  735.  
  736.    OPTCard$ = GetSymbolValue("ButtonChecked")
  737.  
  738.     SetSymbolValue "OPTCard", OPTCard$
  739.  
  740.     IF sz$ = "CONTINUE" THEN
  741.         UIPop 1
  742.         IF OPTCard$ = "1" THEN
  743.             IF (FCheckForRemington() <> 0) THEN
  744.                 SetSymbolValue "InstalledCard", "3"
  745.                 SetSymbolValue "RemingtonCardFound", "1"
  746.             ELSE
  747.                 SetSymbolValue "InstalledCard", "4"
  748.             ENDIF
  749.  
  750.         ELSEIF OPTCard$ = "2" THEN
  751.             SetSymbolValue "InstalledCard", "0"
  752.             SetSymbolValue "RemingtonCardFound", "0"
  753.         END IF
  754.         GOTO CONFIRMINFO
  755.  
  756.     ELSEIF sz$ = "REACTIVATE" THEN
  757.         GOTO CARDOPTIONL1
  758.  
  759.     ELSEIF sz$ = "BACK" THEN
  760.         UIPop 1
  761.         GOTO GETGROUPNAME
  762.  
  763.     ELSE
  764.         UIPop 1
  765.          GOSUB ASKQUIT
  766.         GOTO CARDOPTION
  767.     END IF
  768.  
  769.  
  770.  
  771. CONFIRMINFO:
  772.     genericStr$ = STRING$(64,0)
  773.     i% = AcquireString(STR_DIR, genericStr$, 64)
  774.     ReplaceListItem "ConfirmTextIn", 1, genericStr$+":  "+DEST$
  775.  
  776.     i% = AcquireString(STR_PROGMANGROUP, genericStr$, 64)
  777.     ReplaceListItem "ConfirmTextIn", 2, genericStr$+":  "+GROUP$
  778.  
  779.     i% = AcquireString(STR_SCANNER, genericStr$, 64)
  780.     ReplaceListItem "ConfirmTextIn", 3, genericStr$+":   "+ScannerPick$
  781.  
  782.     i% = AcquireString(STR_INTERFACECARD, genericStr$, 64)
  783.     IF OPTCard = "1" THEN
  784.         ReplaceListItem "ConfirmTextIn", 4, genericStr$+":   "+OPTCardText(0)
  785.  
  786.     ELSEIF OPTCard = "2" THEN    
  787.         ReplaceListItem "ConfirmTextIn", 4, genericStr$+":   "+OPTCardText(1)
  788.  
  789.     ELSEIF OPTCard = "3" THEN
  790.         ReplaceListItem "ConfirmTextIn", 4, genericStr$+":   "+OPTCardText(2)
  791.  
  792.     ELSE
  793.         ReplaceListItem "ConfirmTextIn", 4, genericStr$+":   "+OPTCardText(0)
  794.     END IF
  795.  
  796.     genericStr$ = STRING$(0,0)
  797.  
  798.  
  799.     '' *******************************
  800.     '' *** Verify Settings dialogs ***
  801.     '' *******************************
  802.     sz$ = UIStartDlg(DS2Cui$, CDCONFIRMINFO, "FConfirmDlgProc", 0, "")
  803.  
  804.     IF sz$ = "CONTINUE" THEN
  805.         UIPop 1
  806.         GOTO STARTINSTALL
  807.  
  808.     ELSEIF sz$ = "REACTIVATE" THEN
  809.         GOTO CONFIRMINFO
  810.  
  811.     ELSEIF sz$ = "BACK" THEN
  812.         UIPop 1
  813.         GOTO GETPATH
  814.     END IF
  815.  
  816.  
  817.  
  818. STARTINSTALL:        ''    Begin installation
  819.     Install            '' Call the installation control subroutine
  820.  
  821.  
  822.  
  823. QUIT:
  824.     ON ERROR GOTO ERRQUIT
  825.     dlg% = 0
  826.     
  827.     IF ERR = 0 THEN
  828. ''        IF AskModSysIni% = 0 THEN
  829. ''            dlg% = EXITSUCCESS1        '' Don't tell them to reboot
  830. ''        ELSE
  831.             dlg% = EXITSUCCESS        '' Tell them to reboot
  832. ''        END IF            
  833.  
  834.     ELSEIF ERR = STFQUIT THEN
  835.         dlg% = EXITQUIT
  836.  
  837.     ELSE
  838.         dlg% = EXITFAILURE
  839.     END IF
  840.  
  841. QUITL1:
  842.     '' *********************************************************************
  843.     '' The dialog that's displayed depends on the value of dlg% set in QUIT:
  844.     '' *********************************************************************
  845.     sz$ = UIStartDlg(DS2Cui$, dlg%, "FInfo0DlgProc", 0, "")
  846.  
  847.     IF sz$ = "REACTIVATE" THEN
  848.         GOTO QUITL1
  849.     END IF
  850.  
  851.     UIPop 1
  852.  
  853.  
  854.  
  855. ALL_DONE:                                '' Check whether README.TXT got copied.
  856.                                             '' If not, don't bother trying to show it.
  857.     ReadmeTxtStr$ = STRING$(16,0)
  858.     i% = AcquireString(STR_READMETXT, ReadmeTxtStr$, 16)
  859.     i% = DoesFileExist(MakePath(DEST$, ReadmeTxtStr$), femExists)
  860.  
  861.     IF i% = 1 THEN 
  862.         NotePadExeStr$ = STRING$(16,0)
  863.         i% = AcquireString(STR_NOTEPADEXE, NotePadExeStr$, 16)
  864.         RUN NotePadExeStr$+" "+MakePath(DEST$, ReadmeTxtStr$), NOWAIT
  865.         NotePadExeStr$ = STRING$(0,0)
  866.     END IF
  867.  
  868.     ReadmeTxtStr$ = STRING$(0,0)
  869.     errStr$       = STRING$(0,0)
  870.  
  871.     MyRemoveFiles                        '' Delete installer files not used by Bamm-Bamm.
  872.  
  873.      END                                    '' This is an exit point for the script.
  874.  
  875.  
  876.  
  877. ERRQUIT:
  878.     i% = AcquireString(ERR_CORRUPTSOURCES, errStr$, 256)
  879.     i% = DoMsgBox(errStr$, Setup$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  880.  
  881.     errStr$ = STRING$(0,0)
  882.  
  883.     MyRemoveFiles                        '' Delete installer files not used by Bamm-Bamm.
  884.  
  885.     END                                    '' This is an exit point for the script.
  886.  
  887.  
  888.  
  889. BADPATH:
  890.     '' **********************************************
  891.     '' *** Unknown Path or Directory Error dialog ***
  892.     '' **********************************************
  893.     sz$ = UIStartDlg(DS2Cui$, BADPATH, "FInfo0DlgProc", 0, "")
  894.  
  895.     IF sz$ = "REACTIVATE" THEN
  896.         GOTO BADPATH
  897.  
  898.     ELSE
  899.         UIPop 1                            '' Only one button--Pop the error alert
  900.     END IF
  901.  
  902.     RETURN
  903.  
  904.  
  905.  
  906. ASKQUIT:
  907.     '' *******************************
  908.     '' *** Incomplete Setup dialog ***
  909.     '' *******************************
  910.     sz$ = UIStartDlg(DS2Cui$, ASKQUIT, "FQuitDlgProc", 0, "")
  911.  
  912.     IF sz$ = "EXIT" THEN                '' Pressed the "Quit" button
  913.         UIPopAll
  914.         ERROR STFQUIT
  915.  
  916.     ELSEIF sz$ = "REACTIVATE" THEN
  917.         GOTO ASKQUIT
  918.  
  919.     ELSE
  920.         UIPop 1                            '' Pressed the "Back" button--Pop the error alert
  921.     END IF
  922.  
  923.     RETURN
  924.  
  925. '' ****************************************
  926. '' ********** END OF MAIN SCRIPT **********
  927. '' ****************************************
  928.  
  929.  
  930.  
  931. '*************************************************************************
  932. '** Subroutine: CalcCopyCost
  933. '** Purpose:    Computes the amount of disk space needed to copy the files
  934. '**             the files in the copy list.
  935. '** Arguments:     none.
  936. '** Returns:     none.
  937. '*************************************************************************
  938. SUB CalcCopyCost STATIC
  939.  
  940.     '' How much disk space will we need to copy all these files?
  941.  
  942.     CostPerDisk$ = "CostPerDisk"
  943.     StillNeed&   = GetCopyListCost(ExtraCosts$, CostPerDisk$,"")
  944. ''    DestCost&    = 1536000                '' 1.5 MB required to install Bamm-Bamm
  945.     DestCost&    = 0
  946.     WinCost&     = 0
  947.     cost&        = 0
  948.  
  949.     FOR i% = 1 to 26 STEP 1
  950.         cost& = VAL(GetListItem(CostPerDisk$, i%))
  951.  
  952. '$IFDEF DEBUG
  953. ''    k% = DoMsgBox("drive ("+CHR$(i% + ASC("A")-1)+") cost ("+str$(cost&)+").", "Copy Costs", MB_TASKMODAL+MB_OK+MB_ICONINFORMATION)
  954. '$ENDIF
  955.  
  956.     NEXT i%
  957.  
  958.     DestDrive$ = MID$(DEST$, 1, 1)
  959.     i%         = ASC(ucase$(DestDrive$)) - ASC("A") + 1
  960.     DestCost&  = VAL(GetListItem(CostPerDisk$, i%))
  961.  
  962.     ReplaceListItem "DiskSpaceData", 1, " " + DestDrive$ + ":"
  963.     ReplaceListItem "DiskSpaceData", 2, STR$(DestCost& / 1024) + " K"
  964.     drive$    = MID$(DEST$, 1, 1)
  965.     DestFree& = GetFreeSpaceForDrive(drive$)
  966.  
  967.     IF (DestFree& < 0) THEN
  968.         DestFree& = 0
  969.     END IF
  970.  
  971.     ReplaceListItem "DiskSpaceData", 3, STR$(DestFree& / 1024) + " K"
  972.  
  973.     WinDrive$ = MID$(WinDir$, 1, 1)
  974.     ndrive%   = ASC(ucase$(WinDrive$)) - ASC("A") + 1
  975.     WinCost&  = VAL(GetListItem(CostPerDisk$, ndrive%))
  976.  
  977. '$IFDEF DEBUG
  978. ''    i% = DoMsgBox("Windows drive ('"+str$(ndrive%)+"') index in list.", "Copy Costs", MB_TASKMODAL+MB_OK+MB_ICONINFORMATION)
  979. '$ENDIF
  980.  
  981.     ReplaceListItem "DiskSpaceData", 5, STR$(WinCost& / 1024) + " K"
  982.  
  983.     WinFree& = GetFreeSpaceForDrive(WinDrive$)
  984.  
  985.     IF (WinFree& < 0) THEN
  986.         WinFree& = 0
  987.     END IF
  988.  
  989.     ReplaceListItem "DiskSpaceData", 6, STR$(WinFree& / 1024) + " K"
  990.  
  991.     CostPerDisk$ = ""
  992.  
  993. END SUB
  994.  
  995.  
  996.  
  997. '*************************************************************************
  998. '** Subroutine: MakeCopyList
  999. '** Purpose:    Builds the copy list.
  1000. '** Arguments:     none.
  1001. '** Returns:     none.
  1002. '*************************************************************************
  1003. SUB MakeCopyList STATIC
  1004.  
  1005.     ClearCopyList                                    '' Start with a clean copy list
  1006.  
  1007.     SrcDir$ = GetSymbolValue("STF_SRCDIR")    '' Get our SOURCE directory
  1008.  
  1009.     '' Add all the files to the copy list that we copy in all cases...
  1010.  
  1011. ''$IFDEF 1
  1012. ''    AddSectionFilesToCopyList "Setup Files",        SrcDir$, DEST$
  1013.     AddSectionFilesToCopyList "Files",              SrcDir$, DEST$
  1014.     AddSectionFilesToCopyList "Utility Files",      SrcDir$, DEST$
  1015. ''    AddSectionFilesToCopyList "Windows",            SrcDir$, WinDir$
  1016. ''    AddSectionFilesToCopyList "Windows:System",     SrcDir$, WinDir$+"SYSTEM\"
  1017. ''    AddSectionFilesToCopyList "Windows:TWAIN",      SrcDir$, TwainDir$
  1018. ''$ENDIF
  1019.  
  1020.     '' Here's how to check for NT -- IF (IsItNT()) THEN ...
  1021.     '' Where should we put files on an NT system?
  1022.     '' How can we keep from installing DOS and Windows drivers on an NT system?
  1023.     '' Do any dialogs need to change for installation on an NT system?
  1024.     ''    AddSectionFilesToCopyList "NT Files", SrcDir$, DEST$
  1025.  
  1026.     '' Add files that are specific to EISA or MCA backplane computers...
  1027.  
  1028.     IF SystemArchitecture$ = "EISA" THEN
  1029.  
  1030.         IF ScannerChoice% = 1 THEN    '' ScanJet II or 3 family scanner...
  1031.             IF GetSymbolValue("RemingtonCardFound") = "1" THEN
  1032.                 AddSectionFilesToCopyList "Remington Card EISA", SrcDir$, DEST$
  1033.             ELSE
  1034.                 AddSectionFilesToCopyList "Fred Card EISA", SrcDir$, DEST$
  1035.             ENDIF
  1036.  
  1037.         ELSEIF ScannerChoice% = 2 THEN
  1038.             AddSectionFilesToCopyList "ScanJet Plus EISA", SrcDir$, DEST$
  1039.         END IF
  1040.  
  1041.     ELSEIF SystemArchitecture$ = "MCA" THEN
  1042.  
  1043.         IF ScannerChoice% = 1 THEN    '' ScanJet II or 3 family scanner...
  1044.             IF GetSymbolValue("RemingtonCardFound") = "1" THEN
  1045.                 AddSectionFilesToCopyList "Remington Card MCA", SrcDir$, DEST$
  1046.             ELSE
  1047.                 AddSectionFilesToCopyList "Fred Card MCA", SrcDir$, DEST$
  1048.             ENDIF
  1049.  
  1050.         ELSEIF ScannerChoice% = 2 THEN
  1051.             AddSectionFilesToCopyList "ScanJet Plus MCA", SrcDir$, DEST$
  1052.         END IF
  1053.     END IF
  1054.  
  1055.     
  1056.     '' Add the driver files that match the type of interface card specified...
  1057.  
  1058.     IF ScannerChoice% = 1 THEN        '' ScanJet II or 3 family scanner...
  1059.  
  1060.         IF GetSymbolValue("RemingtonCardFound") = "1" THEN
  1061.             AddSectionFilesToCopyList "Remington Card Utils", SrcDir$, DEST$
  1062.             AddSectionFilesToCopyList "Remington Card Drivers", SrcDir$, DEST$
  1063.         ELSE
  1064.             AddSectionFilesToCopyList "Fred Card Drivers", SrcDir$, DEST$
  1065.         ENDIF
  1066.  
  1067.     ELSEIF ScannerChoice% = 2 THEN
  1068.  
  1069.         AddSectionFilesToCopyList "ScanJet Plus Utils", SrcDir$, DEST$
  1070.         AddSectionFilesToCopyList "ScanJet Plus Drivers", SrcDir$, DEST$
  1071.     END IF
  1072.  
  1073. END SUB
  1074.  
  1075.  
  1076.  
  1077. '*************************************************************************
  1078. '** Subroutine: Install
  1079. '** Purpose:    Performs all installation operations.
  1080. '** Arguments:     none.
  1081. '** Returns:     none.
  1082. '** History:
  1083. '**   940516 klb Added AcquireString() call for STR_NOTEPADEXE (local var
  1084. '**              is NotePadExeStr$).
  1085. '**              Changed hard-coded reference to "readme.txt" to result
  1086. '**              of AcquireString() on STR_READMETXT.
  1087. '**              Added label CONFIG:
  1088. '**              Commented out the CopyFile() immediately after CONFIG:.
  1089. '**              Replaced the UIPop 1 command in CONFIG: with a big
  1090. '**              IF/THEN/ELSE to treat the modification more intelligently.
  1091. '**              Commented out all the AUTOEXEC modify stuff because we're
  1092. '**              adding HPDS25.INI file support to the TWAIN stuff.
  1093. '**              Commented out all the old SYSTEM.INI code and replaced it
  1094. '**              wholesale with the SYSINI: block from the Kennel code.
  1095. '**              Commented out all the CONFIG.SYS modification stuff and
  1096. '**              replaced it wholesale with Kennel code (hope it works).
  1097. '**              Added UIPop1 to ELSE in GETREFDISKL1:.
  1098. '**   940518 klb Added code to write the HPDS25.INI file.
  1099. '**   940621 klb Deleted the line that was writing initialization info to
  1100. '**              the INI file -- this is wholly handled in WriteHPDSINI()
  1101. '**              now and shouldn't happen here.
  1102. '**              Added a CopyFile call so that the INI file created in the
  1103. '**              Windows directory is copied to the install directory.  That
  1104. '**              way, if the INI file gets trashed in the Windows directory,
  1105. '**              the user can just copy the original from the install dir
  1106. '**              and, assuming that DeskScan hasn't been moved, life will
  1107. '**              once again be wonderful.]
  1108. '**   940628 klb Third-party SCSI card (InstalledCard$ == 0) set ConfigFile$
  1109. '**              to the ScanJet Plus configuration file (!hwp1461.cfg)
  1110. '**              instead of the Fred file (!hwp2080.cfg).  So, I changed the
  1111. '**              string to the correct file name.
  1112. '**
  1113. '*************************************************************************
  1114. SUB Install STATIC
  1115.  
  1116.     CreateDir DEST$, cmoVital        ''    Create the destination directory...
  1117.  
  1118.     CopyFilesInCopyList                '' Copy files from distrib disk to dest disk
  1119.     
  1120.     ''    Create the Program Manager Group with the name specified by the user...
  1121.  
  1122.     CreateProgmanGroup GROUP$, "", cmoNone
  1123.     ShowProgmanGroup   GROUP$, 1,  cmoNone
  1124.  
  1125.     
  1126.     ''    Create the Program Manager Group Icons...
  1127.  
  1128.     NameStr$       = STRING$(128,0)
  1129.     NotePadExeStr$ = STRING$(16,0)
  1130.  
  1131.     i%       = AcquireString(STR_DESKSCAN,    NameStr$, 128)
  1132.     CreateProgManItem GROUP$, NameStr$, MakePath(DEST$, "HPCCOPY.EXE"), "", cmoOverwrite
  1133.  
  1134.     i%       = AcquireString(STR_SCSIADDRESS, NameStr$, 128)
  1135.     CreateProgManItem GROUP$, NameStr$, MakePath(DEST$, "SCSIADDR.EXE"), "", cmoOverwrite
  1136.  
  1137.     i%       = AcquireString(STR_SCANNERTEST, NameStr$, 128)
  1138.     CreateProgManItem GROUP$, NameStr$, MakePath(DEST$, "SCANTEST.EXE"), "", cmoOverwrite
  1139.  
  1140.     i%       = AcquireString(STR_READMETXT,   NameStr$, 128)
  1141.     i%       = AcquireString(STR_NOTEPADEXE,  NotePadExeStr$, 16)
  1142.     CreateProgManItem GROUP$, NameStr$, NotePadExeStr$+" "+MakePath(DEST$, NameStr$), "", cmoOverwrite
  1143.  
  1144.     i%       = AcquireString(STR_LICENSETXT,   NameStr$, 128)
  1145.     CreateProgManItem GROUP$, NameStr$, NotePadExeStr$+" "+MakePath(DEST$, NameStr$), "", cmoOverwrite
  1146.  
  1147.     NotePadExeStr$ = STRING$(0,0)
  1148.     NameStr$       = STRING$(0,0)
  1149.  
  1150.  
  1151.     ''    write our TWAIN data source .ini file...
  1152.  
  1153. ''    DSIniStr$ = STRING$(16,0)
  1154. ''    i% = AcquireString(STR_HPDSINI, DSIniStr$, 16)
  1155. ''    i% = WriteHPDSINI()
  1156.  
  1157. ''    '' Make a copy of the INI file in the install directory so recovery is easy
  1158. ''
  1159. ''    CopyFile WinDir$+DSIniStr$, DEST$+"\"+DSIniStr$, cmoOverwrite, 0
  1160. ''    DSIniStr$ = STRING$(0,0)
  1161. ''
  1162. ''    '' Make a copy of the TWAIN data source file into the install directory...
  1163. ''
  1164. ''    CopyFile TWAINDir$+"HPDS21.DS", DEST$+"\HPDS21.DS", cmoOverwrite, 0
  1165.  
  1166.  
  1167.  
  1168. CONFIG:    
  1169.     AskModSysIni%   = 0
  1170.  
  1171.     ''    Make a temporary copy of the CONFIG.SYS.  If we aren't told to modify
  1172.     ''    the SYS file, we'll delete it and the user won't know it was there...
  1173.  
  1174.     CopyFile "A:\CONFIG.SYS", GetSymbolValue("ConfigBackup"), cmoOverwrite, 0
  1175.  
  1176.     '' ********************************
  1177.     '' *** Modify CONFIG.SYS dialog ***
  1178.     '' ********************************
  1179.  
  1180.     sz$ = UIStartDlg(DS2Cui$, MODIFYCONFIG, "FModifyConfigDlgProc", 0, "")
  1181.  
  1182.     IF (sz$ = "CONTINUE") THEN    '' User wants us to mod CONFIG for them...
  1183.         UIPop 1                        '' FModifyConfigDlgProc() updated 'ConfigTemp'...
  1184.         CopyFile   GetSymbolValue("ConfigTemp"), "A:\CONFIG.SYS", cmoOverwrite,0
  1185.         RemoveFile GetSymbolValue("ConfigTemp"), cmoNone
  1186. ''        MUSTREBOOT% = 1
  1187.  
  1188.     ELSEIF sz$ = "REACTIVATE" THEN
  1189.         GOTO CONFIG
  1190.  
  1191.     ELSE                                '' User wants us to leave CONFIG file alone...
  1192.         UIPop 1                        '' CONFIG file not mod'd so delete the temp file...
  1193.         RemoveFile GetSymbolValue("ConfigBackup"), cmoNone
  1194. ''        MANUALMOD% = 1
  1195.     END IF
  1196.  
  1197.     ''
  1198.     '' The 'InstalledCard' symbol's values are defined in ds2cui.h.
  1199.     '' Since we "know" which card is being used, decide now whether the user
  1200.     '' may want us to modify their SYSTEM.INI file for them.
  1201.     ''
  1202.     InstalledCard$ = GetSymbolValue("InstalledCard")
  1203.  
  1204.     IF InstalledCard$="0" THEN            '' No Card detected...
  1205.         AskModSysIni% = 1                    '' Assume it'll be a Fred card eventually
  1206.  
  1207.     ELSEIF InstalledCard$="1" THEN    '' ScanJet Plus card
  1208.         AskModSysIni% = 0
  1209.  
  1210.     ELSEIF InstalledCard$="2" THEN    '' SJ Plus card in certain Gateway CPUs
  1211.         AskModSysIni% = 0
  1212.  
  1213.     ELSEIF InstalledCard$="3" THEN    '' Remington SCSI card
  1214. ''        AskModSysIni% = 0
  1215.         AskModSysIni% = 1                    '' Add EMMExclude line
  1216.  
  1217.     ELSEIF InstalledCard$="4" THEN    '' Fred SCSI card
  1218.         AskModSysIni% = 1                    '' Add high-performance drivers
  1219.  
  1220.     ELSEIF InstalledCard$="5" THEN    '' 3rd-party SCSI card
  1221.         AskModSysIni% = 0
  1222.     END IF
  1223.  
  1224.  
  1225.  
  1226.  
  1227. CHECKSYSINIFORHIPERF:        '' Our high-performance drivers (VxDs) in SYSTEM.INI?
  1228.  
  1229.     CopyFile WinDir$+"SYSTEM.INI", GetSymbolValue("SysIniThrowAwayFile"), cmoOverwrite, 0
  1230.     i% = FCheckForHiPerfDrivers()
  1231.  
  1232.     '' Regardless of the outcome of the search, dispose of our temp file...
  1233.     RemoveFile GetSymbolValue("SysIniThrowAwayFile"), cmoNone
  1234.  
  1235.     IF i% = 0 THEN                        '' >0 means one or more of our VxDs were found
  1236.         GOTO SYSINI                        '' 0 means none of our VxDs were found
  1237.     END IF
  1238.  
  1239.     '' ****************************************************
  1240.     '' *** Remove Unused Drivers from SYSTEM.INI dialog ***
  1241.     '' ****************************************************
  1242.     sz$ = UIStartDlg(DS2Cui$, REMOVEHIPERF, "FRemoveHiPerfDlgProc", 0, "")
  1243.  
  1244.     IF sz$ = "CONTINUE" THEN        '' Pressed the "Yes" button
  1245.         UIPop 1
  1246.         CopyFile   WinDir$+"SYSTEM.INI", GetSymbolValue("SysIniBackup"), cmoOverwrite, 0
  1247.         i% = FRemoveHiPerfDrivers()
  1248.  
  1249.         IF i% = 0 THEN                    '' FRemoveHiPerfDrivers() failed...
  1250.             RemoveFile GetSymbolValue("SysIniBackup"), cmoNone
  1251.             '$IFDEF DEBUG
  1252.                 i% = DoMsgBox("FRemoveHiPerDrivers() failed to remove VxDs!", "DEBUG", MB_OK+MB_TASKMODAL)
  1253.             '$ENDIF
  1254.         
  1255.         ELSE                                '' VxDs removed OK so save our changes...
  1256.             RemoveFile WinDir$+"SYSTEM.INI", cmoNone
  1257.             RenameFile GetSymbolValue("SysIniTemp"), "SYSTEM.INI"
  1258. ''            MUSTREBOOT% = 1
  1259.         ENDIF
  1260.  
  1261.         GOTO SYSINI                        '' in any event, go on...
  1262.  
  1263.     ELSEIF sz$ = "REACTIVATE" THEN
  1264.         GOTO CHECKSYSINIFORHIPERF
  1265.  
  1266.     ELSEIF sz$ = "EXIT" THEN        '' Pressed the "Exit" button
  1267.         UIPop 1
  1268.         GOSUB ASKQUIT2
  1269.         GOTO CHECKSYSINIFORHIPERF
  1270.  
  1271.     ELSEIF sz$ = "CANCEL" THEN        '' Pressed the "No" button
  1272.         UIPop 1
  1273. ''        MANUALMOD% = 1
  1274.         GOTO MANUALSYSINI
  1275.  
  1276.     ELSE
  1277.         UIPop 1
  1278.     END IF
  1279.  
  1280.  
  1281.  
  1282. MANUALSYSINI:
  1283.     '' ****************************************************
  1284.     '' *** Manually update SYSTEM.INI dialog ***
  1285.     '' ****************************************************
  1286.     sz$ = UIStartDlg(DS2Cui$, HIPERFNAMES, "FManualSysIniDlgProc", 0, "")
  1287.  
  1288.     '' Process the result of "FManualSysIniDlgProc"
  1289.  
  1290.     IF sz$ = "CONTINUE" THEN
  1291.         UIPop 1
  1292.         GOTO SYSINI
  1293.         
  1294.     ELSEIF sz$ = "BACK" THEN
  1295.         UIPop 1
  1296.         GOTO CHECKSYSINIFORHIPERF
  1297.  
  1298.     ELSEIF sz$= "REACTIVATE" THEN
  1299.         GOTO MANUALSYSINI
  1300.  
  1301.     ELSE
  1302.         UIPop 1
  1303.         GOTO SYSINI
  1304.     END IF
  1305.  
  1306.  
  1307.  
  1308.  
  1309. SYSINI:
  1310.     IF AskModSysIni% = 0 THEN                    '' gate the SYSTEM.INI mod dialog
  1311.         GOTO EISA_MCA_FILES
  1312.     END IF
  1313.  
  1314.     ''
  1315.     '' The 'InstalledCard' symbol's values are defined in ds2cui.h.
  1316.     ''
  1317.     InstalledCard$ = GetSymbolValue("InstalledCard")
  1318.  
  1319.  
  1320.     '' ********************************
  1321.     '' *** Modify SYSTEM.INI dialog ***
  1322.     '' ********************************
  1323.     IF InstalledCard$ = "3" THEN                '' Remington SCSI Card
  1324.         sz$ = UIStartDlg(DS2Cui$, MODIFYIICSYSTEMINI, "FYesNoDlgProc", 0, "")
  1325.      ELSE                                                '' Fred SCSI Card
  1326.         sz$ = UIStartDlg(DS2Cui$, MODIFYSYSTEMINI, "FYesNoDlgProc", 0, "")
  1327.     END IF
  1328.  
  1329.     IF sz$ = "CONTINUE" THEN
  1330.         UIPop 1
  1331. ''        MUSTREBOOT% = 1
  1332.         CopyFile WinDir$+"SYSTEM.INI", GetSymbolValue("SysIniBackup"), cmoOverwrite,0
  1333.         i% = ModifySysIni()
  1334.  
  1335.         IF i% <> 0 THEN                            '' only if ModifySysIni() suceeds...
  1336.             RemoveFile WinDir$+"SYSTEM.INI", cmoNone
  1337.             RenameFile GetSymbolValue("SysIniTemp"), "SYSTEM.INI"
  1338.  
  1339.         ELSE
  1340.             RemoveFile GetSymbolValue("SysIniTemp"), cmoNone
  1341.         END IF
  1342.  
  1343.     ELSEIF sz$ = "REACTIVATE" THEN
  1344.         GOTO SYSINI
  1345.  
  1346.     ELSE
  1347.         UIPop 1
  1348. ''        MANUALMOD% = 1
  1349.     END IF
  1350.  
  1351.  
  1352. EISA_MCA_FILES:
  1353.     ''
  1354.     '' The 'InstalledCard' symbol's values are defined in ds2cui.h.
  1355.     ''
  1356.     InstalledCard$ = GetSymbolValue("InstalledCard")
  1357.  
  1358.     IF InstalledCard$ = "5" THEN                '' 3rd party SCSI
  1359.         GOTO DONE
  1360.     ENDIF
  1361.         
  1362.     IF (SystemArchitecture$ = "MCA") THEN
  1363.         IF InstalledCard$ = "0" THEN            '' No card found, assume Fred card
  1364.             ConfigFile$ = "@631f.adf"
  1365.  
  1366.         ELSEIF InstalledCard$ = "1" THEN        '' ScanJet Plus card
  1367.             ConfigFile$ = "@601f.adf"
  1368.  
  1369.         ELSEIF InstalledCard$ = "2" THEN        '' ScanJet Plus card in some Gateways
  1370.             ConfigFile$ = "@601f.adf"
  1371.  
  1372.         ELSEIF InstalledCard$ = "3" THEN        '' Remington SCSI card
  1373.             ConfigFile$ = "@621f.adf"
  1374.  
  1375.         ELSEIF InstalledCard$ = "4" THEN        '' Fred SCSI card
  1376.             ConfigFile$ = "@631f.adf"
  1377.         END IF
  1378.  
  1379. ''        GOTO DONE                                    '' Don't ask for EISA Reference Disk
  1380.  
  1381.     ELSEIF (SystemArchitecture$ = "EISA") THEN
  1382.         IF InstalledCard$ = "0" THEN            '' No card found, assume Fred card
  1383.             ConfigFile$ = "!hwp2080.cfg"
  1384.  
  1385.         ELSEIF InstalledCard$ = "1" THEN        '' ScanJet Plus card
  1386.             ConfigFile$ = "!hwp1461.cfg"
  1387.  
  1388.         ELSEIF InstalledCard$ = "2" THEN        '' ScanJet Plus card in some Gateways
  1389.             ConfigFile$ = "!hwp1461.cfg"
  1390.  
  1391.         ELSEIF InstalledCard$ = "3" THEN        '' Remington SCSI card
  1392.             ConfigFile$ = "!hwp2002.cfg"
  1393.  
  1394.         ELSEIF InstalledCard$ = "4" THEN        '' Fred SCSI card
  1395.             ConfigFile$ = "!hwp2080.cfg"
  1396.         END IF
  1397.  
  1398.         GOTO GETREFDISK
  1399.  
  1400.     ELSE                                                '' System Architecture is "ISA"
  1401.         GOTO DONE
  1402.     ENDIF
  1403.  
  1404.  
  1405.  
  1406. GETREFDISK:
  1407.     SetSymbolValue "EditTextIn", "A:\"
  1408.     SetSymbolValue "EditFocus", "END"
  1409.  
  1410. GETREFDISKL1:
  1411.     '' ************************************
  1412.     '' *** Backup Reference Disk dialog ***
  1413.     '' ************************************
  1414.     sz$      = UIStartDlg(DS2Cui$, INSERTREF, "FRefDiskDlgProc", 0, "")
  1415.     refDisk$ = GetSymbolValue("EditTextOut")
  1416.     tStr$    = refDisk$
  1417.  
  1418.     IF (MID$(refDisk$,LEN(refDisk$)) <> "\") THEN
  1419.         refDisk$ = tStr$ + "\"
  1420.     END IF
  1421.  
  1422.     IF (sz$ = "CONTINUE") THEN
  1423.         UIPop 1
  1424.  
  1425.         IF (IsDirWritable(refDisk$) = 0) THEN
  1426.             GOSUB BADPATH
  1427.             GOTO GETREFDISKL1
  1428.         END IF
  1429.  
  1430.         CopyFile MakePath(DEST$,ConfigFile$), MakePath(refDisk$,ConfigFile$), cmoNone, 0
  1431.  
  1432.     ELSEIF sz$ = "REACTIVATE" THEN
  1433.         GOTO GETREFDISKL1
  1434.  
  1435.     ELSEIF sz$ = "BACK" THEN
  1436.         UIPop 1
  1437.         GOTO DONE
  1438.  
  1439.     ELSE
  1440.         UIPop 1
  1441.          GOSUB ASKQUIT2
  1442.         GOTO GETREFDISK
  1443.     END IF
  1444.  
  1445. GOTO DONE
  1446.  
  1447.  
  1448.  
  1449. BADPATH:
  1450.     '' ****************************************
  1451.     '' *** Unknown Path or Directory dialog ***
  1452.     '' ****************************************
  1453.     sz$ = UIStartDlg(DS2Cui$, BADPATH, "FInfo0DlgProc", 0, "")
  1454.  
  1455.     IF sz$ = "REACTIVATE" THEN
  1456.         GOTO BADPATH
  1457.     END IF
  1458.  
  1459.     UIPop 1
  1460.     RETURN
  1461.  
  1462.  
  1463.  
  1464. ASKQUIT2:
  1465.     '' *******************************
  1466.     '' *** Incomplete Setup dialog ***
  1467.     '' *******************************
  1468.     sz$ = UIStartDlg(DS2Cui$, ASKQUIT, "FQuitDlgProc", 0, "")
  1469.  
  1470.     IF sz$ = "EXIT" THEN
  1471.         UIPopAll
  1472.         ERROR STFQUIT
  1473.     
  1474.     ELSEIF sz$ = "REACTIVATE" THEN
  1475.         GOTO ASKQUIT2
  1476.  
  1477.     ELSE
  1478.         UIPop 1
  1479.     END IF
  1480.  
  1481.     RETURN
  1482.  
  1483.  
  1484.  
  1485. DONE:
  1486. END SUB
  1487.  
  1488.  
  1489.  
  1490. '*************************************************************************
  1491. '** Subroutine: MakePath
  1492. '** Purpose:    Appends a file name to the end of a directory path,
  1493. '**             inserting a backslash character as needed.
  1494. '** Arguments:
  1495. '**    szDir$   full directory path (with optional ending "\")
  1496. '**    szFile$  filename to append to directory
  1497. '** Returns:     Resulting fully qualified path name.
  1498. '*************************************************************************
  1499. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1500.  
  1501.     IF szDir$ = "" THEN
  1502.         MakePath = szFile$
  1503.  
  1504.     ELSEIF szFile$ = "" THEN
  1505.         MakePath = szDir$
  1506.  
  1507.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1508.         MakePath = szDir$ + szFile$
  1509.  
  1510.     ELSE
  1511.         MakePath = szDir$ + "\" + szFile$
  1512.     END IF
  1513.  
  1514. END FUNCTION
  1515.  
  1516.  
  1517.  
  1518.  
  1519. '*************************************************************************
  1520. '** Subroutine: MyRemoveFiles
  1521. '** Purpose:    Deletes any files from the destination disk that are
  1522. '**             used by the Installer but not by the scanning software.
  1523. '** Arguments:     none.
  1524. '** Returns:     none.
  1525. '** History:    940427 klb Created.
  1526. '*************************************************************************
  1527. SUB MyRemoveFiles STATIC
  1528.  
  1529.     oldcursor% = ShowWaitCursor()
  1530.     
  1531.     IF (DoesFileExist(MakePath(DEST$, "scanjet.inf"), femExists) = 1) THEN
  1532.         RemoveFile MakePath(DEST$, "scanjet.inf"), cmoForce
  1533.     END IF
  1534.  
  1535.     IF (DoesFileExist(MakePath(DEST$, "scanjet.mst"), femExists) = 1) THEN
  1536.         RemoveFile MakePath(DEST$, "scanjet.mst"), cmoForce
  1537.     END IF
  1538.  
  1539.     IF (DoesFileExist(MakePath(DEST$, "ddeml.dll"), femExists) = 1) THEN
  1540.         RemoveFile MakePath(DEST$, "ddeml.dll"), cmoForce
  1541.     END IF
  1542.  
  1543.     IF (DoesFileExist(MakePath(DEST$, "_mstest.exe"), femExists) = 1) THEN
  1544.         RemoveFile MakePath(DEST$, "_mstest.exe"), cmoForce
  1545.     END IF
  1546.  
  1547.     IF (DoesFileExist(MakePath(DEST$, "ds2cui.dll"), femExists) = 1) THEN
  1548.         RemoveFile MakePath(DEST$, "ds2cui.dll"), cmoForce
  1549.     END IF
  1550.  
  1551.     IF (DoesFileExist(MakePath(DEST$, "ds2util.inc"), femExists) = 1) THEN
  1552.         RemoveFile MakePath(DEST$, "ds2util.inc"), cmoForce
  1553.     END IF
  1554.  
  1555.     IF (DoesFileExist(MakePath(DEST$, "ds2util.dll"), femExists) = 1) THEN
  1556.         RemoveFile MakePath(DEST$, "ds2util.dll"), cmoForce
  1557.     END IF
  1558.  
  1559.     IF (DoesFileExist(MakePath(DEST$, "setup.exe"), femExists) = 1) THEN
  1560.         RemoveFile MakePath(DEST$, "setup.exe"), cmoForce
  1561.     END IF
  1562.  
  1563.     IF (DoesFileExist(MakePath(DEST$, "setup.lst"), femExists) = 1) THEN
  1564.         RemoveFile MakePath(DEST$, "setup.lst"), cmoForce
  1565.     END IF
  1566.  
  1567.     IF (DoesFileExist(MakePath(DEST$, "setupapi.inc"), femExists) = 1) THEN
  1568.         RemoveFile MakePath(DEST$, "setupapi.inc"), cmoForce
  1569.     END IF
  1570.  
  1571.     IF (DoesFileExist(MakePath(DEST$, "mscomstf.dll"), femExists) = 1) THEN
  1572.         RemoveFile MakePath(DEST$, "mscomstf.dll"), cmoForce
  1573.     END IF
  1574.  
  1575.     IF (DoesFileExist(MakePath(DEST$, "msdetect.inc"), femExists) = 1) THEN
  1576.         RemoveFile MakePath(DEST$, "msdetect.inc"), cmoForce
  1577.     END IF
  1578.  
  1579.     IF (DoesFileExist(MakePath(DEST$, "msdetstf.dll"), femExists) = 1) THEN
  1580.         RemoveFile MakePath(DEST$, "msdetstf.dll"), cmoForce
  1581.     END IF
  1582.  
  1583.     IF (DoesFileExist(MakePath(DEST$, "msinsstf.dll"), femExists) = 1) THEN
  1584.         RemoveFile MakePath(DEST$, "msinsstf.dll"), cmoForce
  1585.     END IF
  1586.  
  1587.     IF (DoesFileExist(MakePath(DEST$, "msshlstf.dll"), femExists) = 1) THEN
  1588.         RemoveFile MakePath(DEST$, "msshlstf.dll"), cmoForce
  1589.     END IF
  1590.  
  1591.     IF (DoesFileExist(MakePath(DEST$, "msuilstf.dll"), femExists) = 1) THEN
  1592.         RemoveFile MakePath(DEST$, "msuilstf.dll"), cmoForce
  1593.     END IF
  1594.  
  1595.     IF (DoesFileExist(MakePath(DEST$, "expand.exe"), femExists) = 1) THEN
  1596.         RemoveFile MakePath(DEST$, "expand.exe"), cmoForce
  1597.     END IF
  1598.  
  1599. ''    IF (DoesFileExist(MakePath(TwainDir$, "hpdsii.ds"), femExists) = 1) THEN
  1600. ''        RenameFile MakePath(TwainDir$, "hpdsii.ds"), "hpdsii.old"
  1601. ''    END IF
  1602.  
  1603.     RestoreCursor oldcursor
  1604.  
  1605. END SUB
  1606.