home *** CD-ROM | disk | FTP | other *** search
/ Win 3.11 Apps / win311aps.iso / PREMIER / DISK1 / PREMIERE.MST < prev    next >
Text File  |  1995-05-15  |  23KB  |  732 lines

  1. '*
  2. '*            Adobe Premiere Installer
  3. '*
  4. '* June 5, 1993  Marshall Spight
  5. '*
  6. '*
  7. '*
  8. '*
  9. '*
  10.  
  11. '$DEFINE DEBUG  ''Define for script development/debugging
  12.  
  13. '$INCLUDE 'setupapi.inc'
  14. '$INCLUDE 'msdetect.inc'
  15.  
  16.  
  17.  
  18. ''following were taken from windows.h. &H means they're hex
  19. CONST WS_VISIBLE=&H10000000
  20. CONST WS_BORDER =&H00800000
  21. CONST WS_CLIPCHILDREN =&H02000000
  22. CONST GWL_STYLE =-16
  23. CONST SW_SHOWMAXIMIZED=3
  24. CONST EW_RESTARTWINDOWS=&H00000042
  25.  
  26.  
  27. DECLARE FUNCTION ShowWindow  LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  28. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
  29. DECLARE FUNCTION ExitWindows  LIB "User" (Flag&, Param%) AS INTEGER
  30. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  31.  
  32. ''Dialog ID's
  33. CONST ASKQUIT      = 100
  34. CONST DESTPATH     = 200
  35. CONST EXITFAILURE  = 300
  36. CONST EXITQUIT     = 400
  37. CONST EXITSUCCESS  = 500
  38. CONST OPTIONS      = 600
  39. CONST APPHELP      = 700
  40. CONST CUSTINST     = 800
  41. CONST TOOBIG       = 900
  42. CONST BADPATH      = 1000
  43. CONST RESTART      = 2600
  44. CONST RESTARTII    = 2700
  45.  
  46. CONST PERSONALIZE  = 10000
  47.  
  48. ''Bitmap ID
  49. CONST LOGO         = 1
  50.  
  51. ''File Types
  52.  
  53. CONST PROGRAMFILES   = 1
  54. CONST MSVIDEOFILES   = 2
  55. CONST QUICKTIMEFILES = 3
  56. CONST TUTORIALFILES  = 4
  57. CONST CAPTUREFILES   = 5
  58.  
  59. CONST    NUMGROUPS      = 5    '' Number of file groups: PROGRAM to TUTORIAL
  60.  
  61.  
  62. GLOBAL DEST$        ''Default destination directory.
  63. GLOBAL WINDRIVE$    ''Windows drive letter.
  64. GLOBAL ENOUGHDISK%
  65.  
  66.  
  67. ''CustInst list symbol names
  68.  
  69. GLOBAL PROGRAMNEEDS$
  70. GLOBAL MSVIDEONEEDS$
  71. GLOBAL QUICKTIMENEEDS$
  72. GLOBAL TUTORIALNEEDS$
  73. GLOBAL CAPTURENEEDS$
  74.  
  75. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  76. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  77.  
  78. ''Dialog list symbol names
  79. GLOBAL CHECKSTATES$
  80. GLOBAL STATUSTEXT$
  81. GLOBAL DRIVETEXT$
  82.  
  83.  
  84. DECLARE SUB AddOptFilesToCopyList (ftype%)
  85. DECLARE SUB RecalcOptFiles (ftype%)
  86. DECLARE SUB RecalcPath
  87. DECLARE SUB SetDriveStatus
  88. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  89. DECLARE SUB X1 LIB "mscuistf.dll" (arg$)
  90. DECLARE SUB X2 LIB "mscuistf.dll" (arg$)
  91. DECLARE SUB X3 LIB "mscuistf.dll" (arg$)
  92. DECLARE SUB FixScreenProc LIB "mscuistf.dll" (arg%)
  93. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  94.  
  95.  
  96.  
  97.  
  98. INIT:
  99.     ENOUGHDISK% = 1
  100.  
  101.     hWnd%=HwndFrame()
  102.     FixScreenProc ( hWnd% )
  103.     SWLxx&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  104.     SWyy%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  105.  
  106.     INSTALLDLL$ = "mscuistf.dll"        ''custom functions
  107.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  108.  
  109.     SetBitmap INSTALLDLL$, LOGO
  110.     SetTitle "Adobe Premiere Installer"
  111.  
  112.     MajorVer% = GetWindowsMajorVersion()
  113.     MinorVer% = GetWindowsMinorVersion()
  114.  
  115.     IF  MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  116.     i% = DoMsgBox("Adobe Premiere requires Microsoft Windows version 3.10 or greater.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  117.         END
  118.     END IF
  119.  
  120.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  121.     IF szInf$ = "" THEN
  122.         szInf$ = GetSymbolValue("STF_CWDDIR") + "PREMIERE.INF"
  123.     END IF
  124.     ReadInfFile szInf$
  125.  
  126.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  127.      DEST$ = GetIniKeyString( GetWindowsDir() + "premiere.ini", "Premiere", "PremiereDirectory" )
  128.     IF IsDirWritable(DEST$) = 0 THEN
  129.          DEST$ = WINDRIVE$ + ":\PREMIERE"
  130.     END IF
  131.     IF DEST$ = "" THEN
  132.          DEST$ = WINDRIVE$ + ":\PREMIERE"
  133.     END IF
  134.     IF MID$( DEST, LEN(DEST), 1 ) = "\" THEN
  135.        DEST$ = MID$( DEST, 1, LEN( DEST ) - 1 )
  136.     END IF
  137.  
  138.     ''CustInst list symbols
  139.     CHECKSTATES$ = "CheckItemsState"
  140.     STATUSTEXT$  = "StatusItemsText"
  141.     DRIVETEXT$   = "DriveStatusText"
  142.     FOR i% = 1 TO NUMGROUPS STEP 1
  143.         AddListItem CHECKSTATES$, "ON"
  144.     NEXT i%
  145.     FOR i% = 1 TO NUMGROUPS STEP 1
  146.         AddListItem STATUSTEXT$, ""
  147.     NEXT i%
  148.     FOR i% = 1 TO 7 STEP 1
  149.         AddListItem DRIVETEXT$, ""
  150.     NEXT i%
  151.     ReplaceListItem DRIVETEXT$, 7, DEST$
  152.  
  153.     ''Disk cost list symbols
  154.  
  155.     PROGRAMNEEDS$   = "ProgramNeeds"
  156.     MSVIDEONEEDS$   = "MSVideoNeeds"
  157.     QUICKTIMENEEDS$ = "QuickTimeNeeds"
  158.     TUTORIALNEEDS$  = "TutorialNeeds"
  159.     CAPTURENEEDS$   = "CaptureNeeds"
  160.  
  161.     EXTRACOSTS$ = "ExtraCosts"
  162.     BIGLIST$    = "BigList"
  163.  
  164.     FOR i% = 1 TO NUMGROUPS STEP 1
  165.         AddListItem BIGLIST$, ""
  166.     NEXT i%
  167.     FOR i% = 1 TO 26 STEP 1
  168.         AddListItem EXTRACOSTS$, "0"
  169.     NEXT i%
  170.  
  171.     RecalcPath
  172.     SetDriveStatus
  173.  
  174. '$IFDEF DEBUG
  175.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  176. '$ENDIF ''DEBUG
  177.  
  178.  
  179.  
  180. CUSTINST:
  181.     sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  182.  
  183.     IF sz$ = "CONTINUE" THEN
  184.         ''Install only if it will fit.
  185.           IF ENOUGHDISK% = 0 THEN
  186.                  GOSUB TOOBIG
  187.                  GOTO CUSTINST
  188.           END IF
  189.         UIPop 1
  190.         GOTO INSTALL
  191.     ELSEIF sz$ = "PATH" THEN
  192.         GOTO GETPATH
  193.     ELSEIF sz$ = "CHK1" THEN
  194.         RecalcOptFiles PROGRAMFILES
  195.         SetDriveStatus
  196.         GOTO CUSTINST
  197.     ELSEIF sz$ = "CHK2" THEN
  198.         RecalcOptFiles MSVIDEOFILES
  199.         SetDriveStatus
  200.         GOTO CUSTINST
  201.     ELSEIF sz$ = "CHK3" THEN
  202.         RecalcOptFiles QUICKTIMEFILES
  203.         SetDriveStatus
  204.         GOTO CUSTINST
  205.     ELSEIF sz$ = "CHK4" THEN
  206.         RecalcOptFiles TUTORIALFILES
  207.         SetDriveStatus
  208.         GOTO CUSTINST
  209.     ELSEIF sz$ = "CHK5" THEN
  210.         RecalcOptFiles CAPTUREFILES
  211.         SetDriveStatus
  212.         GOTO CUSTINST
  213.     ELSEIF sz$ = "REACTIVATE" THEN
  214.         RecalcPath
  215.         SetDriveStatus
  216.         GOTO CUSTINST
  217.     ELSE
  218.         GOSUB ASKQUIT
  219.         GOTO CUSTINST
  220.     END IF
  221.  
  222.  
  223.  
  224. INSTALL:
  225.  
  226.  
  227.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  228.          sz$ = UIStartDlg(INSTALLDLL$, PERSONALIZE, "dlgPERinstall", 0, "" )
  229.          IF sz$ <> "VALID" THEN
  230.              sz$ = UIStartDlg(INSTALLDLL$, EXITQUIT, "FInfo0DlgProc", 0, "")
  231.              UIPop 1
  232.              END
  233.          END IF
  234.     END IF
  235.  
  236.     CopyFile GetWindowsDir() + "win.ini", GetWindowsDir() + "win.prm", cmoOverwrite, 0
  237.     CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.prm", cmoOverwrite, 0
  238.     CreateDir DEST$, cmoNone
  239.  
  240.     IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN
  241.         CreateDir DEST$ + "\PLUGINS", cmoNone
  242.         CreateDir DEST$ + "\4_PSHOP", cmoNone
  243.         CreateDir DEST$ + "\DRIVERS", cmoNone
  244.     END IF
  245.  
  246.     IF GetListItem( CHECKSTATES$, TUTORIALFILES ) = "ON" THEN
  247.         CreateDir DEST$ + "\SAMPLES", cmoNone
  248.     END IF
  249.  
  250.     WinDir$ = GetWindowsDir()
  251.     WinSysDir$ = GetWindowsSysDir()
  252.  
  253.     ClearCopyList
  254.     AddOptFilesToCopyList PROGRAMFILES
  255.     AddOptFilesToCopyList MSVIDEOFILES
  256.     AddOptFilesToCopyList QUICKTIMEFILES
  257.     AddOptFilesToCopyList TUTORIALFILES
  258.     AddOptFilesToCopyList CAPTUREFILES
  259.     SetRestartDir WinDir$
  260.     CopyFilesInCopyList
  261.  
  262.     IF GetListItem( CHECKSTATES$, MSVIDEOFILES ) = "ON" THEN
  263.         ''Updating WIN.INI and SYSTEM.INI
  264.  
  265.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  266.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "msrle.drv", cmoOverwrite
  267.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  268.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  269.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  270.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  271.         CreateIniKeyValue "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  272.         CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  273.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  274.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  275.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  276.         CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  277.         CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  278.         CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  279.         IF VflatdPresent() = 0 THEN
  280.             CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  281.         END IF
  282.         Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  283.         Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  284.         Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  285.  
  286.     END IF
  287.  
  288.  
  289.     ''IF GetListItem( CHECKSTATES$, QUICKTIMEFILES ) = "ON" THEN
  290.         ''CreateIniKeyValue "win.ini", "Extensions", "mov", "mplayer.exe /play /close ^.mov", cmoNone
  291.         ''CreateIniKeyValue "win.ini", "mci extensions", "mov", "QTWVideo", cmoOverwrite
  292.         ''CreateIniKeyValue GetWindowsDir() + "system.ini", "mci", "QTWVideo", "mciqtw.drv", cmoOverwrite
  293.     ''END IF
  294.  
  295.     IF GetListItem( CHECKSTATES$, CAPTUREFILES ) = "ON" THEN
  296.         CreateProgmanItem "Adobe", "Capture", MakePath( DEST$, "adobecap.exe" ), "", cmoOverwrite
  297.         RemoveFile GetWindowsDir() + "capture.ini", cmoForce
  298.     END IF
  299.  
  300.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  301.           CreateIniKeyValue "WIN.INI", "Extensions", "PPJ", DEST$ + "\PREMIERE.EXE ^.PPJ", cmoOverwrite
  302.           CreateIniKeyValue "WIN.INI", "Extensions", "PSQ", DEST$ + "\PREMIERE.EXE ^.PSQ", cmoOverwrite
  303.           CreateIniKeyValue "WIN.INI", "Extensions", "PLB", DEST$ + "\PREMIERE.EXE ^.PLB", cmoOverwrite
  304.  
  305.         RemoveFile GetWindowsDir() + "premiere.prf", cmoForce
  306.  
  307.         CreateProgmanGroup "Adobe", "", cmoNone
  308.         ShowProgmanGroup  "Adobe", 1, cmoNone
  309.         CreateProgmanItem "Adobe", "Premiere 1.1", MakePath( DEST$, "premiere.exe" ), "", cmoOverwrite
  310.         CreateProgmanItem "Adobe", "Premiere ReadMe", "write.exe " + MakePath( DEST$, "prreadme.wri" ), "", cmoOverwrite
  311.         ''CreateProgmanItem "Adobe", "QuickTime ReadMe", "write.exe " + MakePath( GetWindowsSysDir(), "qtreadme.wri" ), "", cmoOverwrite
  312.         X$ = "                                        "
  313.         X1 ( X$ )
  314.         R$ = CHR$( LEN( X$ ) ) + X$
  315.         X$ = "                                        "
  316.         X2 ( X$ )
  317.         R$ = R$ + CHR$( LEN( X$ ) ) + X$
  318.         X$ = "                                        "
  319.         X3 ( X$ )
  320.         R$ = R$ + CHR$( LEN( X$ ) ) + X$
  321.         StampResource "ProgramFiles", "1", DEST$, 6, 65, R$, LEN( R$ )
  322.  
  323.           IF DoesFileExist( GetWindowsDir() + "photoshp.ini", femRead ) <> 0 THEN
  324.                   PHOTOSHOPPLUGINSDIR$ = GetIniKeyString( GetWindowsDir() + "photoshp.ini", "Photoshop", "PLUGINDIRECTORY" )
  325.               IF PHOTOSHOPPLUGINSDIR$ <> "" THEN
  326.                   CopyFile DEST$ + "\4_PSHOP\FILMST8B.8BI", PHOTOSHOPPLUGINSDIR$ + "\FILMST8B.8BI", cmoNone, 0
  327.                 END IF
  328.           END IF
  329.  
  330.           CreateIniKeyValue GetWindowsDir() + "premiere.ini", "Premiere", "PremiereDirectory", DEST$, cmoOverwrite
  331.           IF GetListItem( CHECKSTATES$, CAPTUREFILES ) = "ON" THEN
  332.               CreateIniKeyValue GetWindowsDir() + "premiere.ini", "Premiere", "CaptureUtil", DEST$+"\adobecap.exe", cmoOverwrite
  333.           END IF
  334.  
  335.     END IF
  336.  
  337.  
  338.  
  339.  
  340. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows
  341. '' automatically; else, it gives the user the choice
  342.     RESTRT% = RestartListEmpty ()
  343.     Exe$ = WinDir$ + "\_msrstrt.exe"
  344.     Batch$ = WinDir$ + "\_mssetup.bat"
  345.     empty$ = ""
  346. RESTART:
  347.     IF RESTRT% = 0 THEN
  348.         sz$ = UIStartDlg(INSTALLDLL$, RESTART, "FInfo0DlgProc", 0, "")
  349.         IF sz$ = "REACTIVATE" THEN
  350.              GOTO RESTART
  351.         ENDIF
  352.         I% = ExitExecRestart ()
  353.         RemoveFile Exe$, cmoForce
  354.         RemoveFile Batch$, cmoForce
  355.         END
  356.     ELSE
  357.         sz$ = UIStartDlg(INSTALLDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  358.         IF sz$ = "CONTINUE" THEN
  359.             I% = ExitWindowsExec (Exe$, empty$)
  360.             IF I% = 0 THEN
  361.                 GOTO RESTART
  362.             ELSE
  363.             END
  364.         ENDIF
  365.         ELSEIF sz$ = "EXIT" THEN
  366.             UIPopAll
  367.             END
  368.         ELSEIF sz$ = "REACTIVATE" THEN
  369.             GOTO RESTART
  370.         ELSE
  371.             UIPop 1
  372.         END IF
  373.     END IF
  374.  
  375.  
  376.  
  377. QUIT:
  378.     ON ERROR GOTO ERRQUIT
  379.  
  380.     IF ERR = 0 THEN
  381.         dlg% = EXITSUCCESS
  382.     ELSEIF ERR = STFQUIT THEN
  383.         dlg% = EXITQUIT
  384.     ELSE
  385.         dlg% = EXITFAILURE
  386.     END IF
  387. QUITL1:
  388.     sz$ = UIStartDlg(INSTALLDLL$, dlg%, "FInfo0DlgProc", 0, "")
  389.     IF sz$ = "REACTIVATE" THEN
  390.         GOTO QUITL1
  391.     END IF
  392.     UIPop 1
  393.  
  394.     END
  395.  
  396. ERRQUIT:
  397.     i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  398.     END
  399.  
  400.  
  401.  
  402. GETPATH:
  403.     SetSymbolValue "EditTextIn", DEST$
  404.     SetSymbolValue "EditFocus", "ALL"
  405. GETPATHL1:
  406.     sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  407.  
  408.     IF sz$ = "CONTINUE" THEN
  409.         olddest$ = DEST$
  410.         DEST$ = GetSymbolValue("EditTextOut")
  411.  
  412.         ''Validate new path.
  413.         IF LEN( DEST ) < 4 THEN
  414.             GOSUB BADPATH
  415.             GOTO GETPATHL1
  416.         END IF
  417.  
  418.         IF MID$( DEST, 1, 1 ) = "A" THEN
  419.             GOSUB BADPATH
  420.             GOTO GETPATHL1
  421.         END IF
  422.  
  423.         IF MID$( DEST, 1, 1 ) = "B" THEN
  424.             GOSUB BADPATH
  425.             GOTO GETPATHL1
  426.         END IF
  427.  
  428.         IF IsDirWritable(DEST$) = 0 THEN
  429.             GOSUB BADPATH
  430.             GOTO GETPATHL1
  431.         END IF
  432.  
  433.           IF MID$( DEST, LEN(DEST), 1 ) = "\" THEN
  434.               DEST$ = MID$( DEST, 1, LEN( DEST ) - 1 )
  435.           END IF
  436.  
  437.         UIPop 1
  438.  
  439.         ''Truncate display if too long.
  440.         IF LEN(DEST$) > 23 THEN
  441.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  442.         ELSE
  443.             ReplaceListItem DRIVETEXT$, 7, DEST$
  444.         END IF
  445.  
  446.         ''Recalc if path changed.
  447.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  448.             RecalcPath
  449.             SetDriveStatus
  450.         END IF
  451.  
  452.         olddest$ = ""
  453.         GOTO CUSTINST
  454.     ELSEIF sz$ = "REACTIVATE" THEN
  455.         RecalcPath
  456.         SetDriveStatus
  457.         GOTO GETPATHL1
  458.     ELSEIF sz$ = "EXIT" THEN
  459.         GOSUB ASKQUIT
  460.         GOTO GETPATHL1
  461.     ELSE
  462.         UIPop 1
  463.         GOTO CUSTINST
  464.     END IF
  465.  
  466.  
  467.  
  468. TOOBIG:
  469.     sz$ = UIStartDlg(INSTALLDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  470.     IF sz$ = "REACTIVATE" THEN
  471.         RecalcPath
  472.         SetDriveStatus
  473.         GOTO TOOBIG
  474.     END IF
  475.     UIPop 1
  476.     RETURN
  477.  
  478.  
  479.  
  480. BADPATH:
  481.     sz$ = UIStartDlg(INSTALLDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  482.     IF sz$ = "REACTIVATE" THEN
  483.         RecalcPath
  484.         SetDriveStatus
  485.         GOTO BADPATH
  486.     END IF
  487.     UIPop 1
  488.     RETURN
  489.  
  490.  
  491.  
  492. ASKQUIT:
  493.     sz$ = UIStartDlg(INSTALLDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  494.  
  495.     IF sz$ = "EXIT" THEN
  496.         UIPopAll
  497.         ERROR STFQUIT
  498.     ELSEIF sz$ = "REACTIVATE" THEN
  499.         GOTO ASKQUIT
  500.     ELSE
  501.         UIPop 1
  502.     END IF
  503.     RETURN
  504.  
  505.  
  506.  
  507. '**
  508. '** Purpose:
  509. '**     Adds the specified option files to the copy list.
  510. '** Arguments:
  511. '**     ftype%  - type of files to add, one of the following:
  512. '**             PROGRAMFILES, TUTORIALFILES ...
  513. '** Returns:
  514. '**     none.
  515. '*************************************************************************
  516. SUB AddOptFilesToCopyList (ftype%) STATIC
  517.  
  518.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  519.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  520.         IF ftype% = PROGRAMFILES THEN
  521.             AddSectionFilesToCopyList "ProgramFiles", SrcDir$, DEST$
  522.             AddSectionFilesToCopyList "PluginFiles", SrcDir$, DEST$ + "\plugins"
  523.             AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir()
  524.             AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir()
  525.             AddSectionFilesToCopyList "PhotoshopFiles", SrcDir$, DEST$ + "\4_pshop"
  526.             AddSectionFilesToCopyList "DriversFiles", SrcDir$, DEST$ + "\drivers"
  527.         ELSEIF ftype% = MSVIDEOFILES THEN
  528.             AddSectionFilesToCopyList "MSVideoFiles", SrcDir$, GetWindowsDir()
  529.             AddSectionFilesToCopyList "MSVideoSysFiles", SrcDir$, GetWindowsSysDir()
  530.         ELSEIF ftype% = QUICKTIMEFILES THEN
  531.             AddSectionFilesToCopyList "QuickTimeFiles", SrcDir$, DEST$
  532.         ELSEIF ftype% = TUTORIALFILES THEN
  533.             AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\samples"
  534.         ELSEIF ftype% = CAPTUREFILES THEN
  535.             AddSectionFilesToCopyList "CaptureFiles", SrcDir$, DEST$
  536.         END IF
  537.         SrcDir$ = ""
  538.     END IF
  539. END SUB
  540.  
  541.  
  542. '**
  543. '** Purpose:
  544. '**     Recalculates disk space for the given option files and sets
  545. '**     the status info symbol "StatusItemsText".
  546. '** Arguments:
  547. '**     ftype% - type of files to add, one of the following:
  548. '**             PROGRAMFILES, PLUGINFILES...
  549. '** Returns:
  550. '**     none.
  551. '*************************************************************************
  552. SUB RecalcOptFiles (ftype%) STATIC
  553.     CursorSave% = ShowWaitCursor()
  554.     ClearCopyList
  555.     AddOptFilesToCopyList ftype%
  556.  
  557.     fExtra% = 0
  558.     ndrive% = 1
  559.     idrive% = 1
  560.     IF ftype% = PROGRAMFILES THEN
  561.         ListSym$ = PROGRAMNEEDS$
  562.         IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  563.             ''Add extra cost to Windows drive for ini/progman, etc.
  564.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  565.             ReplaceListItem EXTRACOSTS$, ndrive%, "20000"
  566.             idrive% = ASC(ucase$(DEST$)) - ASC("A") + 1
  567.             ReplaceListItem EXTRACOSTS$, idrive%, "200000"
  568.             fExtra% = 1
  569.         END IF
  570.     ELSEIF ftype% = MSVIDEOFILES THEN
  571.         ListSym$ = MSVIDEONEEDS$
  572.         IF GetListItem(CHECKSTATES$, MSVIDEOFILES) = "ON" THEN
  573.             ''Add extra cost to Windows drive for ini/progman, etc.
  574.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  575.             ReplaceListItem EXTRACOSTS$, ndrive%, "20000"
  576.             fExtra% = 1
  577.         END IF
  578.     ELSEIF ftype% = QUICKTIMEFILES THEN
  579.         ListSym$ = QUICKTIMENEEDS$
  580.         IF GetListItem(CHECKSTATES$, QUICKTIMEFILES) = "ON" THEN
  581.             ''Add extra cost to Windows drive for ini/progman, etc.
  582.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  583.             ReplaceListItem EXTRACOSTS$, ndrive%, "20000"
  584.             fExtra% = 1
  585.         END IF
  586.     ELSEIF ftype% = TUTORIALFILES THEN
  587.         ListSym$ = TUTORIALNEEDS$
  588.         IF GetListItem(CHECKSTATES$, TUTORIALFILES) = "ON" THEN
  589.             ''Add extra cost to Windows drive for ini/progman, etc.
  590.             idrive% = ASC(ucase$(DEST$)) - ASC("A") + 1
  591.             ReplaceListItem EXTRACOSTS$, idrive%, "60000"
  592.             fExtra% = 1
  593.         END IF
  594.     ELSEIF ftype% = CAPTUREFILES THEN
  595.         ListSym$ = CAPTURENEEDS$
  596.         IF GetListItem(CHECKSTATES$, CAPTUREFILES) = "ON" THEN
  597.             ''Add extra cost to Windows drive for ini/progman, etc.
  598.             idrive% = ASC(ucase$(DEST$)) - ASC("A") + 1
  599.             ReplaceListItem EXTRACOSTS$, idrive%, "60000"
  600.             fExtra% = 1
  601.         END IF
  602.     END IF
  603.  
  604.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  605.  
  606.     cost& = 0
  607.     FOR i% = 1 TO 26 STEP 1
  608.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  609.     NEXT i%
  610.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  611.  
  612.     IF StillNeed& > 0 THEN
  613.         ReplaceListItem BIGLIST$, ftype%, "YES"
  614.     ELSE
  615.         ReplaceListItem BIGLIST$, ftype%, ""
  616.     END IF
  617.  
  618.     IF fExtra% THEN
  619.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  620.         ReplaceListItem EXTRACOSTS$, idrive%, "0"
  621.     END IF
  622.     RestoreCursor CursorSave%
  623.     ListSym$ = ""
  624. END SUB
  625.  
  626.  
  627. '**
  628. '** Purpose:
  629. '**     Recalculates disk space and sets option status info according
  630. '**     to the current destination path.
  631. '** Arguments:
  632. '**     none.
  633. '** Returns:
  634. '**     none.
  635. '*************************************************************************
  636. SUB RecalcPath STATIC
  637.  
  638.     CursorSave% = ShowWaitCursor()
  639.  
  640.     RecalcOptFiles PROGRAMFILES
  641.     RecalcOptFiles MSVIDEOFILES
  642.     RecalcOptFiles QUICKTIMEFILES
  643.     RecalcOptFiles TUTORIALFILES
  644.     RecalcOptFiles CAPTUREFILES
  645.  
  646.     RestoreCursor CursorSave%
  647. END SUB
  648.  
  649.  
  650. '**
  651. '** Purpose:
  652. '**     Sets drive status info according to latest disk space calcs.
  653. '** Arguments:
  654. '**     none.
  655. '** Returns:
  656. '**     none.
  657. '*************************************************************************
  658. SUB SetDriveStatus STATIC
  659.  
  660.     ENOUGHDISK% = 1
  661.  
  662.  
  663.     drive$ = MID$(DEST$, 1, 1)
  664.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  665.     cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  666.     cost& = cost& + VAL( GetListItem( MSVIDEONEEDS$, ndrive% ) )
  667.     cost& = cost& + VAL( GetListItem( QUICKTIMENEEDS$, ndrive% ) )
  668.     cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  669.     cost& = cost& + VAL( GetListItem( CAPTURENEEDS$, ndrive% ) )
  670.     free& = GetFreeSpaceForDrive(drive$)
  671.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  672.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  673.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  674.  
  675.  
  676.     IF cost& > free& THEN
  677.           ENOUGHDISK% = 0
  678.     END IF
  679.  
  680.     IF drive$ = WINDRIVE$ THEN
  681.         ReplaceListItem DRIVETEXT$, 4, ""
  682.         ReplaceListItem DRIVETEXT$, 5, ""
  683.         ReplaceListItem DRIVETEXT$, 6, ""
  684.     ELSE
  685.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  686.         cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  687.         cost& = cost& + VAL( GetListItem( MSVIDEONEEDS$, ndrive% ) )
  688.         cost& = cost& + VAL( GetListItem( QUICKTIMENEEDS$, ndrive% ) )
  689.         cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  690.         cost& = cost& + VAL( GetListItem( CAPTURENEEDS$, ndrive% ) )
  691.         IF cost& = 0 THEN
  692.             ReplaceListItem DRIVETEXT$, 4, ""
  693.             ReplaceListItem DRIVETEXT$, 5, ""
  694.             ReplaceListItem DRIVETEXT$, 6, ""
  695.         ELSE
  696.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  697.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  698.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  699.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  700.         END IF
  701.  
  702.         IF cost& > free& THEN
  703.               ENOUGHDISK% = 0
  704.         END IF
  705.  
  706.     END IF
  707. END SUB
  708.  
  709.  
  710. '**
  711. '** Purpose:
  712. '**     Appends a file name to the end of a directory path,
  713. '**     inserting a backslash character as needed.
  714. '** Arguments:
  715. '**     szDir$  - full directory path (with optional ending "\")
  716. '**     szFile$ - filename to append to directory
  717. '** Returns:
  718. '**     Resulting fully qualified path name.
  719. '*************************************************************************
  720. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  721.     IF szDir$ = "" THEN
  722.         MakePath = szFile$
  723.     ELSEIF szFile$ = "" THEN
  724.         MakePath = szDir$
  725.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  726.         MakePath = szDir$ + szFile$
  727.     ELSE
  728.         MakePath = szDir$ + "\" + szFile$
  729.     END IF
  730. END FUNCTION
  731.  
  732.