home *** CD-ROM | disk | FTP | other *** search
Wrap
'* '* Adobe Premiere Installer '* '* '* '$DEFINE DEBUG ''Define for script development/debugging '$INCLUDE 'setupapi.inc' '$INCLUDE 'msdetect.inc' ''following were taken from windows.h. &H means they're hex CONST WS_VISIBLE=&H10000000 CONST WS_BORDER =&H00800000 CONST WS_CLIPCHILDREN =&H02000000 CONST GWL_STYLE =-16 CONST SW_SHOWMAXIMIZED=3 CONST EW_RESTARTWINDOWS=&H00000042 '' function declarations DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG DECLARE FUNCTION ExitWindows LIB "User" (Flag&, Param%) AS INTEGER DECLARE fUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER DECLARE FUNCTION CheckForOld AS INTEGER DECLARE FUNCTION RemoveOldQTFiles (FilePath$) AS INTEGER DECLARE FUNCTION GetQTWVersion LIB "setupenu.dll" (szDLL$) AS INTEGER DECLARE FUNCTION KillATICodecs AS INTEGER DECLARE FUNCTION InstallCD(Dir$) AS INTEGER ''Dialog ID's CONST ASKQUIT = 100 CONST NUKEOLD = 101 '' WARNING FOR OLDER VERSIONS CONST OLDMESS = 102 '' Checking for older versions of qtw CONST NUKEATI = 103 '' WARNING FOR ATI DRIVERS CONST DESTPATH = 200 CONST EXITFAILURE = 300 CONST EXITQUIT = 400 CONST EXITSUCCESS = 500 CONST OPTIONS = 600 CONST APPHELP = 700 CONST CUSTINST = 800 CONST TOOBIG = 900 CONST BADPATH = 1000 CONST RESTART = 2600 CONST RESTARTII = 2700 CONST PERSONALIZE = 10000 ''Bitmap ID CONST LOGO = 1 ''File Types CONST PROGRAMFILES = 1 CONST MSVIDEOFILES = 2 CONST QUICKTIMEFILES = 3 CONST TUTORIALFILES = 4 CONST NUMGROUPS = 4 '' Number of file groups: PROGRAM to TUTORIAL GLOBAL DEST$ ''Default destination directory. GLOBAL WINDRIVE$ ''Windows drive letter. GLOBAL INSTALLDLL$ GLOBAL ENOUGHDISK% rem Miscellaneous Constants rem ----------------------- CONST FILES_REMOVED = 1 CONST FILES_SKIPPED = 2 ''CustInst list symbol names GLOBAL MinorVer% GLOBAL WinSys32Dir$ GLOBAL PROGRAMNEEDS$ GLOBAL MSVIDEONEEDS$ GLOBAL QUICKTIMENEEDS$ GLOBAL TUTORIALNEEDS$ GLOBAL QDEST$ ''Default destination directory GLOBAL QDEST2$ '' DEST FOR WINDOWS QTW .EXE'S GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive GLOBAL BIGLIST$ ''List of option files cost calc results (boolean) ''Dialog list symbol names GLOBAL CHECKSTATES$ GLOBAL STATUSTEXT$ GLOBAL DRIVETEXT$ GLOBAL OnNT$ GLOBAL CD% DECLARE SUB AddOptFilesToCopyList (ftype%) DECLARE SUB RecalcOptFiles (ftype%) DECLARE SUB RecalcPath DECLARE SUB SetDriveStatus DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING DECLARE SUB X1 LIB "mscuistf.dll" (arg$) DECLARE SUB X2 LIB "mscuistf.dll" (arg$) DECLARE SUB X3 LIB "mscuistf.dll" (arg$) DECLARE SUB FixScreenProc LIB "mscuistf.dll" (arg%) DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER DECLARE FUNCTION IsDriveFloppy LIB "mscuistf.dll" (drive%) AS INTEGER DECLARE FUNCTION IsDriveCD LIB "mscuistf.dll" (drive%) AS INTEGER INIT: QDEST$ = GetWindowsSysDir QDEST2$ = GetWindowsDir WinSys32Dir$ = GetWindowsDir + "system32" ENOUGHDISK% = 1 hWnd%=HwndFrame() FixScreenProc ( hWnd% ) SWLxx&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN) SWyy%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED) INSTALLDLL$ = "mscuistf.dll" ''custom functions HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure SetBitmap INSTALLDLL$, LOGO SetTitle "Adobe Premiere Installer" MajorVer% = GetWindowsMajorVersion() MinorVer% = GetWindowsMinorVersion() IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN 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) END END IF ' Use Wowexec to determine version of NT. 3.1 did not stamp wowexec and wow returns 3.1 as version IF OnWindowsNT() THEN OnNT$ = "TRUE" WowVersion$ = GetVersionOfFile(GetWindowsDir() + "system32\wowexec.exe") IF WowVersion$ = "" THEN i% = DoMsgBox("Adobe Premiere does not run on Windows NT 3.1. Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF END IF szInf$ = GetSymbolValue("STF_SRCINFPATH") IF szInf$ = "" THEN szInf$ = GetSymbolValue("STF_CWDDIR") + "PREMIERE.INF" END IF ReadInfFile szInf$ WINDRIVE$ = MID$(GetWindowsDir, 1, 1) DEST$ = GetIniKeyString( GetWindowsDir() + "premiere.ini", "Premiere", "PremiereDirectory" ) IF IsDirWritable(DEST$) = 0 THEN DEST$ = WINDRIVE$ + ":\PREMIERE" END IF IF DEST$ = "" THEN DEST$ = WINDRIVE$ + ":\PREMIERE" END IF IF MID$( DEST, LEN(DEST), 1 ) = "\" THEN DEST$ = MID$( DEST, 1, LEN( DEST ) - 1 ) END IF ''CustInst list symbols CHECKSTATES$ = "CheckItemsState" STATUSTEXT$ = "StatusItemsText" DRIVETEXT$ = "DriveStatusText" FOR i% = 1 TO NUMGROUPS STEP 1 AddListItem CHECKSTATES$, "ON" NEXT i% FOR i% = 1 TO NUMGROUPS STEP 1 AddListItem STATUSTEXT$, "" NEXT i% FOR i% = 1 TO 7 STEP 1 AddListItem DRIVETEXT$, "" NEXT i% ReplaceListItem DRIVETEXT$, 7, DEST$ ''Disk cost list symbols PROGRAMNEEDS$ = "ProgramNeeds" MSVIDEONEEDS$ = "MSVideoNeeds" QUICKTIMENEEDS$ = "QuickTimeNeeds" TUTORIALNEEDS$ = "TutorialNeeds" EXTRACOSTS$ = "ExtraCosts" BIGLIST$ = "BigList" FOR i% = 1 TO NUMGROUPS STEP 1 AddListItem BIGLIST$, "" NEXT i% FOR i% = 1 TO 26 STEP 1 AddListItem EXTRACOSTS$, "0" NEXT i% RecalcPath SetDriveStatus '$IFDEF DEBUG i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal '$ENDIF ''DEBUG CUSTINST: sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN ''Install only if it will fit. IF ENOUGHDISK% = 0 THEN GOSUB TOOBIG GOTO CUSTINST END IF UIPop 1 GOTO INSTALL ELSEIF sz$ = "PATH" THEN GOTO GETPATH ELSEIF sz$ = "CHK1" THEN RecalcOptFiles PROGRAMFILES SetDriveStatus GOTO CUSTINST ELSEIF sz$ = "CHK2" THEN RecalcOptFiles MSVIDEOFILES SetDriveStatus GOTO CUSTINST ELSEIF sz$ = "CHK3" THEN RecalcOptFiles QUICKTIMEFILES SetDriveStatus GOTO CUSTINST ELSEIF sz$ = "CHK4" THEN RecalcOptFiles TUTORIALFILES SetDriveStatus GOTO CUSTINST ELSEIF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus GOTO CUSTINST ELSE GOSUB ASKQUIT GOTO CUSTINST END IF INSTALL: WinDir$ = GetWindowsDir() WinSysDir$ = GetWindowsSysDir() IF GetListItem( CHECKSTATES$, QUICKTIMEFILES ) = "ON" THEN j% = CheckForOld() ini$ = MakePath(WinDir$, "QTW.INI") CreateIniKeyValue ini$, "QuickTime for Windows", "Implementation", "Full" , cmoOverwrite RemoveIniKey ini$, "video", "optimize", cmoNone END IF j% = KillATICodecs() CopyFile GetWindowsDir() + "win.ini", GetWindowsDir() + "win.prm", cmoOverwrite, 0 CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.prm", cmoOverwrite, 0 CreateDir DEST$, cmoNone IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN CreateDir DEST$ + "\PLUGINS", cmoNone CreateDir DEST$ + "\4_PSHOP", cmoNone CreateDir DEST$ + "\DRIVERS", cmoNone CreateDir DEST$ + "\GOODIES", cmoNone CreateDir DEST$ + "\GOODIES\moreplug", cmoNone CreateDir DEST$ + "\GOODIES\morefont", cmoNone CreateDir DEST$ + "\3D_PARTY", cmoNone CreateDir DEST$ + "\3D_PARTY\cinetic", cmoNone CreateDir DEST$ + "\3D_PARTY\edlaccss", cmoNone CreateDir DEST$ + "\TITLES", cmoNone '' CreateDir DEST$ + "\MOTION", cmoNone ''-------------------------------------------------------------------------------------------- '' hack to remove old version of the AVI importer, in case we're install over '' Premiere 1.x: '' hack to remove old version of the QTW importer, in case we're install over '' Premiere 1.x: RemoveFile DEST$ + "\plugins\h-avi.prm", cmoForce RemoveFile DEST$ + "\plugins\d-moov.prm", cmoForce END IF IF GetListItem( CHECKSTATES$, TUTORIALFILES ) = "ON" THEN CreateDir DEST$ + "\SAMPLES", cmoNone END IF ''-------------------------------------------------------------------------------------------- '' force the old msrle.drv file to be removed. The SETUP program '' is unable to remove the beta version of this file, which can '' cause setup to fail. IF GetListItem( CHECKSTATES$, MSVIDEOFILES ) = "ON" THEN IF (OnWindowsNT() = 0) AND (MinorVer% < 50) THEN 'These files not necessary on Windows NT RemoveFile WinSysDir$ + "msrle.drv", cmoForce END IF END IF ''-------------------------------------------------------------------------------------------- '' go copy all the files... ClearCopyList AddOptFilesToCopyList PROGRAMFILES AddOptFilesToCopyList MSVIDEOFILES AddOptFilesToCopyList QUICKTIMEFILES AddOptFilesToCopyList TUTORIALFILES SetRestartDir WinDir$ CopyFilesInCopyList IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN CreateIniKeyValue "WIN.INI", "Extensions", "PPJ", DEST$ + "\PREMIERE.EXE ^.PPJ", cmoOverwrite CreateIniKeyValue "WIN.INI", "Extensions", "PSQ", DEST$ + "\PREMIERE.EXE ^.PSQ", cmoOverwrite CreateIniKeyValue "WIN.INI", "Extensions", "PLB", DEST$ + "\PREMIERE.EXE ^.PLB", cmoOverwrite RemoveFile GetWindowsDir() + "premiere.prf", cmoForce X$ = " " X1 ( X$ ) R$ = CHR$( LEN( X$ ) ) + X$ X$ = " " X2 ( X$ ) R$ = R$ + CHR$( LEN( X$ ) ) + X$ X$ = " " X3 ( X$ ) R$ = R$ + CHR$( LEN( X$ ) ) + X$ StampResource "ProgramFiles", "1", DEST$, 6, 65, R$, LEN( R$ ) CreateProgmanGroup "Adobe", "", cmoNone ShowProgmanGroup "Adobe", 1, cmoNone CreateProgmanItem "Adobe", "Premiere 4.0 Tryout", MakePath( DEST$, "premiere.exe" ), "", cmoOverwrite CreateProgmanItem "Adobe", "Premiere Tryout ReadMe", "write.exe " + MakePath( DEST$, "prreadme.wri" ), "", cmoOverwrite SrcDir$ = GetSymbolValue("STF_SRCDIR") IF InstallCD(SrcDir$) AND OnWindowsNT() = 0 THEN CD = 1 ELSE CD = 0 END IF CDDRIVENUM% = -1 IF CD <> 0 THEN CDDRIVENUM% = ASC(ucase$(SrcDir$)) - ASC("A") END IF rem IF CDDRIVENUM% >= 0 THEN rem CDDRIVE$ = CHR$( CDDRIVENUM% + ASC( "A" ) ) rem CreateProgmanItem "Adobe", "Deluxe CD", CDDRIVE$ + ":\deluxecd.exe", "deluxe.ico", cmoOverwrite rem END IF IF DoesFileExist( GetWindowsDir() + "photoshp.ini", femRead ) <> 0 THEN PHOTOSHOPPLUGINSDIR$ = GetIniKeyString( GetWindowsDir() + "photoshp.ini", "Photoshop", "PLUGINDIRECTORY" ) IF PHOTOSHOPPLUGINSDIR$ <> "" THEN CopyFile DEST$ + "\4_PSHOP\FILMST8B.8BI", PHOTOSHOPPLUGINSDIR$ + "\FILMST8B.8BI", cmoNone, 0 END IF END IF CreateIniKeyValue GetWindowsDir() + "premiere.ini", "Premiere", "PremiereDirectory", DEST$, cmoOverwrite END IF ''-------------------------------------------------------------------------------------------- ''-------------------------------------------------------------------------------------------- '' HACK FOR ATI MACH64/32 driver problem: IF NOT OnWindowsNT()THEN 'These files not necessary on Windows NT CreateIniKeyValue WinDir$ + "system.ini", "Macx", "DeviceBitmaps", "OFF", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Macx", "DeviceBitmap", "OFF", cmoOverwrite CreateIniKeyValue WinDir$ + "win.ini", "Mach", "DeviceBitmaps", "OFF", cmoOverwrite CreateIniKeyValue WinDir$ + "win.ini", "Mach", "DeviceBitmap", "OFF", cmoOverwrite END IF ''-------------------------------------------------------------------------------------------- ''-------------------------------------------------------------------------------------------- IF GetListItem( CHECKSTATES$, MSVIDEOFILES ) = "ON" THEN ''Updating WIN.INI and SYSTEM.INI CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "msrle.drv", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite IF (OnWindowsNT() = 0) AND (MinorVer% < 50) THEN 'These files not necessary on Windows NT IF VflatdPresent() = 0 THEN CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite END IF CreateIniKeyValue "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite END IF ''Do not register components not installed on NT or next version of Windows. IF (OnWindowsNT() = 0) AND (MinorVer% < 50) THEN 'These files not necessary on Windows NT Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg")) Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg")) Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg")) END IF ''NT and next version of Windows installation stop here. END IF IF GetListItem( CHECKSTATES$, QUICKTIMEFILES ) = "ON" THEN CreateIniKeyValue "WIN.INI", "Extensions", "mov", MakePath(WinDir$,"player.exe") + " ^.mov", cmoOverwrite CreateIniKeyValue "WIN.INI", "Extensions", "pic", MakePath(WinDir$,"viewer.exe") + " ^.pic", cmoOverwrite CreateIniKeyValue "WIN.INI", "MCI Extensions", "mov", "QTWVideo", cmoOverwrite CreateIniKeyValue "WIN.INI", "MCI Extensions", "pic", "QTWVideo", cmoOverwrite CreateIniKeyValue "WIN.INI", "MCI Extensions", "jpg", "QTWVideo", cmoOverwrite CreateIniKeyValue GetWindowsDir() + "system.ini", "mci", "QTWVideo", "mciqtw.drv", cmoOverwrite '' RUN MakePath(WinSysDir$, "player.exe") + " install" '' RUN MakePath(WinSysDir$, "viewer.exe") + " install" END IF '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows '' automatically; else, it gives the user the choice RESTRT% = RestartListEmpty () Exe$ = WinDir$ + "\_msrstrt.exe" Batch$ = WinDir$ + "\_mssetup.bat" empty$ = "" IF OnWindowsNT() THEN GOTO QUIT ENDIF RESTART: IF RESTRT% = 0 THEN sz$ = UIStartDlg(INSTALLDLL$, RESTART, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN GOTO RESTART ENDIF I% = ExitExecRestart () RemoveFile Exe$, cmoForce RemoveFile Batch$, cmoForce END ELSE sz$ = UIStartDlg(INSTALLDLL$, RESTARTII, "FQuitDlgProc", 0, "") IF sz$ = "CONTINUE" THEN I% = ExitWindowsExec (Exe$, empty$) IF I% = 0 THEN GOTO RESTART ELSE END ENDIF ELSEIF sz$ = "EXIT" THEN UIPopAll END ELSEIF sz$ = "REACTIVATE" THEN GOTO RESTART ELSE UIPop 1 END IF END IF QUIT: ON ERROR GOTO ERRQUIT IF ERR = 0 THEN dlg% = EXITSUCCESS ELSEIF ERR = STFQUIT THEN dlg% = EXITQUIT ELSE dlg% = EXITFAILURE END IF QUITL1: sz$ = UIStartDlg(INSTALLDLL$, dlg%, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN GOTO QUITL1 END IF UIPop 1 END ERRQUIT: i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END GETPATH: SetSymbolValue "EditTextIn", DEST$ SetSymbolValue "EditFocus", "ALL" GETPATHL1: sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN olddest$ = DEST$ DEST$ = GetSymbolValue("EditTextOut") ''Validate new path. IF LEN( DEST ) < 4 THEN GOSUB BADPATH GOTO GETPATHL1 END IF '' IF MID$( DEST, 1, 1 ) = "A" THEN '' GOSUB BADPATH '' GOTO GETPATHL1 '' END IF '' IF MID$( DEST, 1, 1 ) = "B" THEN '' GOSUB BADPATH '' GOTO GETPATHL1 '' END IF IF IsDirWritable(DEST$) = 0 THEN GOSUB BADPATH GOTO GETPATHL1 END IF IF MID$( DEST, LEN(DEST), 1 ) = "\" THEN DEST$ = MID$( DEST, 1, LEN( DEST ) - 1 ) END IF UIPop 1 ''Truncate display if too long. IF LEN(DEST$) > 23 THEN ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..." ELSE ReplaceListItem DRIVETEXT$, 7, DEST$ END IF ''Recalc if path changed. IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN RecalcPath SetDriveStatus END IF olddest$ = "" GOTO CUSTINST ELSEIF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus GOTO GETPATHL1 ELSEIF sz$ = "EXIT" THEN GOSUB ASKQUIT GOTO GETPATHL1 ELSE UIPop 1 GOTO CUSTINST END IF TOOBIG: sz$ = UIStartDlg(INSTALLDLL$, TOOBIG, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus GOTO TOOBIG END IF UIPop 1 RETURN BADPATH: sz$ = UIStartDlg(INSTALLDLL$, BADPATH, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus GOTO BADPATH END IF UIPop 1 RETURN ASKQUIT: sz$ = UIStartDlg(INSTALLDLL$, ASKQUIT, "FQuitDlgProc", 0, "") IF sz$ = "EXIT" THEN UIPopAll ERROR STFQUIT ELSEIF sz$ = "REACTIVATE" THEN GOTO ASKQUIT ELSE UIPop 1 END IF RETURN '** '** Purpose: '** Adds the specified option files to the copy list. '** Arguments: '** ftype% - type of files to add, one of the following: '** PROGRAMFILES, TUTORIALFILES ... '** Returns: '** none. '************************************************************************* SUB AddOptFilesToCopyList (ftype%) STATIC IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN SrcDir$ = GetSymbolValue("STF_SRCDIR") IF ftype% = PROGRAMFILES THEN AddSectionFilesToCopyList "ProgramFiles", SrcDir$, DEST$ AddSectionFilesToCopyList "PluginFiles", SrcDir$, DEST$ + "\plugins" AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir() AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir() AddSectionFilesToCopyList "PhotoshopFiles", SrcDir$, DEST$ + "\4_pshop" AddSectionFilesToCopyList "MotionFiles", SrcDir$, DEST$ + "\motion" AddSectionFilesToCopyList "TitlesFiles", SrcDir$, DEST$ + "\titles" AddSectionFilesToCopyList "ThirdPartyFiles", SrcDir$, DEST$ + "\3d_party" AddSectionFilesToCopyList "CineticFiles", SrcDir$, DEST$ + "\3d_party\cinetic" AddSectionFilesToCopyList "EdlAccessFiles", SrcDir$, DEST$ + "\3d_party\edlaccss" AddSectionFilesToCopyList "GoodiesFiles", SrcDir$, DEST$ + "\goodies" AddSectionFilesToCopyList "MorePlugFiles", SrcDir$, DEST$ + "\goodies\moreplug" AddSectionFilesToCopyList "MoreFontFiles", SrcDir$, DEST$ + "\goodies\morefont" AddSectionFilesToCopyList "DriversFiles", SrcDir$, DEST$ + "\drivers" ELSEIF ftype% = MSVIDEOFILES THEN IF (OnWindowsNT() = 0) AND (MinorVer% < 50) THEN 'These files not necessary on Windows NT AddSectionFilesToCopyList "MSVideoFiles", SrcDir$, GetWindowsDir() AddSectionFilesToCopyList "MSVideoSysFiles", SrcDir$, GetWindowsSysDir() ENDIF IF (OnWindowsNT()) THEN AddSectionFilesToCopyList "MSVideoNTFiles", SrcDir$, WinSys32Dir$ ENDIF ELSEIF ftype% = QUICKTIMEFILES THEN AddSectionFilesToCopyList "QuickTimeFiles", SrcDir$, GetWindowsSysDir() AddSectionFilesToCopyList "QuickTimeWinFiles", SrcDir$, GetWindowsDir() ELSEIF ftype% = TUTORIALFILES THEN AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\samples" END IF SrcDir$ = "" END IF END SUB '** '** Purpose: '** Recalculates disk space for the given option files and sets '** the status info symbol "StatusItemsText". '** Arguments: '** ftype% - type of files to add, one of the following: '** PROGRAMFILES, PLUGINFILES... '** Returns: '** none. '************************************************************************* SUB RecalcOptFiles (ftype%) STATIC CursorSave% = ShowWaitCursor() ClearCopyList AddOptFilesToCopyList ftype% fExtra% = 0 ndrive% = 1 idrive% = 1 IF ftype% = PROGRAMFILES THEN ListSym$ = PROGRAMNEEDS$ IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN ''Add extra cost to Windows drive for ini/progman, etc. ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1 ReplaceListItem EXTRACOSTS$, ndrive%, "20000" idrive% = ASC(ucase$(DEST$)) - ASC("A") + 1 ReplaceListItem EXTRACOSTS$, idrive%, "200000" fExtra% = 1 END IF ELSEIF ftype% = MSVIDEOFILES THEN ListSym$ = MSVIDEONEEDS$ IF GetListItem(CHECKSTATES$, MSVIDEOFILES) = "ON" THEN ''Add extra cost to Windows drive for ini/progman, etc. ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1 ReplaceListItem EXTRACOSTS$, ndrive%, "20000" fExtra% = 1 END IF ELSEIF ftype% = QUICKTIMEFILES THEN ListSym$ = QUICKTIMENEEDS$ IF GetListItem(CHECKSTATES$, QUICKTIMEFILES) = "ON" THEN ''Add extra cost to Windows drive for ini/progman, etc. ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1 ReplaceListItem EXTRACOSTS$, ndrive%, "20000" fExtra% = 1 END IF ELSEIF ftype% = TUTORIALFILES THEN ListSym$ = TUTORIALNEEDS$ IF GetListItem(CHECKSTATES$, TUTORIALFILES) = "ON" THEN ''Add extra cost to Windows drive for ini/progman, etc. idrive% = ASC(ucase$(DEST$)) - ASC("A") + 1 ReplaceListItem EXTRACOSTS$, idrive%, "60000" fExtra% = 1 END IF END IF StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "") cost& = 0 FOR i% = 1 TO 26 STEP 1 cost& = cost& + VAL(GetListItem(ListSym$, i%)) NEXT i% ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K" IF StillNeed& > 0 THEN ReplaceListItem BIGLIST$, ftype%, "YES" ELSE ReplaceListItem BIGLIST$, ftype%, "" END IF IF fExtra% THEN ReplaceListItem EXTRACOSTS$, ndrive%, "0" ReplaceListItem EXTRACOSTS$, idrive%, "0" END IF RestoreCursor CursorSave% ListSym$ = "" END SUB '** '** Purpose: '** Recalculates disk space and sets option status info according '** to the current destination path. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB RecalcPath STATIC CursorSave% = ShowWaitCursor() RecalcOptFiles PROGRAMFILES RecalcOptFiles MSVIDEOFILES RecalcOptFiles QUICKTIMEFILES RecalcOptFiles TUTORIALFILES RestoreCursor CursorSave% END SUB '** '** Purpose: '** Sets drive status info according to latest disk space calcs. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB SetDriveStatus STATIC ENOUGHDISK% = 1 drive$ = MID$(DEST$, 1, 1) ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1 cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) ) cost& = cost& + VAL( GetListItem( MSVIDEONEEDS$, ndrive% ) ) cost& = cost& + VAL( GetListItem( QUICKTIMENEEDS$, ndrive% ) ) cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) ) free& = GetFreeSpaceForDrive(drive$) ReplaceListItem DRIVETEXT$, 1, drive$ + ":" ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K" ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K" IF cost& > free& THEN ENOUGHDISK% = 0 END IF IF drive$ = WINDRIVE$ THEN ReplaceListItem DRIVETEXT$, 4, "" ReplaceListItem DRIVETEXT$, 5, "" ReplaceListItem DRIVETEXT$, 6, "" ELSE ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1 cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) ) cost& = cost& + VAL( GetListItem( MSVIDEONEEDS$, ndrive% ) ) cost& = cost& + VAL( GetListItem( QUICKTIMENEEDS$, ndrive% ) ) cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) ) IF cost& = 0 THEN ReplaceListItem DRIVETEXT$, 4, "" ReplaceListItem DRIVETEXT$, 5, "" ReplaceListItem DRIVETEXT$, 6, "" ELSE free& = GetFreeSpaceForDrive(WINDRIVE$) ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":" ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K" ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K" END IF IF cost& > free& THEN ENOUGHDISK% = 0 END IF END IF END SUB '** '** Purpose: '** Appends a file name to the end of a directory path, '** inserting a backslash character as needed. '** Arguments: '** szDir$ - full directory path (with optional ending "\") '** szFile$ - filename to append to directory '** Returns: '** Resulting fully qualified path name. '************************************************************************* FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING IF szDir$ = "" THEN MakePath = szFile$ ELSEIF szFile$ = "" THEN MakePath = szDir$ ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN MakePath = szDir$ + szFile$ ELSE MakePath = szDir$ + "\" + szFile$ END IF END FUNCTION rem Check for Older versions of the Quicktime For Windows components rem --------------------------------------------------------------- FUNCTION CheckForOld STATIC AS INTEGER '' sz$ = UIStartDlg(INSTALLDLL$, OLDMESS, "FModelessDlgProc", 0, "") CheckForOld1: cursor% = ShowWaitCursor() OldFilePath$ = FindFileUsingFileOpen("qtim.dll") RestoreCursor cursor% IF (OldFilePath$ <> "") THEN j% = RemoveOldQTFiles(OldFilePath$) IF j% = FILES_REMOVED THEN GOTO CheckForOld1 rem If the files were not removed, there's no need to prompt rem a second time. ELSEIF j% = FILES_SKIPPED THEN GOTO EndCheckForOld END IF END IF CheckForOld2: cursor% = ShowWaitCursor() OldFilePath$ = FindFileUsingFileOpen("qtimcmgr.dll") RestoreCursor cursor% IF (OldFilePath$ <> "") THEN j% = RemoveOldQTFiles(OldFilePath$) IF j% = FILES_REMOVED THEN GOTO CheckForOld2 ELSEIF j% = FILES_SKIPPED THEN GOTO EndCheckForOld END IF END IF EndCheckForOld: UIPOP 1 END FUNCTION FUNCTION RemoveOldQTFiles (FilePath$) STATIC AS INTEGER RemoveOldQTFiles = FILES_SKIPPED SPLITPATH FilePath$, drv$, dir$, filename$, ext$ DeadPath$ = drv$ + dir$ rem check version resources if they exist i% = GetQTWVersion(FilePath$) szVersion$ = GetSymbolValue ("VersionString") IF szVersion$ < "2.0.1.41" THEN rem dialog choices are Remove,Skip ("Continue","Back" buttons) rem SetSymbolValue "EditTextIn", "Found Version [" + szVersion$ + "] on " + DeadPath$ rem sz$ = UIStartDlg(INSTALLDLL$, NUKEOLD, "SkipReplaceDlgProc", 0, "") rem UIPop 1 rem IF sz$ = "BACK" THEN rem EXIT FUNCTION rem END IF rem IF sz$ = "CANCEL" THEN rem EXIT FUNCTION rem END IF rem IF sz$ <> "CONTINUE" THEN rem EXIT FUNCTION rem END IF rem all versions RemoveFile MakePath(DeadPath$, "qtim.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtimcmgr.dll"), cmoForce rem version 1.0.0 RemoveFile MakePath(DeadPath$, "qcmc.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtjpeg.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtraw.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtsmc.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtrpza.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtrle.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtcvid.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtrt21.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtvhdw.dll"), cmoForce rem version 1.1.x and later RemoveFile MakePath(DeadPath$, "mciqtw.drv"), cmoForce RemoveFile MakePath(DeadPath$, "qcmc.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtjpeg.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtraw.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtsmc.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtrpza.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtrle.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtcvid.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtrt21.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "navg.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtiv31.qtc"), cmoForce rem version 1.9 and later RemoveFile MakePath(DeadPath$, "qtvhdw.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtyvu9.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtmsvc.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtiv32.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtiyvu9.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "qtvhdw.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "dhio_dh.qtc"), cmoForce RemoveFile MakePath(DeadPath$, "reelmgic.qtc"), cmoForce rem Other miscellaneous files RemoveFile MakePath(DeadPath$, "qtreadme.wri"), cmoForce RemoveFile MakePath(DeadPath$, "qthndlr.dll"), cmoForce RemoveFile MakePath(DeadPath$, "qtnotify.exe"), cmoForce RemoveFile MakePath(DeadPath$, "qtole.dll"), cmoForce RemoveOldQTFiles = FILES_REMOVED ELSE RemoveOldQTFiles = FILES_SKIPPED END IF EndRemoveOldQTFiles: END FUNCTION FUNCTION KillATICodecs STATIC AS INTEGER IF NOT OnWindowsNT() THEN check1$ = GetIniKeyString( GetWindowsDir() + "system.ini", "Drivers", "VIDC.MSVC" ) check2$ = GetIniKeyString( GetWindowsDir() + "system.ini", "Drivers", "VIDC.MRLE" ) check1$ = ucase$(check1$) check2$ = ucase$(check2$) IF (check1$ = "ATIVDACC.DRV") OR (check2$ = "ATIVDACC.DRV") THEN sz$ = UIStartDlg(INSTALLDLL$, NUKEATI, "Finfo0DlgProc", 0, "") if sz$ = "CONTINUE" THEN RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.MSVC", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.MRLE", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.CVID", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.IV31", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.IV32", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.RT21", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.YVU9", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "ATIVIDEO", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.RLE", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.ATI0", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.DIB", cmoForce RemoveIniKey GetWindowsDir() + "system.ini", "Drivers", "VIDC.YV12", cmoForce RemoveIniSection GetWindowsDir() + "system.ini", "ATI Interceptor", cmoForce RemoveIniSection GetWindowsDir() + "system.ini", "Installable Compressors", cmoForce END IF END IF END IF UIPOP 1 END FUNCTION FUNCTION InstallCD(Dir$) STATIC AS INTEGER CDDRIVENUM% = ASC(ucase$(Dir$)) - ASC("A") IF (IsDriveCD(CDDRIVENUM%) = 1) THEN InstallCD = 1 ELSE InstallCD = 0 ENDIF END FUNCTION