home *** CD-ROM | disk | FTP | other *** search
/ Photo Factory for Windows 2.1 / PCD9999.BIN / pfactory / pfactory.mst < prev    next >
Text File  |  1994-06-06  |  44KB  |  1,315 lines

  1. '**************************************************************************
  2. '*PROGRAM:   Setup Program (PHOTO FACTORY FOR WINDOWS) "CD version"
  3. '*DATE:         5-31-94
  4. '*PROGRAMMER Asad Khan/Tim Donnelly
  5. '*    Added KURTOTTO PFRUN Icon option to setup - requires PFRUN be installed
  6. '*
  7. '**************************************************************************
  8. REM '$DEFINE DEBUG  ''Define for script development/debugging
  9.  
  10. '$INCLUDE 'setupapi.inc'
  11. '$INCLUDE 'msdetect.inc'
  12. '$INCLUDE 'msregdb.inc'
  13.  
  14. DECLARE FUNCTION UpdateScript LIB "ssupdate.dll" (szSrcDrive$, szScriptFile$, szDest$, szCDDrive$, szCDVol$, nOffset%) AS INTEGER
  15.  
  16. ''Dialog ID's
  17. CONST WELCOME       = 100
  18. CONST ASKQUIT       = 200
  19. CONST DESTPATH      = 300
  20. CONST EXITFAILURE   = 400
  21. CONST EXITQUIT      = 600
  22. CONST EXITSUCCESS   = 700
  23. CONST APPHELP       = 900
  24. CONST CHECK            = 2500
  25. CONST BADPATH       = 6400
  26. CONST TOOBIG        = 6300
  27. CONST CUSTINST        = 6200
  28. CONST MODIFY        = 9000
  29. CONST MODIFYWIN     = 9010
  30. CONST MODIFYCONTROL = 9020
  31. CONST CHECKDIR        = 9030
  32. CONST NOOPTIONS        = 9040
  33. CONST CDDRIVE        = 9050
  34. CONST RESTART        = 2600
  35. CONST RESTARTII        = 2700
  36.  
  37. ''Bitmap ID
  38. CONST LOGO = 1
  39.  
  40. CONST IDYES = 6
  41. CONST IDNO = 7
  42. CONST MB_YESNO       = 4
  43. CONST MB_ICONQUESTION = 32
  44.  
  45. ''File Types
  46. CONST APPFILES  = 1
  47. CONST OPTFILES1 = 2
  48. CONST OPTFILES2 = 3
  49. CONST DEMOFILES = 4
  50. CONST MIDIFILES = 5
  51. 'CONST VWINFILES = 6
  52.  
  53. CONST PF_ALL  = 1
  54. CONST PF_PROG = 2
  55. CONST PF_DEMO = 3
  56. CONST PF_MIDI = 4
  57. 'CONST PF_VWIN = 5
  58.  
  59. GLOBAL DEST$        ''Default destination directory.
  60. GLOBAL OPTCUR$      ''Option selection from option dialog.
  61. GLOBAL CDROMdrive$
  62. GLOBAL free&
  63. GLOBAL WINDRIVE$
  64. GLOBAL DemoFilesPresent%
  65. GLOBAL midiOffset%
  66. GLOBAL demo1Offset%
  67. GLOBAL demo2Offset%
  68. GLOBAL demo3Offset%
  69. GLOBAL ReadMeFileExists%
  70. GLOBAL Readmefile$
  71. GLOBAL WinSysDir$    
  72. 'GLOBAL VWIN_ALREADY_INSTALLED%
  73. 'GLOBAL VWININSTALLED%
  74.  
  75. ''CustInst list symbol names
  76. GLOBAL APPNEEDS$    ''Option list costs per drive
  77. GLOBAL OPT1NEEDS$
  78. GLOBAL OPT2NEEDS$
  79. GLOBAL DEMONEEDS$
  80. GLOBAL MIDINEEDS$
  81. 'GLOBAL VWINNEEDS$
  82. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  83. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  84.  
  85. ''Dialog list symbol names
  86. GLOBAL CHECKSTATES$
  87. GLOBAL CHECKSTATESIN$
  88. GLOBAL STATUSTEXT$
  89. GLOBAL DRIVETEXT$
  90.  
  91.  
  92. DECLARE SUB AddOptFilesToCopyList (ftype%)
  93. DECLARE SUB RecalcOptFiles (ftype%)
  94. DECLARE SUB RecalcPath (ftype%)
  95. DECLARE SUB SetDriveStatus
  96.  
  97. DECLARE SUB Install
  98. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  99.  
  100.  
  101. INIT:
  102.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  103.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  104.     CHECKSTATESIN$ = "CheckItemsIn"
  105.     DRIVELIST$ = "ValidDrives"
  106.     
  107.     SetBitmap CUIDLL$, LOGO
  108.     SetTitle "Photo Factory for Windows Setup"
  109.     
  110.     WinSysDir$ = GetWindowsSysDir()
  111. '    VWININSTALLED% = 0
  112.     
  113.     MajorVer% = GetWindowsMajorVersion()
  114.     MinorVer% = GetWindowsMinorVersion()
  115.  
  116.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  117.       i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  118.       END
  119.     END IF
  120.     
  121.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  122.     IF szInf$ = "" THEN
  123.         szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  124.     END IF
  125.     ReadInfFile szInf$
  126.  
  127.     OPTCUR$ = "1"
  128.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  129.     DEST$ = WinDrive$ + ":\PFACTORY"
  130.     
  131.     midiOffset% = GetMaxImages("SSINFO", ";midiOffset", szInf$)
  132.     demo1Offset% = GetMaxImages("SSINFO", ";demo1Offset", szInf$)
  133.     demo2Offset% = GetMaxImages("SSINFO", ";demo2Offset", szInf$)
  134.     demo3Offset% = GetMaxImages("SSINFO", ";demo3Offset", szInf$)
  135.     
  136.     ''DemoFiles CustInst list symbols
  137.     CHECKSTATESIN$ = "CheckItemsIn"
  138.     OPTGREYED$ = "optGreyed"
  139.     
  140.     Max1% = GetMaxImages("SSINFO", ";NbrOfSlideShows", szInf$)
  141.     IF Max1% < 1 THEN
  142.        DemoFilesPresent% = 0
  143.        For i% = 1 TO 2 STEP 1
  144.           AddListItem OPTGREYED$, STR$(i%)
  145.        NEXT i%
  146.     ELSE
  147.        DemoFilesPresent% = 1
  148.        '5-31-94 TAD added KURTOTTO option 
  149.        'CHECKSTATESIN$ reflects settings in the
  150.        '  Options Setup Dialog
  151.        '  1 => 800x600 sld
  152.        '  2 => 640x480 sld
  153.        '  3 => PhotoCD sld
  154.        '  4 => Kurt Otto sld
  155.        For i% = 1 TO 4 STEP 1
  156.           AddListItem CHECKSTATESIN$, "ON"
  157.        NEXT i%
  158. '       For j% = i% TO 2 STEP 1
  159. '          AddListItem OPTGREYED$, STR$(j%)
  160. '      NEXT j%
  161.     END IF
  162.     
  163.     ''CustInst list symbols
  164.     CHECKSTATES$ = "CheckItemsState"
  165.     STATUSTEXT$  = "StatusItemsText"
  166.     DRIVETEXT$   = "DriveStatusText"
  167.     FOR i% = 1 TO 3 STEP 1
  168.         AddListItem CHECKSTATES$, "ON"
  169.     NEXT i%
  170.     IF DemoFilesPresent% = 0 THEN
  171.        AddListItem "OptionsGreyed", "4"
  172.        SetSymbolValue "ButtonGreyed", "OFF"
  173.     ELSE
  174.        AddListItem CHECKSTATES$, "ON"
  175.        AddListItem CHECKSTATES$, "ON"
  176.     END IF
  177.     
  178.     'assuming that demo files, and midi galleries are present to begin with,
  179.     'we will add the video for windows list item (provided that operating system is not
  180.     'WindowsNT)
  181.        
  182. '    IF OnWindowsNT() THEN
  183. '      AddListItem CHECKSTATES$, "OFF"
  184. '      AddListItem "OptionsGreyed", "6"
  185. '    ELSE
  186. '      AddListItem CHECKSTATES$, "OFF"
  187. '    END IF
  188.     
  189.     FOR i% = 1 TO 5 STEP 1
  190.        AddListItem STATUSTEXT$, ""
  191.     NEXT i%
  192.     FOR i% = 1 TO 7 STEP 1
  193.         AddListItem DRIVETEXT$, ""
  194.     NEXT i%
  195.     ReplaceListItem DRIVETEXT$, 7, DEST$
  196.  
  197.     ''Disk cost list symbols
  198.     APPNEEDS$   = "AppNeeds"
  199.     OPT1NEEDS$  = "Opt1Needs"
  200.     OPT2NEEDS$  = "Opt2Needs"
  201.     DEMONEEDS$  = "DemoNeeds"
  202.     MIDINEEDS$  = "MidiNeeds"
  203. '    VWINNEEDS$  = "VWinNeeds"
  204.     EXTRACOSTS$ = "ExtraCosts"
  205.     BIGLIST$    = "BigList"
  206.     FOR i% = 1 TO 5 STEP 1
  207.         AddListItem BIGLIST$, ""
  208.     NEXT i%
  209.     FOR i% = 1 TO 26 STEP 1
  210.         AddListItem EXTRACOSTS$, "0"
  211.     NEXT i%
  212.  
  213.     RecalcPath  PF_ALL
  214.     SetDriveStatus
  215.     
  216.  
  217. '$IFDEF DEBUG
  218.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  219.     IF IsDriveValid(WinDrive$) = 0 THEN
  220.         i% = 1
  221.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  222.         dlg% = EXITFAILURE
  223.        GOTO QUITL1 
  224.     END IF
  225. '$ENDIF ''DEBUG
  226.  
  227.  
  228. WELCOME:
  229.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  230.     IF sz$ = "CONTINUE" THEN
  231.         UIPop 1
  232.     ELSE
  233.         GOSUB ASKQUIT
  234.         GOTO WELCOME
  235.     END IF
  236.  
  237.  
  238. CUSTINST:
  239.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  240.  
  241.     IF sz$ = "CONTINUE" THEN
  242.         ''Install only if it will fit.
  243.         FOR i% = 1 TO 5 STEP 1
  244.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  245.                 GOSUB TOOBIG
  246.                 GOTO CUSTINST
  247.             END IF
  248.         NEXT i%
  249.         UIPop 1
  250.         GOTO CHECKOPTIONS
  251.     ELSEIF sz$ = "PATH" THEN     'Set Location button
  252.         GOTO GETPATH
  253.     ELSEIF sz$ = "CHK1" THEN    'Photo Factory Checkbox
  254.         RecalcPath  PF_PROG
  255.         SetDriveStatus
  256.         GOTO CUSTINST
  257.     ELSEIF sz$ = "CHK2" THEN    'Runtime Player Checkbox
  258.         'RecalcOptFiles OPTFILES1
  259.         RecalcPath  PF_PROG
  260.         SetDriveStatus
  261.         GOTO CUSTINST
  262.     ELSEIF sz$ = "CHK3" THEN    'Screen Saver Checkbox
  263.         RecalcPath  PF_PROG
  264.         SetDriveStatus
  265.         GOTO CUSTINST
  266.     ELSEIF sz$ = "CHK4" THEN    'Slideshow Options Checkbox
  267.         '5-31-94 TAD
  268.         '      800x600                                                     640x480                                    PhotoCD sld                                    KurtOtto
  269.         IF (GetListItem(CHECKSTATESIN$, 1) = "OFF") AND (GetListItem(CHECKSTATESIN$, 2) = "OFF") AND (GetListItem(CHECKSTATESIN$, 3) = "OFF") AND (GetListItem(CHECKSTATESIN$, 4) = "OFF")THEN
  270.           ReplaceListItem CHECKSTATES$, 4, "OFF"
  271.           GOTO CUSTINST
  272.         END IF
  273.         RecalcPath  PF_DEMO
  274.         SetDriveStatus
  275.         GOTO CUSTINST
  276.     ELSEIF sz$ = "CHK5" THEN    'MIDI Gallery Checkbox
  277.         RecalcPath  PF_MIDI
  278.         SetDriveStatus
  279.         GOTO CUSTINST
  280.     'ELSEIF sz$ = "CHK6" THEN    'Pyschotron-Video for Window option
  281.     '    RecalcPath  PF_VWIN
  282.     '    SetDriveStatus
  283.     '    GOTO CUSTINST
  284.     ELSEIF sz$ = "BTN4" THEN    'Slide Show Options select
  285.         GOTO DEMOOPTFILES
  286.     ELSEIF sz$ = "REACTIVATE" THEN
  287.         RecalcPath  PF_ALL
  288.         SetDriveStatus
  289.         GOTO CUSTINST
  290.     ELSE
  291.         GOSUB ASKQUIT
  292.         GOTO CUSTINST
  293.     END IF
  294.  
  295.  
  296. GETPATH:
  297.     SetSymbolValue "EditTextIn", DEST$
  298.     SetSymbolValue "EditFocus", "END"
  299. GETPATHL1:
  300.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  301.  
  302.     IF sz$ = "CONTINUE" THEN
  303.         olddest$ = DEST$
  304.         DEST$ = GetSymbolValue("EditTextOut")
  305.  
  306.         ''Validate new path.
  307.         IF IsDirWritable(DEST$) = 0 THEN
  308.             GOSUB BADPATH
  309.             GOTO GETPATHL1
  310.         END IF
  311.         UIPop 1
  312.  
  313.         ''Truncate display if too long.
  314.         IF LEN(DEST$) > 23 THEN
  315.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  316.         ELSE
  317.             ReplaceListItem DRIVETEXT$, 7, DEST$
  318.         END IF
  319.  
  320.         ''Recalc if path changed.
  321.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  322.             RecalcPath  PF_ALL
  323.             SetDriveStatus
  324.         END IF
  325.  
  326.         olddest$ = ""
  327.         GOTO CUSTINST
  328.     ELSEIF sz$ = "REACTIVATE" THEN
  329.         RecalcPath   PF_ALL
  330.         SetDriveStatus
  331.         GOTO GETPATHL1
  332.     ELSEIF sz$ = "EXIT" THEN
  333.         GOSUB ASKQUIT
  334.         GOTO GETPATHL1
  335.     ELSE                                                                                    
  336.         UIPop 1
  337.         GOTO CUSTINST
  338.     END IF
  339.  
  340.  
  341. CHECKOPTIONS:
  342. '     IF GetListItem(CHECKSTATES$, VWINFILES) = "ON" THEN
  343. '       IF DoesFileExist(MakePath(WinSysDir$, "msvideo.dll"), femExists) = 0 THEN
  344. '         OPTCUR$ = "Choosing Psychotron Demo option will install Video For Windows 1.1a on your system. Do you want to continue?"
  345. '       ELSE 
  346. '         'IF (lver1& = 1) AND ((lver2& = 1) OR (lver2& = 10)) THEN
  347. '         '  REM VWIN_ALREADY_INSTALLED% = 1
  348. '         'ELSE
  349. '           tmp$ = "Setup has detected the presence of a previous version of Video For Windows on your system"
  350. '           OPTCUR$ = tmp$ + ". Choosing Psychotron Demo option will Overwrite this version of Video For Windows with Version 1.1a. Do you want to continue?"
  351. '         'END IF
  352. '       END IF
  353. '       
  354. '       REM IF VWIN_ALREADY_INSTALLED = 0 THEN
  355. '         i% = DoMsgBox(OPTCUR$, "Photo Factory Setup", MB_ICONQUESTION+MB_YESNO)
  356. '         IF i% = IDNO THEN
  357. '           GOTO CUSTINST
  358. '         END IF
  359. '       REM END IF  
  360. '     
  361. '     ELSE
  362.        IF GetListItem(CHECKSTATES$, APPFILES) = "OFF" THEN
  363.          IF GetListItem(CHECKSTATES$, OPTFILES1) = "OFF" THEN
  364.            IF GetListItem(CHECKSTATES$, OPTFILES2) = "OFF" THEN
  365.              IF GetListItem(CHECKSTATES$, MIDIFILES) = "OFF" THEN
  366.                'IF GetListItem(CHECKSTATES$, VWINFILES) = "OFF" THEN
  367.                  IF GetListItem(CHECKSTATES$, DEMOFILES) = "OFF" THEN
  368.                    GOSUB NOOPTIONS
  369.                    GOTO CUSTINST
  370.                  ELSE
  371.                    IF GetListItem(CHECKSTATESIN$, 1) = "OFF" THEN
  372.                      IF GetListItem(CHECKSTATESIN$, 2) = "OFF" THEN
  373.                        IF GetListItem(CHECKSTATESIN$, 3) = "OFF" THEN
  374.                          IF GetListItem(CHECKSTATESIN$, 4) = "OFF" THEN
  375.                            GOSUB NOOPTIONS
  376.                            GOTO CUSTINST
  377.                          END IF
  378.                        END IF
  379.                      END IF
  380.                    END IF
  381.                  END IF      
  382.                'END IF  
  383.              END IF
  384.            END IF
  385.          END IF
  386.        END IF      
  387.        
  388. '     END IF  
  389.      
  390.      
  391. DIRINFO:
  392.     IF DoesDirExist(DEST$) = 1 THEN
  393. CHECKDIRMAIN:
  394.       SetSymbolValue "EditTextIn", DEST$
  395.       SetSymbolValue "EditFocus", "END"
  396. CHECKDIR:
  397.       sz$ = UIStartDlg(CUIDLL$, CHECKDIR, "FEditDlgProc", APPHELP, HELPPROC$)
  398.       IF sz$ = "CONTINUE" THEN
  399.         UIPop 1
  400.         'GOTO CDINFO
  401.       ELSEIF sz$ = "REACTIVATE" THEN
  402.          GOTO CHECKDIR
  403.       ELSEIF sz$ = "BACK" THEN
  404.          UIPop 1
  405.          GOTO GETPATHL1
  406.       ELSE
  407.          GOSUB ASKQUIT
  408.          GOTO CHECKDIRMAIN
  409.       END IF  
  410.     END IF
  411.  
  412. CDINFO:
  413.     '*******************************************************
  414.     'GetValidDrivesList DRIVELIST$
  415.     'GetRemovableDrivesList DRIVELIST$
  416.     GetNetworkDrivesList DRIVELIST$
  417.     
  418.     length% = GetListLength (DRIVELIST$)
  419.     
  420.     CDROMdrive$ = "C"
  421.     
  422.     FOR i% = 1 TO length% STEP 1
  423.       CurrentDrive$ = GetListItem (DRIVELIST$, i%)
  424.       'r1% = DoMsgBox (CurrentDrive$, "NETWORK DRIVE", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  425.       r1% = DoesDirExist (CurrentDrive$ + ":\")  
  426.       IF r1 = 0 THEN
  427.         
  428.         r1% = IsDirWritable (CurrentDrive$ + ":\")
  429.         IF r1 = 0 THEN
  430.           'r1% = DoMsgBox (CurrentDrive$, "CDROM DRIVE", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  431.           AddListItem "CD_DRIVES", CurrentDrive$
  432.           CDROMdrive$ = CurrentDrive$
  433.           'GOTO STARTINSTALL
  434.         END IF
  435.         
  436.       END IF
  437.       
  438.     NEXT i%
  439.     
  440.     length% = GetListLength ("CD_DRIVES")
  441.     
  442.     IF length% = 3 THEN
  443.       tmp$ = "Setup has detected three CDROM Drives " + CHR$(10) + "in your system:" + CHR$(10) + "                " + GetListItem ("CD_DRIVES", 1)
  444.       tmp$ = tmp$ + ", " + GetListItem ("CD_DRIVES", 2) + ", " + GetListItem ("CD_DRIVES", 3) 
  445.       OPTCUR$ = tmp$ + CHR$(10) + "In the Dialog Box that follows, please" + CHR$(10) + "specify the Drive you want to use."
  446.       r1% = DoMsgBox (OPTCUR$, "Photo Factory Setup", MB_OK+MB_TASKMODAL)
  447.     ELSEIF length = 2 THEN
  448.       tmp$ = "Setup has detected two CDROM Drives" + CHR$(10) + "in your system:" + CHR$(10) + "                " + GetListItem ("CD_DRIVES", 1) + ", " + GetListItem ("CD_DRIVES", 2)
  449.       OPTCUR$ = tmp$ + CHR$(10) + "In the Dialog Box that follows, please" + CHR$(10) + "specify the Drive you want to use"
  450.       r1% = DoMsgBox (OPTCUR$, "Photo Factory Setup", MB_OK+MB_TASKMODAL)  
  451.     ELSEIF length = 1 THEN
  452.       GOTO STARTINSTALL
  453.     END IF  
  454.     
  455.     IF length > 0 THEN
  456.       RemoveSymbol "CD_DRIVES"
  457.     END IF
  458.     
  459.     '*******************************************************
  460.     
  461. GETCDDRIVE:
  462.     SetSymbolValue "EditTextIn", CDROMdrive$
  463.     SetSymbolValue "EditFocus", "START"
  464. GETCD:
  465.     sz$ = UIStartDlg(CUIDLL$, CDDRIVE, "FEditDlgProc", APPHELP, HELPPROC$)
  466.     IF sz$ = "CONTINUE" THEN
  467.       UIPop 1
  468.     ELSEIF sz$ = "REACTIVATE" THEN
  469.        GOTO GETCD
  470.     ELSEIF sz$ = "BACK" THEN
  471.        UIPop 1
  472.        SetSymbolValue "EditTextIn", DEST$
  473.        GOTO CUSTINST
  474.     ELSE
  475.        GOSUB ASKQUIT
  476.        GOTO GETCDDRIVE
  477.     END IF  
  478.  
  479.     tmp$ = GetSymbolValue("EditTextOut")
  480.     tmp$ = MID$(UCASE$(LTRIM$(tmp$)),1,1)
  481.                                  
  482.     IF ASC(tmp$) >= 65 AND ASC(tmp$) <=90 THEN
  483.       CDROMdrive$ = tmp$
  484.     ELSE
  485.       GOTO GETCDDRIVE
  486.     END IF
  487.                                          
  488. '    CDROMdrive$ = GetSymbolValue("EditTextOut")
  489.  
  490. STARTINSTALL:    
  491.     
  492.     Install
  493.  
  494.     IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  495.         IF GetListItem(CHECKSTATES$, OPTFILES2) = "ON" THEN
  496.           dlg% = MODIFY
  497.           GOSUB MODIFY
  498.         ELSE
  499.           dlg% = MODIFYWIN
  500.           GOSUB MODIFY
  501.         ENDIF
  502.     ELSEIF GetListItem(CHECKSTATES$, OPTFILES2) = "ON" THEN
  503.         dlg% = MODIFYCONTROL
  504.         GOSUB MODIFY
  505.     END IF 
  506.  
  507.  
  508. QUIT:
  509.     ON ERROR GOTO ERRQUIT
  510.  
  511.     IF ERR = 0 THEN
  512.         dlg% = EXITSUCCESS
  513.     ELSEIF ERR = STFQUIT THEN
  514.         dlg% = EXITQUIT
  515.     ELSE
  516.         dlg% = EXITFAILURE
  517.     END IF
  518. QUITL1:
  519.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  520.     IF sz$ = "REACTIVATE" THEN
  521.         GOTO QUITL1
  522.     END IF
  523.     UIPop 1
  524.  
  525.     IF dlg% = EXITSUCCESS THEN
  526.       
  527.       IF ReadMeFileExists% = 1 THEN
  528.         tmp$ = "notepad " + Readmefile$
  529.         CreateProgmanItem "Photo Factory", "Read Me", tmp$, "", cmoOverwrite
  530.       END IF
  531.       
  532. '      IF VWININSTALLED% = 1 THEN
  533.         
  534.           '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  535.          '' else, it gives the user the choice
  536. '         RESTRT% = RestartListEmpty ()
  537. '         Exe$ = DEST$ + "\_msrstrt.exe"
  538. '         Batch$ = DEST$ + "\_mssetup.bat"
  539. '         empty$ = ""
  540.         
  541. '         RESTART:
  542. '            IF RESTRT% = 0 THEN
  543. '                 sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  544. '                 IF sz$ = "REACTIVATE" THEN
  545. '                  GOTO RESTART
  546. '                 ENDIF
  547. '                 I% = ExitExecRestart ()
  548. '                 RemoveFile Exe$, cmoForce
  549. '                 RemoveFile Batch$, cmoForce
  550. '                 END
  551. '            ELSE
  552. '                 sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  553. '                 IF sz$ = "CONTINUE" THEN
  554. '                 I% = ExitWindowsExec (Exe$, empty$)
  555. '                 IF I% = 0 THEN
  556. '                   GOTO RESTART
  557. '                 ELSE
  558. '                   END
  559. '                 ENDIF
  560. '                 ELSEIF sz$ = "EXIT" THEN
  561. '                UIPopAll
  562. '                END
  563. '              ELSEIF sz$ = "REACTIVATE" THEN
  564. '                GOTO RESTART
  565. '              ELSE
  566. '                UIPop 1
  567. '              END IF
  568. '    
  569. '            END IF
  570.             
  571. '      ENDIF
  572.       
  573.     END IF
  574.     
  575.     END
  576.     
  577.     
  578. ERRQUIT:
  579.     i% = DoMsgBox("Setup sources were corrupted, call (800) 597-PHOTO!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  580.     END
  581.  
  582. BADPATH:
  583.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  584.     IF sz$ = "REACTIVATE" THEN
  585.         GOTO BADPATH
  586.     END IF
  587.     UIPop 1
  588.     RETURN
  589.  
  590.  
  591. DEMOOPTFILES:
  592.     sz$ = UIStartDlg(CUIDLL$, CHECK, "FCheckDlgProc", APPHELP, HELPPROC$)
  593.     
  594.     IF sz$ = "CONTINUE" THEN
  595.         UIPop 1
  596.         RecalcPath   PF_DEMO
  597.         SetDriveStatus
  598.         '5-31-94 TAD
  599.         IF (GetListItem(CHECKSTATESIN$, 1) = "OFF") AND (GetListItem(CHECKSTATESIN$, 2) = "OFF") AND (GetListItem(CHECKSTATESIN$, 3) = "OFF") AND (GetListItem(CHECKSTATESIN$, 4) = "OFF") THEN
  600.           ReplaceListItem CHECKSTATES$, 4, "OFF"
  601.         END IF
  602.         GOTO CUSTINST
  603.     ELSEIF sz$ = "REACTIVATE" THEN
  604.         GOTO DEMOOPTFILES
  605.     ELSEIF sz$ = "EXIT" THEN
  606.         GOSUB ASKQUIT
  607.         GOTO DEMOOPTFILES
  608.     ELSE
  609.         GOTO DEMOOPTFILES
  610.     END IF
  611.  
  612.  
  613. TOOBIG:
  614.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  615.     IF sz$ = "REACTIVATE" THEN
  616.         RecalcPath   PF_ALL
  617.         SetDriveStatus
  618.         GOTO TOOBIG
  619.     END IF
  620.     UIPop 1
  621.     RETURN
  622.  
  623.  
  624. MODIFY:
  625.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  626.     IF sz$ = "REACTIVATE" THEN
  627.         GOTO MODIFY
  628.     END IF
  629.     UIPop 1
  630.     RETURN
  631.  
  632. NOOPTIONS:
  633.     sz$ = UIStartDlg(CUIDLL$, NOOPTIONS, "FQuitDlgProc", 0, "")
  634.  
  635.     IF sz$ = "EXIT" THEN
  636.         UIPopAll
  637.         ERROR STFQUIT
  638.     ELSEIF sz$ = "REACTIVATE" THEN
  639.         GOSUB ASKQUIT
  640.     ELSE
  641.         UIPop 1
  642.     END IF
  643.     RETURN
  644.  
  645.  
  646. ASKQUIT:
  647.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  648.  
  649.     IF sz$ = "EXIT" THEN
  650.         UIPopAll
  651.         ERROR STFQUIT
  652.     ELSEIF sz$ = "REACTIVATE" THEN
  653.         GOTO ASKQUIT
  654.     ELSE
  655.         UIPop 1
  656.     END IF
  657.     RETURN
  658.  
  659. '**
  660. '** Purpose:
  661. '**     Builds the copy list and performs all installation operations.
  662. '** Arguments:
  663. '**     none.
  664. '** Returns:
  665. '**     none.
  666. '*************************************************************************
  667. SUB Install STATIC
  668.  
  669.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  670.     CreateDir DEST$, cmoNone
  671.     WinDir$ = GetWindowsDir()
  672.     szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  673.     SetRestartDir DEST$
  674.     
  675.     ClearCopyList
  676.     
  677.     PFFLAG% = 0
  678.     COMMONFILESFLAG% = 0
  679.     
  680.     IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  681.       AddSectionFilesToCopyList "OPTION1", SrcDir$, DEST$
  682.       PFFLAG% = 1
  683.     END IF
  684.     IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  685.       AddSectionFilesToCopyList "OPTION11", SrcDir$, DEST$
  686.       PFFLAG% = 1
  687.     END IF
  688.     
  689.     IF PFFLAG% = 1 THEN
  690.       AddSectionFilesToCopyList "FILES", SrcDir$, DEST$
  691.       COMMONFILESFLAG% = 1
  692.     END IF
  693.     
  694.     IF GetListItem(CHECKSTATES$, OPTFILES2) = "ON" THEN    
  695.       AddSectionFilesToCopyList "OPTION2", SrcDir$, DEST$     
  696.       PFFLAG% = 2
  697.     END IF
  698.     
  699. '    IF GetListItem(CHECKSTATES$, VWINFILES) = "ON" THEN    
  700. '      PFFLAG% = 3
  701. '      'IF VWIN_ALREADY_INSTALLED = 0 THEN
  702. '        AddSectionFilesToCopyList "PSY-ICON", SrcDir$, DEST$
  703. '        AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  704. '        AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  705. '        AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  706. '        AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  707. '        AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  708. '        AddSectionFilesToCopyList "Indeo-ini", SrcDir$, WinDir$
  709. '      'END IF
  710. '    END IF
  711.     
  712.     '***************************************************
  713.     '*************Slide Show Setup
  714.  
  715.     IF  DemoFilesPresent% = 1 THEN
  716.       
  717.       IF ((GetListItem(CHECKSTATES$, MIDIFILES) = "ON") OR ((GetListItem(CHECKSTATES$, DEMOFILES) = "ON") AND ((GetListItem(CHECKSTATESIN$, 1) = "ON") OR (GetListItem(CHECKSTATESIN$, 2) = "ON")))) THEN
  718.         AddSectionFilesToCopyList "COMMON_ALL", SrcDir$, DEST$
  719.       END IF  
  720.       
  721.       IF GetListItem(CHECKSTATES$, MIDIFILES) = "ON" THEN
  722.         AddSectionFilesToCopyList "SSGROUP4", SrcDir$, DEST$
  723.         AddSectionFilesToCopyList "SSGROUP1", SrcDir$, DEST$
  724.         PFFLAG% = 1
  725.       END IF
  726.       
  727.       IF GetListItem(CHECKSTATES$, DEMOFILES) = "ON" THEN
  728. REM        szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  729.         Max% = GetMaxImages("SSINFO", ";NbrOfSlideShows", szInf$)
  730.         
  731.         IF ((GetListItem(CHECKSTATESIN$, 1) = "ON") OR (GetListItem(CHECKSTATESIN$, 2) = "ON")) THEN
  732.           AddSectionFilesToCopyList "COMMON_600_AND_800", SrcDir$, DEST$
  733.         END IF
  734.         
  735.         IF (GetListItem(CHECKSTATESIN$, 3) = "ON") THEN
  736.           AddSectionFilesToCopyList "PCD_SLD", SrcDir$, DEST$
  737.         END IF
  738.         
  739.         IF Max > 0 THEN
  740.           PFFLAG% = 1
  741.           FOR i% = 2 TO Max STEP 1 
  742.  
  743. 'SSGROUP1 => MIDIOPTION
  744. 'SSGROUP2 => 800x600 Option
  745. 'SSGROUP3 => 640x480 Option
  746. 'SSGROUP4 => Photo CD Option - only if MIDI Gallery is OFF
  747. 'SSGROUP5 => KURTOTTO Option
  748.  
  749.             IF GetListItem(CHECKSTATESIN$, i% - 1) = "ON" THEN
  750.               s$ = "SSGROUP" + MID$(STR$(i), 2, 2)
  751.               IF (i% <> 4) OR (GetListItem(CHECKSTATES$, MIDIFILES) = "OFF") THEN 
  752.                 AddSectionFilesToCopyList s$, SrcDir$, DEST$     
  753.               END IF
  754.             END IF
  755.  
  756.           NEXT i%
  757.         END IF
  758.  
  759.       END IF
  760.     
  761.     END IF  
  762.     '***************************************************
  763.     
  764.     ReadMeFileExists% = 0
  765. REM    szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  766.     s$ = GetPfImageName("SSINFO", ";readmefile", szInf$)
  767.     
  768.     IF s$ <> "" THEN
  769.       Srcfile$ = MakePath(SrcDir$, s$)
  770.       Readmefile$ = MakePath(DEST$, s$)
  771.       'r1% = DoMsgBox(Srcfile$, "Srcfile$", MB_OK)
  772.       'r1% = DoMsgBox(Readmefile$, "Readmefile$", MB_OK)
  773.       IF DoesFileExist(Srcfile$, femExists) = 1 THEN
  774.         ReadMeFileExists% = 1
  775.         CopyFile Srcfile$, Readmefile$, cmoOverwrite, 0
  776.       END IF  
  777.     END IF
  778.     
  779.     CopyFilesInCopyList
  780.       
  781.     '***************************************************
  782.     IF COMMONFILESFLAG% = 1 THEN
  783.       ini$ = MakePath(DEST$, "PFACTORY.INI")
  784.       CreateIniKeyValue ini$, "PhotoFactory", "CD_DRIVE", CDROMdrive$ + ":", cmoOverwrite
  785.       REM CreateIniKeyValue ini$, "PhotoFactory", "ClearLogFileOnStart", "1", cmoOverwrite
  786.       REM CreateIniKeyValue ini$, "PhotoFactory", "debug",  "0", cmoOverwrite
  787.     END IF
  788.     
  789.     IF (PFFLAG% = 1) OR (PFFLAG% = 3) THEN
  790.       CreateProgmanGroup "Photo Factory", "", cmoNone
  791.       ShowProgmanGroup  "Photo Factory", 1, cmoNone
  792.     END IF  
  793.     
  794.     OPTCUR$ = MakePath(DEST$, "PFACTORY.EXE")
  795.     WinDir$ = GetWindowsDir()
  796.     
  797.     
  798.     ' *************Install PFACTORY.EXE*****************
  799.     
  800.     IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  801.       CreateProgmanItem "Photo Factory", "Photo Factory", OPTCUR$, "", cmoOverwrite
  802.       CreateRegKeyValue "Graphics", "Photo Factory"
  803.       CreateRegKeyValue "Graphics\shell\open\command", OPTCUR$ + " %1"
  804.       CreateRegKeyValue ".pcx", "Graphics"
  805.       CreateRegKeyValue ".jpg", "Graphics"
  806.       CreateRegKeyValue ".bmp", "Graphics"
  807.       CreateRegKeyValue ".dib", "Graphics"
  808.       CreateRegKeyValue ".tif", "Graphics"
  809.       CreateRegKeyValue ".gif", "Graphics"
  810.       CreateRegKeyValue ".pcd", "Graphics"
  811.       OPTCUR$ = MakePath(DEST$, "IMPORT.EXE")
  812.       CreateProgmanItem "Photo Factory", "Slideshow Importer", OPTCUR$, "", cmoOverwrite
  813.       OPTCUR$ = MakePath(DEST$, "EXPORT.EXE")
  814.       CreateProgmanItem "Photo Factory", "Slideshow Exporter", OPTCUR$, "", cmoOverwrite
  815.     END IF
  816.     ' ****************************************************
  817.     
  818.     
  819.     ' *************Screen Saver Installation**************
  820.     
  821.     IF GetListItem(CHECKSTATES$, OPTFILES2) = "ON" THEN
  822.        SrcPath$ = MakePath(DEST$, "pfscrnsv.scr")     
  823.        DstPath$ = MakePath(WinDir$, "pfscrnsv.scr")
  824.        CopyFile SrcPath$, DstPath$, cmoOverwrite, 0
  825.        
  826.        ini$ = MakePath(WinDir$, "control.ini")
  827.        DstPath$ = MakePath(WinDir$, "control.old")
  828.        CopyFile ini$, DstPath$, cmoOverwrite, 0
  829.        
  830.        DstPath$ = MakePath(DEST$, "pfscr.dll")
  831.        CreateIniKeyValue ini$, "ScreenSaver.PhotoFactory", "SlideShow", "" , cmoOverWrite
  832.        CreateIniKeyValue ini$, "ScreenSaver.PhotoFactory", "ScrDLL", DstPath$ , cmoOverWrite
  833.        CreateIniKeyValue ini$, "ScreenSaver.PhotoFactory", "PFDir", DEST$ , cmoOverWrite
  834.        CreateIniKeyValue ini$, "ScreenSaver.PhotoFactory", "PWProtected", "0" , cmoOverWrite
  835.     END IF
  836.     
  837.     ' ****************************************************
  838.      
  839.     ' ************Runtime Player Installation*************
  840.     
  841.     IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  842.        ini$ = MakePath(WinDir$, "win.ini")
  843.        DstPath$ = MakePath(WinDir$, "win.old")
  844.        CopyFile ini$, DstPath$, cmoOverwrite, 0                  
  845.        
  846.        OPTCUR$ = MakePath(DEST$, "PFRUN.EXE")
  847.        CreateRegKeyValue "GraphicPlayer", "Photo Factory Runtime Player"
  848.        CreateRegKeyValue "GraphicPlayer\shell\open\command", OPTCUR$ + " %1"
  849.        CreateRegKeyValue ".sld", "GraphicPlayer"
  850.        CreateIniKeyValue "WIN.INI", "Extensions", "sld", OPTCUR$ + " ^.SLD" , cmoOverwrite
  851.        CreateProgmanItem "Photo Factory", "Runtime Player", OPTCUR$, "", cmoOverwrite
  852.     END IF
  853.     
  854.     ' ****************************************************
  855.      
  856.      '*************Slide Show Setup
  857.     
  858.     IF (GetListItem(CHECKSTATES$, DEMOFILES) = "ON") OR (GetListItem(CHECKSTATES$, MIDIFILES) = "ON")THEN
  859. REM      szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  860.       Max% = GetMaxImages("SSINFO", ";NbrOfSlideShows", szInf$)
  861.       IF Max > 0 THEN
  862.         CursorSave% = ShowWaitCursor()
  863.         
  864.         OPTCUR$ = MakePath(DEST$, "PFRUN.EXE")
  865.           'r1% = DoMsgBox(STR$(nOffset%), ";Offset", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  866.         IF GetListItem(CHECKSTATES$, MIDIFILES) = "ON" THEN
  867.                         
  868.           s$ = ";Script1"
  869.           ScriptPath$ = GetPfImageName("SSINFO", s$, szInf$)
  870.           
  871.           tmp$ = MakePath(DEST$, ScriptPath$)
  872.           f$ = OPTCUR$ + " " + tmp$
  873.           title$ = "Demo Slide Show Midi Gallery"
  874.           CreateProgmanItem "Photo Factory", title$, f$, "", cmoOverwrite
  875.                           
  876.           s$ = ";CDScript1"
  877.           CDVolume$ = GetPfImageName("SSINFO", s$, szInf$)
  878.           
  879.           IF ScriptPath$ <> "" THEN
  880.             IF UpdateScript(DEST$, ScriptPath$, DEST$, CDROMdrive$ + ":", CDVolume$, midiOffset%) = 0 THEN 
  881.               r1% = DoMsgBox("UpdateScript Failure!", "UpdateScript.dll", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  882.             END IF
  883.           END IF
  884.             
  885.         END IF
  886.         
  887.         IF (GetListItem(CHECKSTATES$, DEMOFILES) = "ON") THEN
  888.         
  889.           FOR i% = 2 TO Max STEP 1 
  890.           
  891.             IF GetListItem(CHECKSTATESIN$, i% - 1) = "ON" THEN
  892.  
  893.             s$ = ";Script" + MID$(STR$(i), 2, 2)
  894.             ScriptPath$ = GetPfImageName("SSINFO", s$, szInf$)
  895.  
  896.             IF (i% < 5) THEN            
  897.           
  898.               tmp$ = MakePath(DEST$, ScriptPath$)
  899.               f$ = OPTCUR$ + " " + tmp$
  900.               title$ = "Demo Slide Show"
  901.             
  902.               IF i% = 2 THEN
  903.                 title$ = title$ + " 800_jpg 24 Bit Color"
  904.               ELSEIF i% = 3 THEN
  905.                 title$ = title$ + " 640_gif 256 Colors"
  906.               ELSE
  907.                 title$ = title$ + " Photo CD Images"
  908.               END IF
  909.             
  910.               CreateProgmanItem "Photo Factory", title$, f$, "", cmoOverwrite
  911.                           
  912.               s$ = ";CDScript" + MID$(STR$(i), 2, 2)
  913.               CDVolume$ = GetPfImageName("SSINFO", s$, szInf$)
  914.           
  915.               IF ScriptPath$ <> "" THEN
  916.                 IF i% = 2 THEN
  917.                   demoOffset% = demo1Offset%
  918.                 ELSEIF i% = 3 THEN
  919.                   demoOffset% = demo2Offset%
  920.                 ELSE
  921.                   demoOffset% = demo3Offset%
  922.                 END IF
  923.                 IF UpdateScript(DEST$, ScriptPath$, DEST$, CDROMdrive$ + ":", CDVolume$, demoOffset%) = 0 THEN 
  924.                   r1% = DoMsgBox("UpdateScript Failure!", "UpdateScript.dll", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  925.                 END IF
  926.               END IF
  927.             
  928.             ELSE  'i% = 5 KURT OTTO
  929.                 tmp$ = GetPfImageName("SSINFO", ";KURTDIR", szInf$)
  930.                 title$ = "Dr. PopeyeX Slide Show See Readme.1st"  
  931. 'builds PFRUN.exe command line
  932.                 f$ = OPTCUR$ + " " + GetSymbolValue("STF_SRCDIR") + tmp$ + ScriptPath$
  933.                 s$ = DEST$ + "\" + tmp$ + GetPfImageName("SSINFO", ";KURTICO", szInf$) + ",,,," + GetSymbolValue("STF_SRCDIR") + tmp$
  934.                   CreateProgmanItem "Photo Factory", title$, f$, s$, cmoOverwrite
  935.             END IF
  936.             
  937.               
  938.             END IF
  939.         
  940.           NEXT i%
  941.         
  942.         END IF  
  943.         
  944.         RestoreCursor CursorSave%
  945.       END IF
  946.  
  947.     END IF
  948.     
  949.     '***************************************************
  950.      
  951. '    CloseLogFile
  952.     
  953.     '*************Video for Windows*********************
  954.     '***************************************************
  955.       
  956. '    IF GetListItem(CHECKSTATES$, VWINFILES) = "ON" THEN    
  957. '      
  958. '      'IF VWIN_ALREADY_INSTALLED = 0 THEN
  959. '        ''Updating WIN.INI and SYSTEM.INI
  960. '        IF VflatdPresent() = 0 THEN
  961. '          CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  962. '        END IF
  963. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  964. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  965. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  966. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  967. '        I% = DoesIniKeyExist (WinDir$ + "system.ini", "Drivers", "VIDC.RT21")
  968. '        IF I% = 0  THEN
  969. '          CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  970. '        END IF
  971. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  972. '        CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  973. '        CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  974. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  975. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  976. '        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  977. '        CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  978. '        CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  979. '        CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  980. '        Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  981. '        Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  982. '        Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  983. '        Run ("profdisp.exe")
  984. '        VWININSTALLED% = 1
  985. '      'END IF
  986.       
  987. '      s$ = GetPfImageName("SSINFO", ";avi", szInf$)
  988. '      OPTCUR$ = MID$(SrcDir$, 1, 1) + ":\" + s$
  989. '      CreateProgmanItem "Photo Factory", "Psychotron Preview", WinDir$ + "mplayer.exe /play /close" + " " + OPTCUR$, MakePath(DEST$, "psycho.ico") + ",0,1,1," + DEST$, cmoOverwrite
  990. '    END IF
  991.     
  992.     
  993.     ENDINSTALL:
  994. END SUB
  995.  
  996. '**
  997. '** Purpose:
  998. '**     Adds the specified option files to the copy list.
  999. '** Arguments:
  1000. '**     ftype%  - type of files to add, one of the following:
  1001. '**             APPFILES, OPTFILES1, OPTFILES2, DEMOFILES
  1002. '**                'APPFILES    Pfactory.exe
  1003. '**                'OPTFILES1    Pfrun.exe
  1004. '**                'OPTFILES2    Screen Saver
  1005. '**                'DEMOFILES    Demo Files, Demo Slides
  1006. '** Returns:
  1007. '**     none.
  1008. '*************************************************************************
  1009. SUB AddOptFilesToCopyList (ftype%) STATIC
  1010.  
  1011.     szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  1012.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  1013.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  1014.         IF ftype% = APPFILES THEN
  1015.             AddSectionFilesToCopyList "OPTION1", SrcDir$, DEST$
  1016.         ELSEIF ftype% = OPTFILES1 THEN
  1017.             AddSectionFilesToCopyList "OPTION11", SrcDir$, DEST$
  1018.         ELSEIF ftype% = OPTFILES2 THEN
  1019.             AddSectionFilesToCopyList "OPTION2", SrcDir$, DEST$
  1020.         ELSEIF ftype% = DEMOFILES THEN
  1021.             
  1022. REM            szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  1023.             Max% = GetMaxImages("SSINFO", ";NbrOfSlideShows", szInf$)
  1024.             IF Max > 0 THEN
  1025.               
  1026.               IF (GetListItem(CHECKSTATESIN$, 1) = "ON") OR (GetListItem(CHECKSTATESIN$, 2) = "ON") THEN
  1027.                 AddSectionFilesToCopyList "COMMON_ALL", SrcDir$, DEST$     
  1028.                 AddSectionFilesToCopyList "COMMON_600_AND_800", SrcDir$, DEST$     
  1029.               END IF 
  1030.               
  1031.               IF (GetListItem(CHECKSTATESIN$, 3) = "ON") THEN
  1032.                 AddSectionFilesToCopyList "PCD_SLD", SrcDir$, DEST$     
  1033.               END IF 
  1034.               
  1035.               FOR i% = 2 TO Max STEP 1 
  1036.                   s$ = "SSGROUP" + MID$(STR$(i), 2, 2)
  1037.                   IF GetListItem(CHECKSTATESIN$, i% - 1) = "ON" THEN
  1038. '5-31-94                  
  1039.                   IF (i% <> 4) OR (GetListItem(CHECKSTATES$, MIDIFILES) = "OFF") THEN 
  1040.                     AddSectionFilesToCopyList s$, SrcDir$, DEST$
  1041.                   END IF       
  1042.                 END IF 
  1043.               NEXT i%
  1044.             END IF
  1045.             
  1046.         ELSEIF ftype% = MIDIFILES THEN
  1047. REM            szInf$ = GetSymbolValue("STF_CWDDIR") + "PFACTRY.INF"
  1048.             Max% = GetMaxImages("SSINFO", ";NbrOfSlideShows", szInf$)
  1049.  
  1050.             AddSectionFilesToCopyList "COMMON_ALL", SrcDir$, DEST$     
  1051.               
  1052.             IF Max% > 0 THEN
  1053.               AddSectionFilesToCopyList "SSGROUP1", SrcDir$, DEST$
  1054.               IF (GetListItem(CHECKSTATESIN$, 3) = "OFF" OR GetListItem(CHECKSTATES$, DEMOFILES) = "OFF") THEN
  1055.                 AddSectionFilesToCopyList "SSGROUP4", SrcDir$, DEST$
  1056.               END IF  
  1057.             END IF
  1058.         
  1059. '        ELSEIF ftype% = VWINFILES THEN
  1060. '          WinDir$ = GetWindowsDir$()
  1061. '          AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  1062. '          AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  1063. '          AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  1064. '          AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  1065. '          AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  1066. '          AddSectionFilesToCopyList "Indeo-ini", SrcDir$, WinDir$
  1067.  
  1068.         END IF
  1069.          SrcDir$ = ""
  1070.     END IF
  1071. END SUB
  1072.  
  1073.  
  1074. '**
  1075. '** Purpose:
  1076. '**     Recalculates disk space for the given option files and sets
  1077. '**     the status info symbol "StatusItemsText".
  1078. '** Arguments:
  1079. '**     ftype% - type of files to add, one of the following:
  1080. '**             APPFILES, OPTFILES1, OPTFILES2, DEMOFILES
  1081. '** Returns:
  1082. '**     none.
  1083. '*************************************************************************
  1084. SUB RecalcOptFiles (ftype%) STATIC
  1085.     CursorSave% = ShowWaitCursor()
  1086.     
  1087.     'ClearCopyList
  1088.     
  1089.     AddOptFilesToCopyList ftype%
  1090.  
  1091.     fExtra% = 0
  1092.     
  1093.     IF ftype% = APPFILES THEN
  1094.         ListSym$ = APPNEEDS$
  1095.         IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  1096.             ''Add extra cost to Windows drive for ini/progman, etc.
  1097.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1098.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  1099.             fExtra% = 1
  1100.         END IF
  1101.     ELSEIF ftype% = OPTFILES1 THEN
  1102.         ListSym$ = OPT1NEEDS$
  1103.         IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  1104.             ''Add extra cost to Windows drive for ini/progman, etc.
  1105.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1106.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  1107.             fExtra% = 1
  1108.         END IF
  1109.     ELSEIF ftype% = OPTFILES2 THEN
  1110.         ListSym$ = OPT2NEEDS$
  1111.         IF GetListItem(CHECKSTATES$, OPTFILES2) = "ON" THEN
  1112.             ''Add extra cost to Windows drive for ini/progman, etc.
  1113.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1114.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  1115.             fExtra% = 1
  1116.         END IF
  1117.     ELSEIF ftype% = DEMOFILES THEN
  1118.         ListSym$ = DEMONEEDS$
  1119.     ELSEIF ftype% = MIDIFILES THEN
  1120.         ListSym$ = MIDINEEDS$
  1121. '    ELSEIF ftype% = VWINFILES THEN
  1122. '        ListSym$ = VWINNEEDS$
  1123.     END IF
  1124.  
  1125.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  1126.     cost& = 0
  1127.     
  1128.     FOR i% = 1 TO 26 STEP 1
  1129.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  1130.     NEXT i%
  1131.  
  1132.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  1133.     
  1134.     IF StillNeed& > 0 THEN
  1135.         ReplaceListItem BIGLIST$, ftype%, "YES"
  1136.     ELSE
  1137.         ReplaceListItem BIGLIST$, ftype%, ""
  1138.     END IF
  1139.  
  1140.     IF fExtra% THEN
  1141.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  1142.     END IF
  1143.     RestoreCursor CursorSave%
  1144.     ListSym$ = ""
  1145. END SUB
  1146.  
  1147.  
  1148. '**
  1149. '** Purpose:
  1150. '**     Recalculates disk space and sets option status info according
  1151. '**     to the current destination path.
  1152. '** Arguments:
  1153. '**     none.
  1154. '** Returns:
  1155. '**     none.
  1156. '*************************************************************************
  1157. SUB RecalcPath (ftype%) STATIC
  1158.  
  1159.     CursorSave% = ShowWaitCursor()
  1160.     
  1161.     ClearCopyList
  1162.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  1163.     
  1164.     
  1165.     'r% = DoMsgBox("ftype = " + STR$(ftype%), "ftype", MB_OK)
  1166.     
  1167.     IF (ftype% = PF_PROG) OR (ftype% = PF_ALL) THEN
  1168.       IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  1169.         AddSectionFilesToCopyList "FILES", SrcDir$, DEST$
  1170.         RecalcOptFiles APPFILES
  1171.         ClearCopyList
  1172.         RecalcOptFiles OPTFILES1
  1173.         ClearCopyList
  1174.         RecalcOptFiles OPTFILES2
  1175.     
  1176.       ELSEIF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  1177.         RecalcOptFiles APPFILES
  1178.         ClearCopyList
  1179.         AddSectionFilesToCopyList "FILES", SrcDir$, DEST$
  1180.         RecalcOptFiles OPTFILES1
  1181.         ClearCopyList
  1182.         RecalcOptFiles OPTFILES2
  1183.     
  1184.       ELSEIF GetListItem(CHECKSTATES$, OPTFILES2) = "ON" THEN
  1185.         RecalcOptFiles APPFILES
  1186.         ClearCopyList
  1187.         RecalcOptFiles OPTFILES1
  1188.         ClearCopyList
  1189.         AddSectionFilesToCopyList "FILES", SrcDir$, DEST$
  1190.         RecalcOptFiles OPTFILES2
  1191.     
  1192.       ELSE
  1193.         RecalcOptFiles APPFILES
  1194.         ClearCopyList
  1195.         RecalcOptFiles OPTFILES1
  1196.         ClearCopyList
  1197.         RecalcOptFiles OPTFILES2
  1198.       
  1199.       END IF
  1200.     END IF
  1201.     
  1202.     IF (ftype% = PF_DEMO) OR (ftype% = PF_ALL) THEN
  1203.       IF DemoFilesPresent% = 1 THEN
  1204.         ClearCopyList
  1205.         RecalcOptFiles DEMOFILES
  1206.         IF ftype% = PF_DEMO THEN 
  1207.           ClearCopyList
  1208.           RecalcOptFiles MIDIFILES
  1209.         END IF
  1210.       END IF
  1211.     END IF
  1212.     
  1213.     IF (ftype% = PF_MIDI) OR (ftype% = PF_ALL) THEN
  1214.       IF DemoFilesPresent% = 1 THEN
  1215.         ClearCopyList
  1216.         RecalcOptFiles MIDIFILES
  1217.         IF ftype% = PF_MIDI THEN 
  1218.           ClearCopyList
  1219.           RecalcOptFiles DEMOFILES
  1220.         END IF
  1221.       END IF
  1222.     END IF
  1223.     
  1224.     'IF (ftype% = PF_VWIN) OR (ftype% = PF_ALL) THEN
  1225.     '  ClearCopyList
  1226.     '  RecalcOptFiles VWINFILES
  1227.     'END IF
  1228.     
  1229.     RestoreCursor CursorSave%
  1230. END SUB
  1231.  
  1232.  
  1233. '**
  1234. '** Purpose:
  1235. '**     Sets drive status info according to latest disk space calcs.
  1236. '** Arguments:
  1237. '**     none.
  1238. '** Returns:
  1239. '**     none.
  1240. '*************************************************************************
  1241. SUB SetDriveStatus STATIC
  1242.  
  1243.     drive$ = MID$(DEST$, 1, 1)
  1244.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  1245.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  1246.     IF  DemoFilesPresent% = 1 THEN
  1247.        cost& = cost& + VAL(GetListItem(MIDINEEDS$, ndrive%))
  1248.        cost& = cost& + VAL(GetListItem(DEMONEEDS$, ndrive%))
  1249.     END IF
  1250. '    cost& = cost& + VAL(GetListItem(VWINNEEDS$, ndrive%))
  1251.     free& = GetFreeSpaceForDrive(drive$)
  1252.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  1253.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  1254.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  1255.  
  1256.     IF drive$ = WINDRIVE$ THEN
  1257.         ReplaceListItem DRIVETEXT$, 4, ""
  1258.         ReplaceListItem DRIVETEXT$, 5, ""
  1259.         ReplaceListItem DRIVETEXT$, 6, ""
  1260.     ELSE
  1261.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1262.         cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  1263.         IF  DemoFilesPresent% = 1 THEN
  1264.           cost& = cost& + VAL(GetListItem(MIDINEEDS$, ndrive%))
  1265.           cost& = cost& + VAL(GetListItem(DEMONEEDS$, ndrive%))
  1266.         END IF
  1267. '        cost& = cost& + VAL(GetListItem(VWINNEEDS$, ndrive%))
  1268.     
  1269.         IF cost& = 0 THEN
  1270.             ReplaceListItem DRIVETEXT$, 4, ""
  1271.             ReplaceListItem DRIVETEXT$, 5, ""
  1272.             ReplaceListItem DRIVETEXT$, 6, ""
  1273.         ELSE
  1274.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  1275.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  1276.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  1277.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  1278.         END IF
  1279.     END IF
  1280.     
  1281.     'r% = DoMsgBox("cost = " + STR$(cost&), "SetDriveStatus", MB_OK)
  1282.     'r% = DoMsgBox("free = " + STR$(free&), "SetDriveStatus", MB_OK)
  1283.     
  1284.     IF (cost& > free&) THEN
  1285.       ReplaceListItem BIGLIST$, 1, "YES"
  1286.     ELSE
  1287.       ReplaceListItem BIGLIST$, 1, ""
  1288.     END IF
  1289.     
  1290. END SUB
  1291.  
  1292.  
  1293. '**
  1294. '** Purpose:
  1295. '**     Appends a file name to the end of a directory path,
  1296. '**     inserting a backslash character as needed.
  1297. '** Arguments:
  1298. '**     szDir$  - full directory path (with optional ending "\")
  1299. '**     szFile$ - filename to append to directory
  1300. '** Returns:
  1301. '**     Resulting fully qualified path name.
  1302. '*************************************************************************
  1303. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1304.     IF szDir$ = "" THEN
  1305.         MakePath = szFile$
  1306.     ELSEIF szFile$ = "" THEN
  1307.         MakePath = szDir$
  1308.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1309.         MakePath = szDir$ + szFile$
  1310.     ELSE
  1311.         MakePath = szDir$ + "\" + szFile$
  1312.     END IF
  1313. END FUNCTION
  1314.  
  1315.