home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC & Mediji 1996 March
/
PCM_9603.iso
/
programi
/
photoshp
/
disk1
/
photoshp.mst
< prev
next >
Wrap
Text File
|
1994-11-09
|
27KB
|
884 lines
'* Adobe Photoshop Installer
'*
'* June 5, 1993 Marshall Spight (original Premiere ver)
'* June 16, 1993 Dave Corboy (modified for Photoshop)
'*
'*
'*
'*
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''CONST B$ = "Installation Problem"
''CONST C$ = "Setup sources were corrupted!"
'' It's always hard to remember the syntax of the following function:
''i% = DoMsgBox( "Foo", "Bar", MB_OK )
''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
DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
''Dialog ID's
CONST ASKQUIT = 100
CONST DESTPATH = 200
CONST EXITFAILURE = 300
CONST EXITQUIT = 400
CONST EXITSUCCESS = 500
CONST EXITRESTART = 550
CONST OPTIONS = 600
CONST APPHELP = 700
CONST CUSTINST = 800
CONST CUSTINSTCD = 801
CONST TOOBIG = 900
CONST BADPATH = 1000
CONST NOVM = 1100
CONST NEED31 = 1200
CONST NEEDENH = 1300
CONST NEEDSHARE = 1400
CONST CORRUPT = 1500
CONST PERSONALIZE = 10000
''Bitmap ID
CONST LOGO = 1
''File Types
CONST PROGRAMFILES = 1
CONST TUTORIALFILES = 2
CONST PATTERNFILES = 3
CONST DUOTONEFILES = 4
CONST FILTERFILES = 5
CONST DELUXEFILES = 6
CONST NUMGROUPS = 6 '' Number of file groups: PROGRAM to TUTORIAL
GLOBAL DEST$ ''Default destination directory.
GLOBAL DESTSYS$
GLOBAL DEST32S$
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL WINDIR$ ''Windows directory without drive letter.
GLOBAL PHOTOCDDRIVE$
GLOBAL PHOTOCDPT$
GLOBAL PHOTOCDCP$
GLOBAL ENOUGHDISK% ''Enough space to install
GLOBAL QTWDIR$
''CustInst list symbol names
GLOBAL PROGRAMNEEDS$
GLOBAL TUTORIALNEEDS$
GLOBAL PATTERNNEEDS$
GLOBAL DUOTONENEEDS$
GLOBAL FILTERNEEDS$
GLOBAL DELUXENEEDS$
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 InstallWin32s%
GLOBAL CD%
DECLARE SUB AddOptFilesToCopyList (ftype%, bogus%)
DECLARE SUB RecalcOptFiles (ftype%)
DECLARE SUB RecalcPath
DECLARE SUB SetDriveStatus
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION CDInstall LIB "mscuistf.dll" AS INTEGER
DECLARE FUNCTION GetCDDrive LIB "mscuistf.dll" AS INTEGER
DECLARE SUB XXX LIB "mscuistf.dll" (arg$)
DECLARE SUB FixScreenProc LIB "mscuistf.dll" (arg%)
DECLARE SUB UpdateSystemIni
DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION PagingEnabled LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION ShareEnabled LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
INIT:
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 Photoshop Installer"
IF CDInstall() AND OnWindowsNT() = 0 THEN
CD = 1
ELSE
CD = 0
END IF
MajorVer% = GetWindowsMajorVersion()
MinorVer% = GetWindowsMinorVersion()
IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
sz$ = UIStartDlg(INSTALLDLL$, NEED31, "FInfo0DlgProc", 0, "")
UIPop 1
ERR% = STFQUIT '' Need windows 3.1 or later.
GOTO QUIT
END IF
InstallWin32s = 1
IF MajorVer% > 3 THEN
InstallWin32s% = 0
END IF
IF OnWindowsNT() THEN
InstallWin32s% = 0
ELSE
IF GetWindowsMode < 2 THEN
sz$ = UIStartDlg(INSTALLDLL$, NEEDENH, "FInfo0DlgProc", 0, "")
UIPop 1
ERR% = STFQUIT '' Not Enhanced mode.
GOTO QUIT
END IF
END IF
'' Get version of Win32s to be installed from version info in file
szNewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "WIN32S16.DLL" )
DESTSYS$ = GetWindowsSysDir()
DEST32S$ = DESTSYS$ + "WIN32S\"
szOldVer$ ="1.00.000 " ''Reserve space in string for version
'' If Win32s is already installed, get running version number
i% = DoesFileExist( DESTSYS$ + "W32SYS.DLL", femExists )
IF i% = 1 THEN
i% = IsWin32sLoaded( szOldVer$ )
ENDIF
IF i% <> 0 AND szNewVer$ <> "" THEN
IF szNewVer$ > szOldVer$ THEN
'' do nothing
ELSE
InstallWin32s% = 0
END IF
END IF
IF InstallWin32s = 1 AND PagingEnabled() = 0 THEN
sz$ = UIStartDlg(INSTALLDLL$, NOVM, "FInfo0DlgProc", 0, "")
UIPop 1
ERR% = STFQUIT '' Enhanced mode but not paging
GOTO QUIT
END IF
''IF ShareEnabled() = 0 THEN
''sz$ = UIStartDlg(INSTALLDLL$, NEEDSHARE, "FInfo0DlgProc", 0, "")
''UIPop 1
''ERR% = STFQUIT
''GOTO QUIT
''END IF
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "PHOTOSHP.INF"
END IF
ReadInfFile szInf$
WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
IF OnWindowsNT() THEN
DEST$ = WINDRIVE$ + ":\WIN32APP\PHOTOSHP"
ELSE
DEST$ = WINDRIVE$ + ":\PHOTOSHP"
END IF
SetRestartDir GetWindowsDir()
QTWDIR$ = GetWindowsSysDir()
''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"
TUTORIALNEEDS$ = "TutorialNeeds"
PATTERNNEEDS$ = "PatternNeeds"
DUOTONENEEDS$ = "DuotoneNeeds"
FILTERNEEDS$ = "FilterNeeds"
DELUXENEEDS$ = "DeluxeNeeds"
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%
'' PhotoCD rigamarole
WINDIR$ = MID$( GetWindowsDir(), 3, LEN( GetWindowsDir() ) - 2 )
IF DoesFileExist( GetWindowsDir() + "kpcms.ini", femExists ) = 1 THEN
PHOTOCDDRIVE$ = GetIniKeyString( GetWindowsDir() + "KPCMS.INI", "KEPS Precision", "DRIVE" )
PHOTOCDPT$ = GetIniKeyString( GetWindowsDir() + "KPCMS.INI", "API", "PT_DIR" )
PHOTOCDCP$ = GetIniKeyString( GetWindowsDir() + "KPCMS.INI", "KCP", "CP_DIR" )
ELSE
PHOTOCDDRIVE$ = WINDRIVE$ + ":"
PHOTOCDPT$ = WINDIR$ + "PHOTOCD\"
PHOTOCDCP$ = WINDIR$ + "PHOTOCD\"
CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "KEPS Precision", "DRIVE", WINDRIVE$ + ":", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "API", "PT_DIR", PHOTOCDPT$, cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "KCP", "CP_DIR", PHOTOCDCP$, cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "API", "CFG_FILE", "KPPrefs.cfg", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "KCP", "CTE_NAME", "", cmoOverwrite
CreateDir GetWindowsDir() + "PHOTOCD", cmoNone
END IF
RecalcPath
SetDriveStatus
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
'$ENDIF ''DEBUG
CUSTINST:
''IF CD <> 0 THEN
''sz$ = UIStartDlg(INSTALLDLL$, CUSTINSTCD, "FCustInstDlgProc", APPHELP, HELPPROC$)
''ELSE
''sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
''END IF
GOTO GETPATH
CUSTINST2:
''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 TUTORIALFILES
''SetDriveStatus
''GOTO CUSTINST
''ELSEIF sz$ = "CHK3" THEN
''RecalcOptFiles PATTERNFILES
''SetDriveStatus
''GOTO CUSTINST
''ELSEIF sz$ = "CHK4" THEN
''RecalcOptFiles DUOTONEFILES
''SetDriveStatus
''GOTO CUSTINST
''ELSEIF sz$ = "CHK5" THEN
''RecalcOptFiles FILTERFILES
''SetDriveStatus
''GOTO CUSTINST
''ELSEIF sz$ = "CHK6" THEN
''IF CD <> 0 THEN
''RecalcOptFiles DELUXEFILES
''END IF
''SetDriveStatus
''GOTO CUSTINST
''ELSEIF sz$ = "REACTIVATE" THEN
''RecalcPath
''SetDriveStatus
''GOTO CUSTINST
''ELSE
''GOSUB ASKQUIT
''GOTO CUSTINST
''END IF ***
INSTALL:
IF (MID$(DEST$, LEN(DEST$), 1) <> ":") THEN
CreateDir DEST$, cmoNone
END IF
'' IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN ***
''TRYAGAIN: ***
''sz$ = UIStartDlg(INSTALLDLL$, PERSONALIZE, "dlgPERinstall", 0, "" )
''IF sz$ <> "VALID" THEN
''GOSUB ASKQUIT
''UIPop 1
''GOTO TRYAGAIN
''END IF
'' END IF ***
IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN
RemoveFile GetWindowsDir() + "PHOTOS30.INI", cmoNone
''RemoveFile GetWindowsDir() + "PHOTOS30.PSP", cmoNone
CreateDir DEST$ + "\PLUGINS", cmoNone
''CreateDir DEST$ + "\CMDSETS", cmoNone ***
''CreateDir DEST$ + "\CALIBRAT", cmoNone ***
''CreateDir DEST$ + "\BRUSHES", cmoNone ***
''CreateDir DEST$ + "\PALETTES", cmoNone ***
IF InstallWin32s = 1 THEN
CreateDir DEST32S$, cmoNone
IF DoesFileExist( GetWindowsSysDir() + "olecli.dll", femExists ) = 1 THEN
IF DoesFileExist( GetWindowsSysDir() + "olecli.w31", femExists ) = 0 THEN
CopyFile GetWindowsSysDir() + "olecli.dll", GetWindowsSysDir() + "olecli.w31", cmoOverwrite, 0
END IF
END IF
END IF
END IF
IF GetListItem( CHECKSTATES$, TUTORIALFILES ) = "ON" THEN
CreateDir DEST$ + "\TUTORIAL", cmoNone
END IF
''IF GetListItem( CHECKSTATES$, PATTERNFILES ) = "ON" THEN ***
''CreateDir DEST$ + "\PATTERNS", cmoNone
''END IF
''IF GetListItem( CHECKSTATES$, DUOTONEFILES ) = "ON" THEN ***
''CreateDir DEST$ + "\DUOTONES\DUOTONE\PMS", cmoNone
''CreateDir DEST$ + "\DUOTONES\DUOTONE\PROCESS", cmoNone
''CreateDir DEST$ + "\DUOTONES\DUOTONE\GRAY", cmoNone
''CreateDir DEST$ + "\DUOTONES\TRITONE\PMS", cmoNone
''CreateDir DEST$ + "\DUOTONES\TRITONE\PROCESS", cmoNone
''CreateDir DEST$ + "\DUOTONES\TRITONE\GRAY", cmoNone
''CreateDir DEST$ + "\DUOTONES\QUADTONE\PMS", cmoNone
''CreateDir DEST$ + "\DUOTONES\QUADTONE\PROCESS", cmoNone
''CreateDir DEST$ + "\DUOTONES\QUADTONE\GRAY", cmoNone
''END IF
IF GetListItem( CHECKSTATES$, FILTERFILES ) = "ON" THEN
CreateDir DEST$ + "\PLUGINS", cmoNone
CreateDir DEST$ + "\PLUGINS\LtStyles", cmoNone
''CreateDir DEST$ + "\3RDPARTY", cmoNone
END IF
ClearCopyList
AddOptFilesToCopyList PROGRAMFILES, 0
AddOptFilesToCopyList TUTORIALFILES, 0
AddOptFilesToCopyList PATTERNFILES, 0
AddOptFilesToCopyList DUOTONEFILES, 0
AddOptFilesToCopyList FILTERFILES, 0
IF CD <> 0 THEN
AddOptFilesToCopyList DELUXEFILES, 0
END IF
CopyFilesInCopyList
'' IF DoesFileExist( GetWindowsDir() + "photos30.ini", femExists ) = 0 THEN
'' RenameFile GetWindowsDir() + "photoshp.ini", "photos25.ini"
'' RenameFIle GetWindowsDir() + "photoshp.psp", "photos25.psp"
'' END IF
IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
''Updating PHOTOSHOP.INI and SYSTEM.INI
IF DoesFileExist( GetWindowsDir() + "photoshp.ini", femExists ) = 1 THEN
CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "NOTE", "The name of the INI file for Photoshop 3.0 is photos30.ini", cmoOverwrite
END IF
CreateIniKeyValue GetWindowsDir() + "photos30.ini", "Photoshop", "PhotoshopDirectory", DEST$ + "\", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "photos30.ini", "Photoshop", "PlugInDirectory", DEST$ + "\PLUGINS", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "photos30.ini", "Photoshop", "StartUpImageDirectory", DEST$ + "\TUTORIAL", cmoOverwrite
CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.bak", cmoOverwrite, 0
CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobekey", "adobekey.drv", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobemse", "adobemse.drv", cmoOverwrite
CreateIniKeyValue "win.ini", "Extensions", "psd", DEST$ + "\photoshp.exe ^.psd", cmoOverwrite
''XXX ( DEST$ ) ***
IF InstallWin32s = 1 THEN
CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "0", cmoOverwrite
'' Indicate Win32s install failure until all files known to be copied.
ExitCode% = EXITFAILURE
ERR = 0
UpdateSystemIni
'' Terminate if unhandled fatal error
IF ERR <> 0 THEN
GOTO QUIT
END IF
CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "1", cmoOverwrite
CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Version", szNewVer$, cmoOverwrite
CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Nls", "AnsiCP", "1252", cmoOverwrite
END IF
''WINDIR$ = MID$( GetWindowsDir(), 3, LEN( GetWindowsDir() ) - 2 )
''CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "KEPS Precision", "DRIVE", WINDRIVE$ + ":", cmoOverwrite
''CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "API", "PT_DIR", WINDIR$ + "PHOTOCD\", cmoOverwrite
''CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "KCP", "CP_DIR", WINDIR$ + "PHOTOCD\", cmoOverwrite
CDDRIVENUM% = -1
IF CD <> 0 THEN
IF GetListItem( CHECKSTATES$, DELUXEFILES ) = "ON" THEN
CDDRIVENUM% = GetCDDrive()
END IF
END IF
CreateProgmanGroup "Adobe", "", cmoNone
ShowProgmanGroup "Adobe", 1, cmoNone
CreateProgmanItem "Adobe", "Photoshop 3.0 Tryout", MakePath( DEST$, "photoshp.exe" ), "", cmoOverwrite
CreateProgmanItem "Adobe", "Photoshop ReadMe", "write.exe " + MakePath( DEST$, "psreadme.wri" ), "", cmoOverwrite
IF CDDRIVENUM% >= 0 THEN
CDDRIVE$ = CHR$( CDDRIVENUM% + ASC( "A" ) )
CreateProgmanItem "Adobe", "Photoshop 3.0 Deluxe CD", CDDRIVE$ + ":\psdeluxe\psdeluxe.exe", "psdeluxe.ico", cmoOverwrite
END IF
ELSE
IF CD <> 0 THEN
IF GetListItem( CHECKSTATES$, DELUXEFILES ) = "ON" THEN
CDDRIVENUM% = -1
CDDRIVENUM% = GetCDDrive()
IF CDDRIVENUM% >= 0 THEN
CreateProgmanGroup "Adobe", "", cmoNone
ShowProgmanGroup "Adobe", 1, cmoNone
CDDRIVE$ = CHR$( CDDRIVENUM% + ASC( "A" ) )
CreateProgmanItem "Adobe", "Photoshop 3.0 Deluxe CD", CDDRIVE$ + ":\psdeluxe\psdeluxe.exe", "psdeluxe.ico", cmoOverwrite
END IF
END IF
END IF
END IF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
IF RestartListEmpty() = 0 OR InstallWin32s = 1 THEN
GOTO QUITR
ELSE
dlg% = EXITSUCCESS
END IF
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
QUITR:
sz$ = UIStartDlg(INSTALLDLL$, EXITRESTART, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITR
END IF
UIPop 1
i% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
'' i% = RestartListEmpty()
'' IF i% = 0 THEN
'' i% = ExitExecRestart()
'' ELSE
'' i% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
'' ENDIF
GOTO QUITR
ERRQUIT:
sz$ = UIStartDlg(INSTALLDLL$, CORRUPT, "FInfo0DlgProc", 0, "")
UIPop 1
END
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
IF (MID$(DEST$, LEN(DEST$), 1) = "\") THEN
DEST$ = MID$(DEST$, 1, LEN(DEST$)-1)
END IF
''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$) THEN
RecalcPath
SetDriveStatus
END IF
olddest$ = ""
'' GOTO CUSTINST changed to GOTO CUSTINST2
GOTO CUSTINST2
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO GETPATHL1
'' ELSEIF changed to ELSE
''ELSEIF sz$ = "EXIT" THEN ***
ELSE
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, DUOTONEFILES ...
'** Returns:
'** none.
'*************************************************************************
SUB AddOptFilesToCopyList (ftype%, bogus%) 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 "ProgramWinSysNTFiles", SrcDir$, GetWindowsSysDir()
AddSectionFilesToCopyList "PhotoCDPT", SrcDir$, PHOTOCDDRIVE$ + PHOTOCDPT$
AddSectionFilesToCopyList "PhotoCDCP", SrcDir$, PHOTOCDDRIVE$ + PHOTOCDCP$
IF OnWindowsNT() = 0 THEN
AddSectionFilesToCopyList "PluginFiles16", SrcDir$, DEST$ + "\plugins"
AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir()
''ELSE ***
''AddSectionFilesToCopyList "PluginFiles32", SrcDir$, DEST$ + "\plugins" ***
END IF
''AddSectionFilesToCopyList "CmdSets", SrcDir$, DEST$ + "\cmdsets" ***
AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir()
''AddSectionFilesToCopyList "CalibrateFiles", SrcDir$, DEST$ + "\calibrat" ***
''AddSectionFilesToCopyList "BrushFiles", SrcDir$, DEST$ + "\brushes" ***
''AddSectionFilesToCopyList "PaletteFiles", SrcDir$, DEST$ + "\palettes" ***
IF bogus% = 1 THEN
AddSectionFilesToCopyList "BogusFiles", SrcDir$, DEST$ + "\"
ELSE
AddSectionFilesToCopyList "SplitFiles", SrcDir$, DEST$ + "\"
END IF
IF InstallWin32s = 1 THEN
AddSectionFilesToCopyList "Win32sWinSys", SrcDir$, DESTSYS$
AddSectionFilesToCopyList "Win32sWinSysWin32s", SrcDir$, DESTSYS$ + "WIN32S\"
END IF
ELSEIF ftype% = TUTORIALFILES THEN
AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\tutorial"
''ELSEIF ftype% = PATTERNFILES THEN ***
''AddSectionFilesToCopyList "PatternFiles", SrcDir$, DEST$ + "\patterns" ***
''ELSEIF ftype% = DUOTONEFILES THEN ***
''AddSectionFilesToCopyList "DuoDuoPms", SrcDir$, DEST$ + "\duotones\duotone\pms"
''AddSectionFilesToCopyList "DuoDuoProc", SrcDir$, DEST$ + "\duotones\duotone\process"
''AddSectionFilesToCopyList "DuoDuoGray", SrcDir$, DEST$ + "\duotones\duotone\gray"
''AddSectionFilesToCopyList "DuoTriPms", SrcDir$, DEST$ + "\duotones\tritone\pms"
''AddSectionFilesToCopyList "DuoTriProc", SrcDir$, DEST$ + "\duotones\tritone\process"
''AddSectionFilesToCopyList "DuoTriGray", SrcDir$, DEST$ + "\duotones\tritone\gray"
''AddSectionFilesToCopyList "DuoQuadPms", SrcDir$, DEST$ + "\duotones\quadtone\pms"
''AddSectionFilesToCopyList "DuoQuadProc", SrcDir$, DEST$ + "\duotones\quadtone\process"
''AddSectionFilesToCopyList "DuoQuadGray", SrcDir$, DEST$ + "\duotones\quadtone\gray"
ELSEIF ftype% = FILTERFILES THEN
AddSectionFilesToCopyList "FilterFiles", SrcDir$, DEST$ + "\plugins"
AddSectionFilesToCopyList "FilterDispFiles", SrcDir$, DEST$ + "\plugins\dispmaps"
''AddSectionFilesToCopyList "ThirdPartyFiles", SrcDir$, DEST$ + "\3rdparty"
AddSectionFilesToCopyList "LightingStyles", SrcDir$, DEST$ + "\plugins\ltstyles"
ELSEIF ftype% = DELUXEFILES THEN
AddSectionFilesToCopyList "Quicktime", SrcDir$, QTWDIR$
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%, 1
fExtra% = 0
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%, "10240"
fExtra% = 1
END IF
ELSEIF ftype% = TUTORIALFILES THEN
ListSym$ = TUTORIALNEEDS$
ELSEIF ftype% = PATTERNFILES THEN
ListSym$ = PATTERNNEEDS$
ELSEIF ftype% = DUOTONEFILES THEN
ListSym$ = DUOTONENEEDS$
ELSEIF ftype% = FILTERFILES THEN
ListSym$ = FILTERNEEDS$
ELSEIF ftype% = DELUXEFILES THEN
ListSym$ = DELUXENEEDS$
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"
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 TUTORIALFILES
RecalcOptFiles PATTERNFILES
RecalcOptFiles DUOTONEFILES
RecalcOptFiles FILTERFILES
IF CD <> 0 THEN
RecalcOptFiles DELUXEFILES
END IF
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( TUTORIALNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
IF CD <> 0 THEN
cost& = cost& + VAL( GetListItem( DELUXENEEDS$, ndrive% ) )
END IF
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( TUTORIALNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
IF CD <> 0 THEN
cost& = cost& + VAL( GetListItem( DELUXENEEDS$, ndrive% ) )
END IF
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"
IF cost& > free& THEN
ENOUGHDISK% = 0
END IF
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
SUB UpdateSystemIni STATIC
VxDPath$ = DEST32S$ + "W32S.386"
SystemIniPath$ = GetWindowsDir()
t% = MakeSystemIni(SystemIniPath$, VxdPath$)
END SUB