home *** CD-ROM | disk | FTP | other *** search
/ Odyssee des Zoombinis / ZOOMBINI.bin / pc / setup.eng / bbinstal.mst < prev    next >
Text File  |  1995-09-11  |  30KB  |  1,092 lines

  1. '**************************************************************************
  2. '*                Generic install script for Broderbund Products
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. ''parse command line for custom commands here
  8. GLOBAL build$
  9. GLOBAL destCfgFile$
  10. GLOBAL srcDirStr$
  11. GLOBAL canChain$
  12. GLOBAL chainWindow%
  13. DECLARE FUNCTION ParseCommand (commFlag$) AS STRING
  14.  
  15. build$ = ParseCommand("B")
  16. destCfgFile$ = build$
  17.  
  18. canChain$ = ParseCommand("X")
  19. temp$ = ParseCommand("P")
  20. IF temp$ <> "" THEN
  21.     chainWindow% = VAL(temp$)
  22. ELSE
  23.     chainWindow% = 0
  24. END IF
  25.  
  26. '$INCLUDE 'setupapi.inc'
  27. '$INCLUDE 'msdetect.inc'
  28. '$INCLUDE 'msregdb.inc'
  29.  
  30. ''Dialog ID's
  31. CONST WELCOME       = 100
  32. CONST NOMIDIWARN    = 101
  33. CONST NOWAVEWARN    = 102
  34. CONST DUPFILE        = 103
  35. CONST ASKQUIT       = 200
  36. CONST FONTERROR        = 201
  37. CONST DESTPATH      = 300
  38. CONST WININIBACKUP    = 301
  39. CONST EXITFAILURE   = 400
  40. CONST EXITQUIT      = 600
  41. CONST EXITSUCCESS   = 700
  42. CONST EXITSUCCESS1  = 701
  43. CONST EXITSUCCESS2  = 702
  44. CONST APPHELP       = 900
  45. CONST MIDILIST        = 1901
  46. CONST EXITINCOMPLETE    = 1902
  47. CONST CUSTINST     = 6200
  48. CONST TOOBIG       = 6300
  49. CONST BADPATH       = 6400
  50.  
  51. ''    Dialog Variable String IDs
  52. CONST    PRODUCTNAME    =    701
  53. CONST    CUSTSUPPNUM    =    702
  54. CONST    SUCCESSCOMMENT = 703
  55. CONST SUCCESSCOMMENT1 = 750
  56. CONST SUCCESSCOMMENT2 = 751
  57. CONST    FILEPATH    = 704
  58. CONST    CHAINTEXT    = 705
  59.  
  60. ''Bitmap ID
  61. CONST LOGO = 1
  62.  
  63. CONST BROADKEY = 30706
  64.  
  65. GLOBAL WINDRIVE$    ''Windows drive letter.
  66. GLOBAL sourceDir$    ''Install from directory.
  67. GLOBAL destDir$     ''Default destination directory.
  68. GLOBAL cfgFile$        ''Config file containing custom info for installer
  69. GLOBAL logFile$        ''Log file for installer activities
  70. GLOBAL filesInstalled%    ''0 = no files installed, 1 = files installed
  71. GLOBAL waveNeeded%    ''0 = wave device not required by product, 1 = wave device is required by product
  72. GLOBAL waveCount%    '' # of wave devices installed on system
  73. GLOBAL midiNeeded%    ''0 = MIDI device not required by product, 1 = MIDI device is required by product
  74. GLOBAL midiCount%    '' # of MIDI devices installed on system
  75. GLOBAL qtwNeeded% '' QuickTime for Windows required
  76. GLOBAL qtwVersion$ '' QuickTime for Windows version that is required
  77. GLOBAL fontsToInstall%    ''0 = no fonts need be installed, 1 = fonts need to be installed
  78. GLOBAL fontsInstalled%    ''0 = not installed, 1 = installed (partial or otherwise)
  79. GLOBAL fontInstallError%    ''0 = no error
  80. GLOBAL wingNeeded% ''0 = WinG not required, 1 = WinG required
  81. GLOBAL winIniBkpFile$    ''Backup name for WIN.INI file
  82. GLOBAL szInf$
  83. GLOBAL prodName$
  84. GLOBAL CUIDLL$
  85. GLOBAL filePathID$
  86. GLOBAL replaceAll%
  87. GLOBAL ExcessNeeded&    ''if > 0, indicates space unavailable for install
  88. GLOBAL sucCom$
  89. GLOBAL qtwSucComm$
  90. GLOBAL cmdLine$
  91. GLOBAL midiCmdLine$
  92. GLOBAL qtwCmdLine$
  93. GLOBAL progGroup$
  94.  
  95. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  96. DECLARE FUNCTION InstantString (varStr$) AS STRING
  97. DECLARE SUB DeinstFiles
  98. DECLARE FUNCTION AddDirToCopyList (theFile$,dir$,srcDir$,dstDir$,silent%) AS INTEGER
  99. DECLARE FUNCTION SetDriveStatus (silent%) AS INTEGER
  100. DECLARE SUB DoRegistrations
  101. DECLARE FUNCTION CreateRegEntries LIB "brodreg.dll" (srcCfgFile$,dstCfgFile$,varTable$,demarChar$) AS INTEGER
  102. DECLARE FUNCTION InstallFonts LIB "brodfont.dll" (installDir$, configFile$, winBackup$) AS INTEGER
  103. DECLARE FUNCTION DeinstallFonts LIB "brodfont.dll" (configFile$, winBackup$) AS INTEGER
  104. DECLARE FUNCTION SetParentWindow LIB "brodutil.dll" (parentWindow%) AS INTEGER
  105. DECLARE FUNCTION DeleteDirectory LIB "brodutil.dll" (directory$,silent%) AS INTEGER
  106. DECLARE FUNCTION DeinstallFiles LIB "brodutil.dll" (directory$,config$,section$,remove%) AS INTEGER
  107. DECLARE FUNCTION NotifyChain LIB "brodutil.dll" (chainWindow%,wParam%,theMess$) AS INTEGER
  108. DECLARE FUNCTION PGInstall LIB "brodpgi.dll" (theFile$,silent%,showGroup%) AS INTEGER
  109. DECLARE FUNCTION PGUninstall LIB "brodpgi.dll" (theFile$,prejudice%) AS INTEGER
  110. DECLARE FUNCTION GetNetPGSize LIB "brodpgi.dll" (theFile$) AS INTEGER
  111. DECLARE FUNCTION SelectMidiDevice LIB "brodmidi.dll" (cmdLine$) AS INTEGER
  112. DECLARE FUNCTION GetDriverCount LIB "brodmidi.dll" (driverType$) AS INTEGER
  113.  
  114. INIT:
  115.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  116.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  117.  
  118.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  119.     IF szInf$ = "" THEN
  120.         szInf$ = GetSymbolValue("STF_CWDDIR") + "BBINSTAL.INF"
  121.     ELSE
  122.         SPLITPATH szInf$,bDrive$,bDir$,bFile$,bExt$
  123.         IF bDrive$ = "" THEN
  124.             szInf$ = GetSymbolValue("STF_CWDDIR")+szInf$
  125.         END IF
  126.     END IF
  127.     ReadInfFile szInf$
  128.  
  129.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  130.     sourceDir$ = GetSymbolValue("STF_SRCDIR")
  131.     IF LEN(sourceDir$) > 3 THEN
  132.         sourceDir$ = Mid$(sourceDir$,1,LEN(sourceDir$)-1)
  133.     END IF
  134.  
  135.  
  136. ''GET CONFIG FILE INFO
  137.     SPLITPATH szInf$,bDrive$,bDir$,bFile$,bExt$
  138.     cfgFile$ = MakePath(sourceDir$,bFile$+".BDF")
  139.     IF DoesFileExist(cfgFile$,femExists) = 1 THEN
  140.         destDir$ = WINDRIVE$+":\"+GetIniKeyString(cfgFile$,"directories","TargetDir")
  141.         IF destDir$ <> "" THEN
  142.             logFile$ = MakePath(destDir$, "LOGFILE.OUT")
  143.         ELSE
  144.             logFile$ = ""
  145.         END IF
  146.         prodName$ = GetIniKeyString(cfgFile$, "product", "ProductName")
  147.         waveNeeded% = VAL(GetIniKeyString(cfgFile$,"general","wavedevice"))
  148.         midiNeeded% = VAL(GetIniKeyString(cfgFile$,"general","mididevice"))
  149.         qtwNeeded% = VAL(GetIniKeyString(cfgFile$,"quicktime","qtwRequired"))
  150.         qtwVersion$ = GetIniKeyString(cfgFile$,"quicktime","qtwVersion")
  151.         fontsToInstall% = VAL(GetIniKeyString(cfgFile$,"general","fontinstall"))
  152.       wingNeeded% = VAL(GetIniKeyString(cfgFile$,"general","wing"))
  153.         sucCom$ = GetIniKeyString(cfgFile$,"general","successcomment")
  154.         ''cmdLine$ = GetIniKeyString(cfgFile$,"general","chaincommand")
  155.         midiCmdLine$ = GetIniKeyString(cfgFile$,"general","chaincommand") ''temporary solution
  156.         qtwCmdLine$ = GetIniKeyString(cfgFile$,"quicktime","qtwCmdLine")
  157.         qtwSucComm$ = GetIniKeyString(cfgFile$,"quicktime","qtwsuccomm")
  158.     ELSEIF build$ <> "" THEN
  159.         cfgFile$ = destCfgFile$
  160.         destDir$ = GetIniKeyString(cfgFile$,"directories","MediaBuildDir")
  161.         IF destDir$ = "" THEN
  162.             destDir$ = WINDRIVE$+":\BRODINST"
  163.         END IF
  164.         IF destCfgFile$ <> "" THEN
  165.             SPLITPATH cfgFile$,bDrive$,bDir$,bFile$,bExt$
  166.             logFile$ = bDrive$+bDir+"LOGFILE.OUT"
  167.         ELSEIF IsDirWritable(sourceDir$) = 1 THEN
  168.             logFile$ = MakePath(sourceDir$, "LOGFILE.OUT")
  169.         ELSE
  170.             logFile$ = ""
  171.         END IF
  172.         prodName$ = "Installer for "+GetIniKeyString(cfgFile$, "product", "ProductName")
  173.         waveNeeded% = 0
  174.         midiNeeded% = 0
  175.         qtwNeeded% = 0
  176.         qtwVersion$ = ""
  177.         fontsToInstall% = 0
  178.       wingNeeded% = 0
  179.         sucCom$ = ""
  180.         cmdLine$ = ""
  181.         midiCmdLine$ = ""
  182.         qtwCmdLine$ = ""
  183.       qtwSucComm$ = ""
  184.     ELSE
  185.         cfgFile$ = ""
  186.         destDir$ = WINDRIVE$+":\BRODINST"
  187.         prodName$ = "Unspecified Product"
  188.         waveNeeded% = 0
  189.         midiNeeded% = 0
  190.         qtwNeeded% = 0
  191.         qtwVersion$ = ""
  192.         fontsToInstall% = 0
  193.         wingNeeded% = 0
  194.         sucCom$ = ""
  195.         cmdLine$ = ""
  196.         midiCmdLine$ = ""
  197.         qtwCmdLine$ = ""
  198.       qtwSucComm$ = ""
  199.         IF IsDirWritable(sourceDir$) = 1 THEN
  200.             logFile$ = MakePath(sourceDir$, "LOGFILE.OUT")
  201.         ELSE
  202.             logFile$ = ""
  203.         END IF
  204.     END IF
  205.  
  206.     filesInstalled% = 0
  207.     waveCount% = 0
  208.     midiCount% = 0
  209.     fontsInstalled% = 0
  210.     fontInstallError% = 0
  211.     winIniBkpFile$ = "WIN.BAK"
  212.     skip% = 0
  213.  
  214.     prodNameID$ = LTRIM$(STR$(PRODUCTNAME))
  215.     AddListItem "VarStringID", prodNameID$
  216.     SetSymbolValue prodNameID$,prodName$
  217.  
  218.     filePathID$ = LTRIM$(STR$(FILEPATH))
  219.     AddListItem "VarStringID", filePathID$
  220.  
  221.     something% = SetParentWindow(HwndFrame())
  222.  
  223.     SetBitmap CUIDLL$, LOGO
  224.     SetTitle GetSymbolValue(prodNameID$)
  225.     ExcessNeeded& = 0
  226.  
  227.     ''CustInst list symbols
  228.     FOR i% = 1 TO 7 STEP 1
  229.         AddListItem "DriveStatusText", ""
  230.     NEXT i%
  231.     IF destDir$ <> "" THEN
  232.         ReplaceListItem "DriveStatusText", 7, destDir$
  233.     END IF
  234.  
  235.     ''Disk cost list symbols
  236.     FOR i% = 1 TO 26 STEP 1
  237.         AddListItem "ExtraCosts", "0"
  238.      NEXT i%
  239.  
  240.     IF build$ <> "" THEN
  241.         srcDirStr$ = GetIniKeyString(cfgFile$, "build", "sourcedir")
  242.     ELSE
  243.         srcDirStr$ = GetIniKeyString(cfgFile$,"directories","sourcedir")
  244.     END IF
  245.  
  246. '$IFDEF DEBUG
  247.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  248.     IF IsDriveValid(WINDRIVE$) = 0 THEN
  249.         i% = DoMsgBox("Windows drive ('"+WINDRIVE$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  250.         GOTO QUIT
  251.     END IF
  252. '$ENDIF ''DEBUG
  253.  
  254.  
  255. WELCOME:
  256.     SetSymbolValue "CENTERWINDOW", "BOTH"
  257.     SetSymbolValue "OFFSETVERTPERC", "-10"
  258.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  259.     IF sz$ = "CONTINUE" THEN
  260.           UIPop 1
  261.     ELSE
  262.         GOSUB ASKQUIT
  263.         GOTO WELCOME
  264.     END IF
  265.  
  266. WAVESELECT:
  267.     IF waveNeeded% = 0 THEN
  268.         GOTO WAVESELECTEND
  269.     END IF
  270.  
  271.     waveCount% = GetDriverCount("wave")
  272.     IF waveCount% > 0 THEN
  273.         GOTO WAVESELECTEND
  274.     END IF
  275.  
  276.     sz$ = UIStartDlg(CUIDLL$,NOWAVEWARN,"FInfoDlgProc",APPHELP,HELPPROC$)
  277.     IF sz$ = "CONTINUE" THEN
  278.         UIPop 1
  279.         AddListItem "IncompleteInstall", "Your system has no wave drivers installed."
  280.         GOTO WAVESELECTEND
  281.     ELSE
  282.         GOSUB ASKQUIT
  283.         GOTO WAVESELECT
  284.     END IF
  285. WAVESELECTEND:
  286.  
  287.  
  288. MIDISELECT:
  289.     IF midiNeeded% = 0 THEN
  290.         GOTO MIDISELECTEND
  291.     END IF
  292.  
  293.     midiCount% = GetDriverCount("midi")
  294.     IF midiCount% > 0 THEN
  295.         IF cmdLine$ <> "" THEN
  296.             cmdLine$ = cmdLine$+";"
  297.             cmdLine$ = cmdLine$+midiCmdLine$
  298.         ELSE
  299.           cmdLine$ = midiCmdLine$
  300.         END IF
  301.         GOTO MIDISELECTEND
  302.     END IF
  303.  
  304.     sz$ = UIStartDlg(CUIDLL$,NOMIDIWARN,"FInfoDlgProc",APPHELP,HELPPROC$)
  305.     IF sz$ = "CONTINUE" THEN
  306.         UIPop 1
  307.         AddListItem "IncompleteInstall", "Your system has no MIDI drivers installed."
  308. ''        cmdLine$ = ""
  309.         GOTO MIDISELECTEND
  310.     ELSE
  311.         GOSUB ASKQUIT
  312.         GOTO MIDISELECT
  313.     END IF
  314. MIDISELECTEND:
  315.  
  316.  
  317. QTWSELECT:
  318.     IF qtwNeeded% = 0 THEN
  319.         GOTO QTWSELECTEND
  320.     ENDIF
  321.  
  322.     verString$ = GetVersionOfFile(GetWindowsSysDir+"QTIM.DLL")
  323.     IF verString$ < qtwVersion$ THEN
  324.         IF GetWindowsMajorVersion() = 3 AND GetWindowsMinorVersion() < 20 THEN
  325.         ELSE
  326.             qtwCmdLine95$ = GetIniKeyString(cfgFile$,"quicktime","qtw95CmdLine")
  327.             IF qtwCmdLine$ <> "" THEN
  328.              qtwCmdLine$ = qtwCmdLine$+";"+qtwCmdLine95$
  329.             END IF
  330.         END IF
  331.     ELSE
  332.         qtwCmdLine$ = ""
  333.         GOTO QTWSELECTEND
  334.     END IF
  335.  
  336.     IF cmdLine$ <> "" THEN
  337.         cmdLine$ = cmdLine$+";"
  338.         cmdLine$ = cmdLine$+qtwCmdLine$
  339.     ELSE
  340.         cmdLine$ = qtwCmdLine$
  341.     END IF
  342. QTWSELECTEND:
  343.  
  344.  
  345. CUSTINST:
  346.     result% = SetDriveStatus(1)
  347.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  348.  
  349.     IF sz$ = "CONTINUE" THEN
  350.         ''Install only if it will fit.
  351.         IF ExcessNeeded& > 0 THEN
  352.             GOSUB TOOBIG
  353.             GOTO CUSTINST
  354.         END IF
  355.         UIPop 1
  356.     ELSEIF sz$ = "PATH" THEN
  357.         GOTO GETPATH
  358.     ELSEIF sz$ = "REACTIVATE" THEN
  359.         GOTO CUSTINST
  360.     ELSEIF sz$ = "EXIT" THEN
  361.         GOSUB ASKQUIT
  362.         GOTO CUSTINST
  363.     ELSEIF sz$ = "BACK" THEN
  364.         UIPop 1
  365.         GOTO WELCOME
  366.     ELSE
  367.         GOSUB ASKQUIT
  368.         GOTO CUSTINST
  369.     END IF
  370.     result% = SetDriveStatus(0)
  371.     IF result% = 1 THEN
  372.         GOTO CUSTINST
  373.     END IF
  374.  
  375.  
  376.     IF fontsToInstall% = 0 THEN
  377.         GOTO GETWINIBKUPEND
  378.     END IF
  379. GETWINIBKUP:
  380.     SetSymbolValue "EditTextIn", winIniBkpFile$
  381.     SetSymbolValue "EditFocus", "END"
  382. GETWINIBKUPL1:
  383.     sz$ = UIStartDlg(CUIDLL$, WININIBACKUP, "FEditDlgProc", APPHELP, HELPPROC$)
  384.     winIniBkpFile$ = GetWindowsDir()+GetSymbolValue("EditTextOut")
  385.  
  386.     IF sz$ = "CONTINUE" THEN
  387.         UIPop 1
  388.     ELSEIF sz$ = "REACTIVATE" THEN
  389.         GOTO GETWINIBKUPL1
  390.     ELSEIF sz$ = "BACK" THEN
  391.         UIPop 1
  392.         GOTO CUSTINST
  393.     ELSE
  394.         GOSUB ASKQUIT
  395.         GOTO GETWINIBKUP
  396.     END IF
  397.  
  398.     CopyFile GetWindowsDir()+"WIN.INI", winIniBkpFile$, cmoOverwrite, 0
  399. GETWINIBKUPEND:
  400.  
  401.  
  402.     ''BEGIN INSTALLATION PROCESS
  403.     listLen% = GetListLength("NEWDIRLIST")
  404.     SetSymbolValue "BASE0$",destDir$
  405.     FOR i% = 1 TO listLen% STEP 1
  406.         theDir$ = InstantString(GetListItem("NEWDIRLIST",i%))
  407.         IF theDir$ <> "" THEN
  408.             CreateDir theDir$, cmoVital
  409.             ReplaceListItem "DIRLIST",i%,theDir$
  410.         END IF
  411.     NEXT
  412.     RemoveSymbol "BASE0$"
  413.  
  414.     IF logFile$ <> "" THEN
  415.         IF build$ = "" THEN
  416.             logFile$ = MakePath(destDir$, "LOGFILE.OUT")
  417.         END IF
  418.         OpenLogFile logFile$, 0
  419.         WriteToLogFile "  Destination directory: '" + destDir$ + "'"
  420.     END IF
  421.  
  422.     ''INSTALL FILES
  423.     filesInstalled% = 1
  424.     CopyFilesInCopyList
  425.     ClearCopyList
  426.  
  427.  
  428.     IF build$ = "" THEN
  429.         IF cfgFile$ <> "" THEN
  430.             ''COPY INSTALLER CONFIG FILE TO DEST DIR, AND UPDATE WITH RUNTIME INFO
  431.             SPLITPATH szInf$,bDrive$,bDir$,bFile$,bExt$
  432.             destCfgFile$ = MakePath(destDir$,bFile$+".CFG")
  433.             CopyFile cfgFile$, destCfgFile$, cmoOverwrite, 0
  434.  
  435.           ''[directories] section contains directory listings with no trailing \
  436.             IF INSTR(LEN(sourceDir$),sourceDir$,"\") > 0 THEN
  437.                 tempString$ = MID$(sourceDir$,1,LEN(sourceDir$)-1)
  438.             ELSE
  439.                 tempString$ = sourceDir$
  440.             END IF
  441.             CreateIniKeyValue destCfgFile$,"directories","InstallFromDir",tempString$, cmoOverwrite
  442.             IF INSTR(LEN(destDir$),destDir$,"\") > 0 THEN
  443.                 tempString$ = MID$(destDir$,1,LEN(destDir$)-1)
  444.             ELSE
  445.                 tempString$ = destDir$
  446.             END IF
  447.             CreateIniKeyValue destCfgFile$,"directories","InstallToDir",tempString$, cmoOverwrite
  448.  
  449.         ''[install] section contains directory listings with a trailing \
  450.             IF INSTR(LEN(sourceDir$),sourceDir$,"\") > 0 THEN
  451.                 tempString$ = sourceDir$
  452.             ELSE
  453.                 tempString$ = sourceDir$+"\"
  454.             END IF
  455.             CreateIniKeyValue destCfgFile$,"install","InstallFromDir",tempString$, cmoOverwrite
  456.  
  457.             IF INSTR(LEN(destDir$),destDir$,"\") > 0 THEN
  458.                 tempString$ = destDir$
  459.             ELSE
  460.                 tempString$ = destDir$+"\"
  461.             END IF
  462.             CreateIniKeyValue destCfgFile$,"install","InstallToDir",tempString$, cmoOverwrite
  463.  
  464.             CreateIniKeyValue destCfgFile$, "install","InstallFromDrive", MID$(sourceDir$,1,1), cmoOverwrite
  465.             CreateIniKeyValue destCfgFile$, "install","InstallToDrive", MID$(destDir$,1,1), cmoOverwrite
  466.         ELSE
  467.             destCfgFile$ = ""
  468.         END IF
  469.     ELSEIF destCfgFile$ <> "" THEN
  470.         CreateIniKeyValue destCfgFile$,"directories","MediaBuildDir",destDir$,cmoOverwrite
  471.     END IF
  472.  
  473.     ''INSTALL FONTS - IF NECESSARY
  474.     IF fontsToInstall% = 0 THEN
  475.         GOTO FONTINSTALLEND
  476.     END IF
  477. FONTINSTALL:
  478.     fontInstallError% = InstallFonts(destDir$,destCfgFile$,winIniBkpFile$)
  479.     IF fontInstallError% > 0 THEN
  480.         sz$ = UIStartDlg(CUIDLL$, FONTERROR, "FQuitDlgProc", 0, "")
  481.         IF sz$ = "EXIT" THEN
  482.             UIPopAll
  483.             ERROR STFQUIT
  484.         ELSEIF sz$ = "REACTIVATE" THEN
  485.             GOTO FONTINSTALL
  486.         ELSE
  487.             UIPop 1
  488.         END IF
  489.         AddListItem "IncompleteInstall", "Fonts are not installed correctly for this product."
  490.     END IF
  491.     fontsInstalled% = 1
  492. FONTINSTALLEND:
  493.  
  494.  
  495.     ''INSTALL PROGRAM GROUP AND PROGRAM GROUP ITEMS
  496.      IF build$ = "" THEN
  497.         progGroup$ = GetIniKeyString(destCfgFile$,"proggroup","groupname")
  498.         CreateProgmanGroup progGroup$,"",cmoVital
  499.         IF GetWindowsMajorVersion() = 3 AND GetWindowsMinorVersion() < 20 THEN
  500.             anerror% = PGInstall(destCfgFile$,1,1)
  501.         ELSE
  502.             anerror% = PGInstall(destCfgFile$,1,6)
  503.         END IF
  504.     END IF
  505.  
  506.     IF INSTR(LEN(sourceDir$),sourceDir$,"\") > 0 THEN
  507.         varTable$ = "INSTALLFROMDIR|"+MID$(sourceDir$,1,LEN(sourceDir$)-1)
  508.     ELSE
  509.         varTable$ = "INSTALLFROMDIR|"+sourceDir$
  510.     END IF
  511.     IF destDir$ <> "" THEN
  512.         IF INSTR(LEN(destDir$),destDir$,"\") > 0 THEN
  513.             varTable$ = varTable$+"|INSTALLTODIR|"+MID$(destDir$,1,LEN(destDir$)-1)
  514.         ELSE
  515.             varTable$ = varTable$+"|INSTALLTODIR|"+destDir$
  516.         END IF
  517.     END IF
  518.  
  519.     result% = CreateRegEntries(cfgFile$,MakePath(destDir$,"install.log"),varTable$,"|")
  520.     ''DoRegistrations
  521.  
  522.     IF logFile$ <> "" THEN
  523.         CloseLogFile
  524.     END IF
  525.  
  526.  
  527. QUIT:
  528.     ON ERROR GOTO ERRQUIT
  529.  
  530.     IF ERR = 0 THEN
  531.         GOTO GOODQUIT
  532.     ELSE
  533.         GOTO BADQUIT
  534.     ENDIF
  535.  
  536. GOODQUIT:
  537.     IF GetListLength("IncompleteInstall") THEN
  538.         SetSymbolValue "ListItemsIn", ""
  539.         FOR i% = 1 TO GetListLength("IncompleteInstall") STEP 1
  540.             AddListItem "ListItemsIn", GetListItem("IncompleteInstall",i%)
  541.         NEXT
  542. INCOMPLETEQUITL1:
  543.         sz$ = UIStartDlg(CUIDLL$,EXITINCOMPLETE,"FList0DlgProc",0,"")
  544.         IF sz$ = "REACTIVATE" THEN
  545.             GOTO INCOMPLETEQUITL1
  546.         END IF
  547.         UIPop 1
  548.         GOTO ENDINSTALL
  549.     ELSEIF cmdLine$ = "" THEN
  550. GOODQUITL0:
  551.         sucComID$ = LTRIM$(STR$(SUCCESSCOMMENT))
  552.         AddListItem "VarStringID", sucComID$
  553.         IF sucCom$ = "" THEN
  554.             sucCom$ = "Have Fun!"
  555.         END IF
  556.         SetSymbolValue sucComID$,sucCom$
  557.  
  558.         sz$ = UIStartDlg(CUIDLL$,EXITSUCCESS,"FList0DlgProc",0,"")
  559.         IF sz$ = "REACTIVATE" THEN
  560.             GOTO GOODQUITL0
  561.         END IF
  562.         UIPop 1
  563.         GOTO ENDINSTALL
  564.     ELSEIF midiCmdLine$ <> "" THEN
  565.         sucCom1$ = sucCom$
  566.         dlg% = EXITSUCCESS1
  567.         IF qtwCmdLine$ <> "" THEN
  568.             sucCom2$ = qtwSucComm$
  569.             dlg% = EXITSUCCESS2
  570.             GOTO TWOCHAIN
  571.         ELSE
  572.             GOTO ONECHAIN
  573.         END IF
  574.     ELSEIF qtwCmdLine$ <> "" THEN
  575.         sucCom1$ = qtwSucComm$
  576.       dlg% = EXITSUCCESS1
  577.         GOTO ONECHAIN
  578.     ELSE
  579.        GOTO GOODQUITL0
  580.     END IF
  581.  
  582. TWOCHAIN:
  583.     sucComID2$ = LTRIM$(STR$(SUCCESSCOMMENT2))
  584.     AddListItem "VarStringID", sucComID2$
  585.     SetSymbolValue sucComID2$,sucCom2$
  586. ONECHAIN:
  587.     sucComID1$ = LTRIM$(STR$(SUCCESSCOMMENT1))
  588.     AddListItem "VarStringID", sucComID1$
  589.     SetSymbolValue sucComID1$,sucCom1$
  590.  
  591.     chainID$ = LTRIM$(STR$(CHAINTEXT))
  592.     AddListItem "VarStringID", chainID$
  593.  
  594. GOODQUITL1:
  595.     IF canChain$ = "Y" THEN
  596.     ''SET VARIABLES FOR COMMAND LINE
  597.     ''SET COMMAND LINE
  598.     ''SEND COMMAND LINE TO PARENT EXECUTABLE
  599.         IF INSTR(LEN(destDir$),destDir$,"\") > 0 THEN
  600.             tempString$ = MID$(destDir$,1,LEN(destDir$)-1)
  601.         ELSE
  602.             tempString$ = destDir$
  603.         END IF
  604.         SetSymbolValue "INSTALLTODIR$",tempString$
  605.         IF INSTR(LEN(sourceDir$),sourceDir$,"\") > 0 THEN
  606.             tempString$ = MID$(sourceDir$,1,LEN(sourceDir$)-1)
  607.         ELSE
  608.             tempString$ = sourceDir$
  609.         END IF
  610.         SetSymbolValue "INSTALLFROMDIR$",tempString$
  611.         SetSymbolValue "WINDOWS$",MID$(GetWindowsDir(),1,LEN(GetWindowsDir())-1)
  612.         SetSymbolValue "WINSYS$",MID$(GetWindowsSysDir(),1,LEN(GetWindowsSysDir())-1)
  613.         anerror% = NotifyChain(chainWindow%,0,InstantString(cmdLine$))
  614.         chainTxt$ = "Press OK to continue"
  615.     ELSE
  616.         chainTxt$ = "Please refer to the documentation for instructions on how to do this."
  617.     END IF
  618.  
  619.     SetSymbolValue chainID$,chainTxt$
  620.  
  621.     sz$ = UIStartDlg(CUIDLL$,dlg%,"FList0DlgProc",0,"")
  622.     IF sz$ = "REACTIVATE" THEN
  623.         GOTO GOODQUITL1
  624.     END IF
  625.     UIPop 1
  626. ENDINSTALL:
  627.     END
  628.  
  629. BADQUIT:
  630.     IF ERR = STFQUIT THEN
  631.         dlg% = EXITQUIT
  632.     ELSE
  633.         dlg% = EXITFAILURE
  634.     END IF
  635.     DeinstFiles
  636. BADQUITL1:
  637.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  638.     IF sz$ = "REACTIVATE" THEN
  639.         GOTO BADQUITL1
  640.     END IF
  641.     UIPop 1
  642.     END
  643.  
  644. ERRQUIT:
  645.     DeinstFiles
  646.     i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  647.     END
  648.  
  649.  
  650. TOOBIG:
  651.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  652.     IF sz$ = "REACTIVATE" THEN
  653.         GOTO TOOBIG
  654.     END IF
  655.     UIPop 1
  656.     RETURN
  657.  
  658.  
  659.  
  660. BADPATH:
  661.      sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  662.     IF sz$ = "REACTIVATE" THEN
  663.         GOTO BADPATH
  664.     END IF
  665.     UIPop 1
  666.     RETURN
  667.  
  668.  
  669.  
  670. ASKQUIT:
  671.     SetSymbolValue "OFFSETVERTPERC", "-20"
  672.     SetSymbolValue "OFFSETHORZPERC", "10"
  673.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  674.     RemoveSymbol "OFFSETHORZPERC"
  675.     SetSymbolValue "OFFSETVERTPERC", "-10"
  676.  
  677.     IF sz$ = "EXIT" THEN
  678.         UIPopAll
  679.         ERROR STFQUIT
  680.     ELSEIF sz$ = "REACTIVATE" THEN
  681.         GOTO ASKQUIT
  682.     ELSE
  683.         UIPop 1
  684.     END IF
  685.     RETURN
  686.  
  687.  
  688. GETPATH:
  689.     SetSymbolValue "EditTextIn", destDir$
  690.     SetSymbolValue "EditFocus", "END"
  691. GETPATHL1:
  692.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  693.  
  694.     IF sz$ = "CONTINUE" THEN
  695.         olddest$ = destDir$
  696.         destDir$ = GetSymbolValue("EditTextOut")
  697.  
  698.         ''Validate new path.
  699.         IF IsDirWritable(destDir$) = 0 THEN
  700.             GOSUB BADPATH
  701.             GOTO GETPATHL1
  702.         END IF
  703.         UIPop 1
  704.  
  705.         ''Truncate display if too long.
  706.         IF LEN(destDir$) > 23 THEN
  707.             ReplaceListItem "DriveStatusText", 7, MID$(destDir$, 1, 23)+"..."
  708.         ELSE
  709.             ReplaceListItem "DriveStatusText", 7, destDir$
  710.         END IF
  711.  
  712.         olddest$ = ""
  713.  
  714.         result% = SetDriveStatus(1)
  715.         GOTO CUSTINST
  716.     ELSEIF sz$ = "REACTIVATE" THEN
  717.         GOTO GETPATHL1
  718.     ELSEIF sz$ = "EXIT" THEN
  719.         GOSUB ASKQUIT
  720.         GOTO GETPATHL1
  721.      ELSEIF sz$ = "BACK" THEN
  722.         UIPop 1
  723.         GOTO CUSTINST
  724.     ELSE
  725.         UIPop 1
  726.         GOTO CUSTINST
  727.     END IF
  728.  
  729.  
  730.  
  731. '**
  732. '** Purpose:
  733. '**     Appends a file name to the end of a directory path,
  734. '**     inserting a backslash character as needed.
  735. '** Arguments:
  736. '**     szDir$  - full directory path (with optional ending "\")
  737. '**     szFile$ - filename to append to directory
  738. '** Returns:
  739. '**     Resulting fully qualified path name.
  740. '*************************************************************************
  741. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  742.     IF szDir$ = "" THEN
  743.         MakePath = szFile$
  744.     ELSEIF szFile$ = "" THEN
  745.         MakePath = szDir$
  746.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  747.         MakePath = szDir$ + szFile$
  748.     ELSE
  749.         MakePath = szDir$ + "\" + szFile$
  750.     END IF
  751. END FUNCTION
  752.  
  753.  
  754. FUNCTION InstantString (varStr$) STATIC AS STRING
  755.  
  756.     newStr$ = ""
  757.  
  758.     strLen% = LEN(varStr$)
  759.     IF strLen = 0 THEN
  760.         GOTO INSTANTSTRINGEXIT
  761.     END IF
  762.  
  763.     strHead% = 1
  764.     WHILE (strHead% > 0)
  765.         dollarPos1% = INSTR(strHead%,varStr$,"$")
  766.         IF dollarPos1% > 0 THEN
  767.             newStr$ = newStr$+MID$(varStr$,strHead%,dollarPos1%-strHead%)
  768.             dollarPos2% = INSTR(dollarPos1% + 1,varStr$,"$")
  769.             IF dollarPos2% > 0 THEN
  770.                 var$ = MID$(varStr$,dollarPos1% + 1,dollarPos2% - dollarPos1%)
  771.                 strHead% = dollarPos2%+1
  772.                 IF strHead% > LEN(varStr$) THEN
  773.                     strHead% = 0
  774.                 END IF
  775.             ELSE
  776.                 var$ = MID$(varStr$,dollarPos1% + 1)
  777.                 strHead% = 0
  778.             END IF
  779.  
  780.             newStr$ = newStr$+GetSymbolValue(UCASE$(var$))
  781.         ELSE
  782.             newStr$ = newStr$+MID$(varStr$,strHead%)
  783.             strHead% = 0
  784.         END IF
  785.     WEND
  786.  
  787. INSTANTSTRINGEXIT:
  788.     InstantString = newStr$
  789.  
  790. END FUNCTION
  791.  
  792.  
  793. FUNCTION AddDirToCopyList(theFile$,dir$,srcDir$,dstDir$,silent%) STATIC AS INTEGER
  794.  
  795.     result% = 0
  796.  
  797.     IF srcDir$ = "" THEN
  798.         GOTO ADDDIRTOCOPYLISTEXIT
  799.     END IF
  800.  
  801.     IF dstDir$ = "" THEN
  802.         GOTO ADDDIRTOCOPYLISTEXIT
  803.     END IF
  804.  
  805.     baseSym$ = MID$(dir$,2,6)
  806. subStrStart% = INSTR(srcDir$,"\SETUP")
  807. IF subStrStart% <> 0 THEN
  808.     srcDir$ = MID$(srcDir$,1,subStrStart%)
  809. END IF
  810.     SetSymbolValue baseSym$,srcDir$
  811.     newSrcDir$ = InstantString(dir$)
  812.     SetSymbolValue baseSym$,dstDir$
  813.     newDstDir$ = InstantString(dir$)
  814.  
  815.     IF dir$ = "$BASE0$" THEN
  816. ''    IF MID$(dir$,1,1) = "$" AND LEN(dir$) = 7 THEN
  817.         RemoveSymbol "DIRLIST"
  818.         RemoveSymbol "NEWDIRLIST"
  819.     END IF
  820.  
  821.     IF DoesDirExist(newDstDir$) = 0 THEN
  822.         AddListItem "DIRLIST",""
  823.         AddListItem "NEWDIRLIST",dir$
  824.     ELSE
  825.         AddListItem "DIRLIST",dir$
  826.         AddListItem "NEWDIRLIST",""
  827.     END IF
  828.  
  829.     IF DoesIniSectionExist(theFile$,dir$) = 1 THEN
  830.         IF silent% = 0 THEN
  831.             i% = 0
  832.             key$ = "f"+RTRIM$(LTRIM$(STR$(i%)))
  833.             curFile$ = GetIniKeyString(theFile$,dir$,""""+key$+"""")
  834.             curFile$ = GetNthFieldFromIniString(curFile$,2)
  835.             halt% = 0
  836.  
  837.             SetSymbolValue "CENTERWINDOW", "BOTH"
  838.  
  839.             WHILE curFile$ <> "" AND halt% = 0
  840.                 fileExists% = DoesFileExist(newDstDir$+"\"+curFile$,femExists)
  841.                 IF fileExists% = 1 AND replaceAll% = 0 THEN
  842.                     SetSymbolValue filePathID$,newDstDir$+"\"+curFile$
  843.                     sz$ = UIStartDlg(CUIDLL$, DUPFILE, "FInfoDlgProc", 0, "")
  844.                     IF sz$ = "CONTINUE" THEN ''this translates to "replace"
  845.                         AddSectionKeyFileToCopyList dir$,key$,newSrcDir$,newDstDir$
  846.                     ELSEIF sz$ = "EXIT" THEN ''this translates to "replace ALL"
  847.                         AddSectionKeyFileToCopyList dir$,key$,newSrcDir$,newDstDir$
  848.                         replaceAll% = 1
  849.                     ELSEIF sz$ = "CANCEL" THEN ''this translates to "stop"
  850.                         halt% = 1
  851.                         result% = 1
  852.                         UIPop 1
  853.                         GOTO ADDDIRTOCOPYLISTEXIT
  854.                     END IF
  855.                     UIPop 1
  856.                 ELSE
  857.                     AddSectionKeyFileToCopyList dir$,key$,newSrcDir$,newDstDir$
  858.                 END IF
  859.  
  860.                 i% = i% + 1
  861.                 key$ = "f"+RTRIM$(LTRIM$(STR$(i%)))
  862.                 curFile$ = GetIniKeyString(theFile$,dir$,""""+key$+"""")
  863.                 curFile$ = GetNthFieldFromIniString(curFile$,2)
  864.             WEND
  865.         ELSE
  866.             AddSectionFilesToCopyList dir$,newSrcDir$,newDstDir$
  867.         END IF
  868.     END IF
  869.  
  870.     IF DoesIniSectionExist(theFile$,dir$+"\") = 1 THEN
  871.         subDirStr$ = GetIniKeyString(theFile$,dir$+"\","""subdirs""")
  872.         i% = 1
  873.         subDir$ = GetNthFieldFromIniString(subDirStr$,i%)
  874.         WHILE subDir$ <> ""
  875.             subDir$ = dir$+"\"+subDir$
  876.             result% = AddDirToCopyList(theFile$,subDir$,srcDir$,dstDir$,silent%)
  877.             IF result% = 1 THEN
  878.                 GOTO ADDDIRTOCOPYLISTEXIT
  879.             END IF
  880.             i% = i% + 1
  881.             subDir$ = GetNthFieldFromIniString(subDirStr$,i%)
  882.         WEND
  883.     END IF
  884.  
  885. ADDDIRTOCOPYLISTEXIT:
  886.     AddDirToCopyList = result%
  887. END FUNCTION
  888.  
  889.  
  890. FUNCTION SetDriveStatus(silent%) STATIC AS INTEGER
  891.  
  892. ''Drive Status Text fields:
  893. ''    1:    installation drive
  894. ''    2:    install drive space required
  895. ''    3:    install drive space available
  896. ''    4:    Windows drive
  897. ''    5:    Windows drive space required
  898. ''    6:    Windows drive space available
  899. ''    7:    Installation path
  900.  
  901.     result% = 0
  902.  
  903.     ''CALCULATE COSTS
  904.     ClearCopyList
  905.     replaceAll% = 0
  906.     result% = AddDirToCopyList (szInf$,"$BASE0$",sourceDir$,destDir$,silent%)
  907.     IF result% = 1 THEN
  908.         ClearCopyList
  909.         GOTO SETDRIVESTATUSEXIT
  910.     END IF
  911.  
  912.     ''ADD FILES DESTINED FOR THE WINDOWS DIRECTORY
  913.     ''SPECIAL NOTE: THIS CRAPPY MSSETUP CAN'T DEAL WITH THE PATH WINDOWS\SYSTEM,
  914.     ''SO FILES DESTINED FOR THE WINDOWS\SYSTEM DIRECTORY SHOULD BE INCLUDED HERE
  915.     IF wingNeeded% = 1 THEN
  916.         IF GetWindowsMajorVersion() = 3 AND GetWindowsMinorVersion() < 20 THEN
  917.             AddSectionFilesToCopyList "$WINDOWS$",sourceDir$,GetWindowsDir()
  918.         END IF
  919.     END IF
  920.  
  921.     i% = 0
  922.     tmpSrcDirStr$ = srcDirStr$
  923.     WHILE tmpSrcDirStr$ <> ""
  924.         temp% = INSTR(tmpSrcDirStr$,",")
  925.         IF temp% > 0 THEN
  926.             curSrcDir$ = MID$(tmpSrcDirStr$,1,temp%-1)
  927.             tmpSrcDirStr$ = MID$(tmpSrcDirStr$,temp%+1)
  928.         ELSE
  929.             curSrcDir$ = MID$(tmpSrcDirStr$,1)
  930.             tmpSrcDirStr$ = ""
  931.         END IF
  932.         i% = i% + 1
  933.         baseStr$ = "$BASE"+RTRIM$(LTRIM$(STR$(i%)))+"$"
  934.         result% = AddDirToCopyList (szInf$,baseStr$,curSrcDir$,destDir$,silent%)
  935.         IF result% = 1 THEN
  936.             ClearCopyList
  937.             GOTO SETDRIVESTATUSEXIT
  938.         END IF
  939.     WEND
  940.     ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  941. ''    ReplaceListItem "ExtraCosts", ndrive%, "10240"
  942.     ReplaceListItem "ExtraCosts", ndrive%, RTRIM$(LTRIM$(STR$(GetNetPGSize(cfgFile$))))
  943.  
  944.     ExcessNeeded& = GetCopyListCost("ExtraCosts", "AppNeeds", "")
  945.  
  946.     drive$ = MID$(destDir$, 1, 1)
  947.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  948.  
  949.     cost& = VAL(GetListItem("AppNeeds", ndrive%))
  950.     IF cost& < 0 THEN
  951.         cost& = 0
  952.     END IF
  953.     free& = GetFreeSpaceForDrive(drive$)
  954.     IF free& < 0 THEN
  955.         free& = 0
  956.     END IF
  957.  
  958.     ReplaceListItem "DriveStatusText", 1, drive$ + ":"
  959.     ReplaceListItem "DriveStatusText", 2, STR$(cost& / 1024) + " K"
  960.     ReplaceListItem "DriveStatusText", 3, STR$(free& / 1024) + " K"
  961.  
  962.     IF drive$ <> WINDRIVE$ THEN
  963.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  964.         cost& = VAL(GetListItem("AppNeeds", ndrive%))
  965.         IF cost& < 0 THEN
  966.             cost& = 0
  967.         END IF
  968.     ELSE
  969.         cost& = 0
  970.     END IF
  971.     IF cost& <> 0 THEN
  972.         free& = GetFreeSpaceForDrive(WINDRIVE$)
  973.         ReplaceListItem "DriveStatusText", 4, WINDRIVE$ + ":"
  974.         ReplaceListItem "DriveStatusText", 5, STR$(cost& / 1024) + " K"
  975.         ReplaceListItem "DriveStatusText", 6, STR$(free& / 1024) + " K"
  976.     ELSE
  977.         ReplaceListItem "DriveStatusText", 4, ""
  978.         ReplaceListItem "DriveStatusText", 5, ""
  979.         ReplaceListItem "DriveStatusText", 6, ""
  980.     END IF
  981.  
  982. SETDRIVESTATUSEXIT:
  983.     SetDriveStatus = result%
  984. END FUNCTION
  985.  
  986.  
  987. SUB DeinstFiles STATIC
  988.  
  989.     listLen% = GetListLength("DIRLIST")
  990.     IF listLen% = 0 THEN
  991.         GOTO DEINSTFILESEXIT
  992.     END IF
  993.  
  994.      clearDirList% = 1
  995.     clearNewDirList% = 1
  996.     SetSymbolValue "BASE0$",destDir$
  997.     FOR i% = listLen% TO 1 STEP -1
  998.         theDir$ = GetListItem("DIRLIST",i%)
  999.         IF theDir$ <> "" THEN
  1000.             theNewDir$ = GetListItem("NEWDIRLIST",i%)
  1001.             IF theNewDir$ <> "" THEN
  1002.                 result% = DeleteDirectory(theDir$,1)
  1003.                 IF result% = 1 THEN
  1004.                     clearNewDirList% = 0
  1005.                 ELSE
  1006.                     ReplaceListItem "DIRLIST",i%,""
  1007.                 END IF
  1008.             ELSE
  1009.                 clearDirList% = 0
  1010.                 IF filesInstalled% = 1 THEN
  1011.                     junk% = DeinstallFiles(InstantString(theDir$),szInf$,theDir$,0)
  1012.                 END IF
  1013.             END IF
  1014.         END IF
  1015.     NEXT
  1016.     RemoveSymbol "BASE0$"
  1017.     IF clearNewDirList% = 1 THEN
  1018.         RemoveSymbol "NEWDIRLIST"
  1019.         IF clearDirList% = 1 THEN
  1020.             RemoveSymbol "DIRLIST"
  1021.         END IF
  1022.     END IF
  1023.  
  1024.     filesInstalled% = 0
  1025.  
  1026. DEINSTFILESEXIT:
  1027. END SUB
  1028.  
  1029.  
  1030. FUNCTION ParseCommand (commFlag$) STATIC AS STRING
  1031.  
  1032.     ParseCommand = ""
  1033.  
  1034.     a% = INSTR(COMMAND$,"/"+commFlag$)
  1035.     IF a% = 0 THEN
  1036.         GOTO PARSECOMMANDEXIT
  1037.     END IF
  1038.  
  1039.     b% = INSTR(a%+1,COMMAND$,"/")
  1040.     IF b% > 0 THEN
  1041.         temp$ = MID$(COMMAND$,a%,b%-a%)
  1042.         C$ = MID$(COMMAND$,b%)
  1043.     ELSE
  1044.         temp$ = MID$(COMMAND$,a%)
  1045.         C$ = ""
  1046.     END IF
  1047.     IF a% > 1 THEN
  1048.         D$ = MID$(COMMAND$,1,a%-1)
  1049.     ELSE
  1050.         D$ = ""
  1051.     END IF
  1052.     COMMAND$ = D$+C$
  1053.     ParseCommand = RTRIM$(LTRIM$(MID$(temp$,3)))
  1054.  
  1055. PARSECOMMANDEXIT:
  1056. END FUNCTION
  1057.  
  1058.  
  1059. SUB DoRegistrations STATIC
  1060.  
  1061.     MakeListFromSectionKeys "REGLIST","REGEDIT"
  1062.     listLen% = GetListLength("REGLIST")
  1063.     IF listLen% = 0 THEN
  1064.         GOTO DOREGISTRATIONSEXIT
  1065.     END IF
  1066.  
  1067.     FOR i%=1 TO listLen% STEP 1
  1068.         key$ = GetListItem("REGLIST",i%)
  1069.         keyValue$ = GetIniKeyString(szInf$,"REGEDIT",""""+key$+"""")
  1070.  
  1071.         IF INSTR(LEN(sourceDir$),destDir$,"\") > 0 THEN
  1072.             tempString$ = MID$(destDir$,1,LEN(destDir$)-1)
  1073.         ELSE
  1074.             tempString$ = destDir$
  1075.         END IF
  1076.         SetSymbolValue "INSTALLTODIR$",tempString$
  1077.         IF INSTR(LEN(sourceDir$),sourceDir$,"\") > 0 THEN
  1078.             tempString$ = MID$(sourceDir$,1,LEN(sourceDir$)-1)
  1079.         ELSE
  1080.             tempString$ = sourceDir$
  1081.         END IF
  1082.         SetSymbolValue "INSTALLFROMDIR$",tempString$
  1083.         SetSymbolValue "WINDOWS$",MID$(GetWindowsDir(),1,LEN(GetWindowsDir())-1)
  1084.         SetSymbolValue "WINSYS$",MID$(GetWindowsSysDir(),1,LEN(GetWindowsSysDir())-1)
  1085.  
  1086.         CreateRegKey key$
  1087.         CreateRegKeyValue key$,InstantString(keyValue$)
  1088.     NEXT
  1089.  
  1090. DOREGISTRATIONSEXIT:
  1091. END SUB
  1092.