home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '* MSSetup Toolkit - Corel Professional Photos Setup *
- '**************************************************************************
-
- '$DEFINE DEBUG ''Define for script development/debugging
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
- 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
-
- hWnd%=HwndFrame()
-
- sti&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
- stj%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
-
- ''Dialog ID's
- CONST WELCOME = 100
- CONST ASKQUIT = 200
- CONST DESTPATH = 300
- CONST EXITFAILURE = 400
- CONST EXITQUIT = 600
- CONST EXITSUCCESS = 700
- CONST ASKQTOUR = 800
- CONST APPHELP = 900
- CONST CUSTINST = 6200
- CONST TOOBIG = 6300
- CONST BADPATH = 6400
- CONST MOSAIC = 7100
- CONST PCDSCSI = 7200
- CONST CDAUDIO = 7300
- CONST VIDEOWARN = 7500
-
- ''Bitmap ID
- CONST LOGO = 1
-
- ''File Types
- CONST PCDLABFILES = 1
- CONST PCDMOSFILES = 2
- CONST PCDAUDFILES = 3
- CONST PCDSCRFILES = 4
- CONST PCDWALFILES = 5
- CONST PCDQTRFILES = 6
-
- GLOBAL DEST$ ''Default destination directory.
- GLOBAL WINDRIVE$ ''Windows drive letter.
- GLOBAL MosDir$ ''Location of old mosaic program, if found.
- GLOBAL MosFlag$ ''Flag for old mosaic program, if found.
- GLOBAL QTRFlag$ ''Flag for QuickTour
- GLOBAL MPlrFlag ''Flag for Media Player
-
- FLAG1$ ="No" '' Copy flags for
- FLAG2$ ="No" '' DLL files that go
- FLAG3$ ="No" '' into WindowsDir and WindowsSysDir
- QTRFlag$ ="NO"
-
- ''CustInst list symbol names
- GLOBAL PCDLABNEEDS$ ''Option list costs per drive
- GLOBAL PCDMOSNEEDS$
- GLOBAL PCDAUDNEEDS$
- GLOBAL PCDSCRNEEDS$
- GLOBAL PCDWALNEEDS$
- GLOBAL PCDQTRNEEDS$
-
- 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$
-
-
- DECLARE SUB AddOptFilesToCopyList (ftype%)
- DECLARE SUB RecalcOptFiles (ftype%)
- DECLARE SUB RecalcPath
- DECLARE SUB SetDriveStatus
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE FUNCTION VflatdPresent LIB "iniupd.dll" AS INTEGER
-
- INIT:
- CUIDLL$ = "mscuistf.dll" ''custom user interface dll
- HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
-
- SetBitmap CUIDLL$, LOGO
- SetTitle "Corel Professional Photos Setup"
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "CORELCD.INF"
- END IF
- ReadInfFile szInf$
-
- WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
- WINDIR$ = GetWindowsDir()
- DEST$ = WINDRIVE$ + ":\CORELCD"
-
- ''CustInst list symbols
- CHECKSTATES$ = "CheckItemsState"
- STATUSTEXT$ = "StatusItemsText"
- DRIVETEXT$ = "DriveStatusText"
- FOR i% = 1 TO 6 STEP 1
- AddListItem CHECKSTATES$, "ON"
- NEXT i%
- FOR i% = 1 TO 6 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
- PCDLABNEEDS$ = "PcdLabNeeds"
- PCDMOSNEEDS$ = "PcdMosNeeds"
- PCDAUDNEEDS$ = "PcdAudNeeds"
- PCDSCRNEEDS$ = "PcdScrNeeds"
- PCDWALNEEDS$ = "PcdWalNeeds"
- PCDQTRNEEDS$ = "PcdQtrNeeds"
- EXTRACOSTS$ = "ExtraCosts"
- BIGLIST$ = "BigList"
- FOR i% = 1 TO 6 STEP 1
- AddListItem BIGLIST$, ""
- NEXT i%
- FOR i% = 1 TO 26 STEP 1
- AddListItem EXTRACOSTS$, "0"
- NEXT i%
-
- MPlrFlag = DoesFileExist(MakePath(WinDir$, "mplayer.reg"), femExists)
-
- RecalcPath
- SetDriveStatus
-
- '$IFDEF DEBUG
- i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
- '$ENDIF ''DEBUG
-
-
- WELCOME:
- sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WELCOME
- END IF
-
-
- CUSTINST:
- sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
- ''Install only if it will fit.
- FOR i% = 1 TO 6 STEP 1
- IF GetListItem(BIGLIST$, i%) <> "" THEN
- GOSUB TOOBIG
- GOTO CUSTINST
- END IF
- NEXT i%
- UIPop 1
- GOTO INSTALL
- ELSEIF sz$ = "PATH" THEN
- GOTO GETPATH
- ELSEIF sz$ = "CHK1" THEN
- RecalcOptFiles PCDLABFILES
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK2" THEN
- RecalcOptFiles PCDMOSFILES
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK3" THEN
- RecalcOptFiles PCDAUDFILES
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK4" THEN
- RecalcOptFiles PCDSCRFILES
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK5" THEN
- RecalcOptFiles PCDWALFILES
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK6" THEN
- RecalcOptFiles PCDQTRFILES
- SetDriveStatus
- GOTO CUSTINST
- ' ELSEIF sz$ = "BTN2" THEN
- ' GOTO PCDMOSFILES
- ' ELSEIF sz$ = "BTN3" THEN
- ' GOTO PCDAUDFILES
- ' ELSEIF sz$ = "BTN4" THEN
- ' GOTO PCDSCRFILES
- ' ELSEIF sz$ = "BTN5" THEN
- ' GOTO PCDWALFILES
- ' ELSEIF sz$ = "BTN6" THEN
- ' GOTO PCDQTRFILES
- ELSEIF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO CUSTINST
- ELSE
- GOSUB ASKQUIT
- GOTO CUSTINST
- END IF
-
-
-
- INSTALL:
- ClearCopyList
- AddOptFilesToCopyList PCDLABFILES
- AddOptFilesToCopyList PCDMOSFILES
- AddOptFilesToCopyList PCDAUDFILES
- AddOptFilesToCopyList PCDSCRFILES
- AddOptFilesToCopyList PCDWALFILES
- AddOptFilesToCopyList PCDQTRFILES
- CreateDir DEST$, cmoNone
-
- IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
- IF DoesIniKeyExist("WIN.INI", "PhotoCD Lab", "Dir") = 1 THEN
- PcdDir$ = GetIniKeyString("WIN.INI", "PhotoCD Lab", "Dir")
- IF DoesFileExist(PcdDir$ + "\PCDSCSI.EXE", femExists) = 1 THEN
- SetSymbolValue "ConfirmTextIn", PcdDir$
- SetSymbolValue "EditFocus", "END"
- sz$ = UIStartDlg(CUIDLL$, PCDSCSI, "FConfirmDlgProc", APPHELP, HELPPROC$)
- IF sz$ = "BACK" THEN
- UIPop 1
- GOTO CUSTINST
- ELSEIF sz$ = "CONTINUE" THEN
- UIPop 1
- END IF
- END IF
- END IF
- IF PcdDir$ <> "" THEN
- CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", PcdDir$, cmoOverwrite
- ELSE
- CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", DEST$ + "\PCDLAB", cmoOverwrite
- END IF
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
- IF MosFlag$ <> "" THEN
- SetSymbolValue "ConfirmTextIn", MosDir$
- SetSymbolValue "EditFocus", "END"
- sz$ = UIStartDlg(CUIDLL$, MOSAIC, "FConfirmDlgProc", APPHELP, HELPPROC$)
- IF sz$ = "BACK" THEN
- UIPop 1
- GOTO CUSTINST
- ELSEIF sz$ = "CONTINUE" THEN
- UIPop 1
- END IF
- ELSEIF MosFlag$ = "" AND MOSDIR$ <> "" THEN
- '' Just sit there for now
- ELSE
- CreateIniKeyValue "WIN.INI", "CorelGraphics4", "Dir", DEST$ + "\MOSAIC\CONFIG", cmoOverwrite
- CreateDir DEST$ + "\MOSAIC\CONFIG", cmoNone
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "ProgramsDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "CustomDir", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "MosaicDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "FiltersDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "DataDir", DEST$ + "\MOSAIC\PROGRAMS\DATA", cmoOverwrite
- END IF
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
- IF DoesIniKeyExist("WIN.INI", "CorelSCSI", "CD-Audio") = 1 THEN
- CDAudioDir$ = GetIniKeyString("WIN.INI", "CorelSCSI", "CD-Audio")
- IF DoesFileExist(CDAudioDir$ + "\CD_AUDIO.EXE", femExists) = 1 THEN
- SetSymbolValue "ConfirmTextIn", CDAudioDir$
- SetSymbolValue "EditFocus", "END"
- sz$ = UIStartDlg(CUIDLL$, CDAUDIO, "FConfirmDlgProc", APPHELP, HELPPROC$)
- IF sz$ = "BACK" THEN
- UIPop 1
- GOTO CUSTINST
- ELSEIF sz$ = "CONTINUE" THEN
- UIPop 1
- END IF
- END IF
- END IF
- CreateIniKeyValue "WIN.INI", "CorelSCSI", "CD-Audio", DEST$ + "\PCDAUDIO", cmoOverwrite
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDQTRFILES) = "ON" THEN
- IF VflatdPresent() = 0 THEN
- CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
- END IF
- CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
- CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
- CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
- CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
- IF DoesIniKeyExist (GetWindowsSysDir + "system.ini", "Drivers", "VIDC.RT21") = 0 THEN
- CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
- END IF
- CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
- CreateIniKeyValue WinDir$ + "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
-
- CopyFilesInCopyList
-
- InstDrive$=MID$(DEST$,1,2)
- CreateProgmanGroup "Professional Photos", "", cmoNone
- IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
- ShowProgmanGroup "Professional Photos", 1, cmoNone
- CreateProgmanItem "Professional Photos", "PhotoCD Lab", MakePath(DEST$, "pcdlab\pcdscsi.exe "), "", cmoOverwrite
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
- ShowProgmanGroup "Professional Photos", 1, cmoNone
- IF MosDir$ <> "" THEN
- CreateProgmanItem "Professional Photos", "CorelMOSAIC!", MosDir$ + "\CORELMOS.EXE", "", cmoOverwrite
- ELSE
- CreateProgmanItem "Professional Photos", "CorelMOSAIC!", MakePath(DEST$, "mosaic\programs\corelmos.exe "), "", cmoOverwrite
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CurvePath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
- CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELPRN.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
- END IF
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
- ShowProgmanGroup "Professional Photos", 1, cmoNone
- CreateProgmanItem "Professional Photos", "CD Audio", MakePath(DEST$, "pcdaudio\cd_audio.exe "), "", cmoOverwrite
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDSCRFILES) = "ON" THEN
- ShowProgmanGroup "Professional Photos", 1, cmoNone
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDWALFILES) = "ON" THEN
- ShowProgmanGroup "Professional Photos", 1, cmoNone
- CreateProgmanItem "Professional Photos", "Wallpaper Flipper Configuration", MakePath(GetWindowsDir, "wflipcnf.exe"), "", cmoOverwrite
- END IF
-
- IF GetListItem(CHECKSTATES$, PCDQTRFILES) = "ON" THEN
- ShowProgmanGroup "Professional Photos", 1, cmoNone
- CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
- CreateProgmanItem "Professional Photos", "Professional Photos QuickTour", GetSymbolValue("STF_SRCDIR")+"utils\cppqtour\qtviewer.exe", "", cmoOverwrite
- END IF
- CreateProgmanItem "Professional Photos", "Getting Started", MakePath(DEST$,"g_start.hlp"), "", cmoOverwrite
- CreateProgmanItem "Professional Photos", "Artview Screen Saver Help", MakePath(DEST$,"artview.hlp"), "", cmoOverwrite
- CreateProgmanItem "Professional Photos", "Corel Products Showcase", GetSymbolValue("STF_SRCDIR")+"showcase\show2.exe", "", cmoOverwrite
-
- 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(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
- IF QTRFlag$ = "YES" AND dlg% = EXITSUCCESS THEN
- displayname$ = GetIniKeyString(WinDir$ + "SYSTEM.INI", "BOOT.DESCRIPTION", "DISPLAY.DRV")
- FOR a% = 1 TO LEN(displayname$) - 4
- checkname$ = MID$(displayname$, a%, 4)
- IF checkname$ = "mach" THEN
- machexist = 1
- end if
- NEXT a%
- if machexist = 1 then
- sz$ = UIStartDlg(CUIDLL$, VIDEOWARN, "FConfirmDlgProc", 0, "")
- UIPop 1
- end if
- IF MPlrFlag <> 1 THEN
- Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
- Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
- Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
- Run (GetSymbolValue("STF_SRCDIR")+"utils\setup\profdisp.exe")
- END IF
- sz$ = UIStartDlg(CUIDLL$, ASKQTOUR, "FConfirmDlgProc", 0, "")
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- CHDRIVE GetSymbolValue("STF_SRCDIR")
- CHDIR "\utils\cppqtour"
- Run ("qtviewer.exe")
- ELSE
- UIPop 1
- END IF
- END IF
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup sources were corrupted, call Corel Tech Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
-
- GETPATH:
- SetSymbolValue "EditTextIn", DEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL1:
- sz$ = UIStartDlg(CUIDLL$, 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
-
- ''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
-
-
-
- 'PCDMOSFILES:
- ' SetSymbolValue "RadioDefault", OPT1OPT$
- 'OPT1L1:
- ' sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
- ' newopt$ = GetSymbolValue("ButtonChecked")
- '
- ' IF sz$ = "CONTINUE" THEN
- ' UIPop 1
- ' IF newopt$ <> OPT1OPT$ THEN
- ' OPT1OPT$ = newopt$
- ' RecalcOptFiles PCDMOSFILES
- ' SetDriveStatus
- ' END IF
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' ELSEIF sz$ = "REACTIVATE" THEN
- ' RecalcPath
- ' SetDriveStatus
- ' GOTO OPT1L1
- ' ELSEIF sz$ = "EXIT" THEN
- ' GOSUB ASKQUIT
- ' GOTO OPT1L1
- ' ELSE
- ' UIPop 1
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' END IF
- '
-
-
- 'PCDAUDFILES:
- ' SetSymbolValue "RadioDefault", OPT2OPT$
- 'OPT2L1:
- ' sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
- ' newopt$ = GetSymbolValue("ButtonChecked")
- '
- ' IF sz$ = "CONTINUE" THEN
- ' UIPop 1
- ' IF newopt$ <> OPT2OPT$ THEN
- ' OPT2OPT$ = newopt$
- ' RecalcOptFiles PCDAUDFILES
- ' SetDriveStatus
- ' END IF
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' ELSEIF sz$ = "REACTIVATE" THEN
- ' RecalcPath
- ' SetDriveStatus
- ' GOTO OPT2L1
- ' ELSEIF sz$ = "EXIT" THEN
- ' GOSUB ASKQUIT
- ' GOTO OPT2L1
- ' ELSE
- ' UIPop 1
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' END IF
-
-
-
- 'PCDSCRFILES:
- ' SetSymbolValue "RadioDefault", OPT3OPT$
- 'OPT3L1:
- ' sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
- ' newopt$ = GetSymbolValue("ButtonChecked")
- '
- ' IF sz$ = "CONTINUE" THEN
- ' UIPop 1
- ' IF newopt$ <> OPT3OPT$ THEN
- ' OPT3OPT$ = newopt$
- ' RecalcOptFiles PCDSCRFILES
- ' SetDriveStatus
- ' END IF
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' ELSEIF sz$ = "REACTIVATE" THEN
- ' RecalcPath
- ' SetDriveStatus
- ' GOTO OPT3L1
- ' ELSEIF sz$ = "EXIT" THEN
- ' GOSUB ASKQUIT
- ' GOTO OPT3L1
- ' ELSE
- ' UIPop 1
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' END IF
-
-
-
- 'PCDWALFILES:
- ' SetSymbolValue "RadioDefault", OPT4OPT$
- 'OPT4L1:
- ' sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
- ' newopt$ = GetSymbolValue("ButtonChecked")
- '
- ' IF sz$ = "CONTINUE" THEN
- ' UIPop 1
- ' IF newopt$ <> OPT4OPT$ THEN
- ' OPT4OPT$ = newopt$
- ' RecalcOptFiles PCDWALFILES
- ' SetDriveStatus
- ' END IF
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' ELSEIF sz$ = "REACTIVATE" THEN
- ' RecalcPath
- ' SetDriveStatus
- ' GOTO OPT4L1
- ' ELSEIF sz$ = "EXIT" THEN
- ' GOSUB ASKQUIT
- ' GOTO OPT4L1
- ' ELSE
- ' UIPop 1
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' END IF
-
-
- 'PCDQTRFILES:
- ' SetSymbolValue "RadioDefault", OPT5OPT$
- 'OPT5L1:
- ' sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
- ' newopt$ = GetSymbolValue("ButtonChecked")
- '
- ' IF sz$ = "CONTINUE" THEN
- ' UIPop 1
- ' IF newopt$ <> OPT5OPT$ THEN
- ' OPT5OPT$ = newopt$
- ' RecalcOptFiles PCDQTRFILES
- ' SetDriveStatus
- ' END IF
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' ELSEIF sz$ = "REACTIVATE" THEN
- ' RecalcPath
- ' SetDriveStatus
- ' GOTO OPT5L1
- ' ELSEIF sz$ = "EXIT" THEN
- ' GOSUB ASKQUIT
- ' GOTO OPT5L1
- ' ELSE
- ' UIPop 1
- ' newopt$ = ""
- ' GOTO CUSTINST
- ' END IF
-
- TOOBIG:
- sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO TOOBIG
- END IF
- UIPop 1
- RETURN
-
-
-
- BADPATH:
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO BADPATH
- END IF
- UIPop 1
- RETURN
-
-
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$, 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:
- '** PCDLABFILES, PCDAUDFILES, PCDMOSFILES, PCDSCRFILES, PCDWALFILES
- '** Returns:
- '** none.
- '*************************************************************************
- SUB AddOptFilesToCopyList (ftype%) STATIC
-
- IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- WinDirLen = LEN(GetWindowsDir)-1
- WinDir$ = MID$(GetWindowsDir,1,WinDirLen)
- InstDrive$ = MID$(DEST$,1,2)
- IF ftype% = PCDLABFILES THEN
- AddSectionFilesToCopyList "PcdLabFiles", SrcDir$, DEST$ + "\PCDLAB"
- FLAG1$="Yes"
- FLAG2$="Yes"
- FLAG3$="Yes"
- ELSEIF ftype% = PCDMOSFILES THEN
- IF DoesIniKeyExist("WIN.INI", "CorelGraphics4", "Dir") = 1 THEN
- CorelAppDir$ = GetIniKeyString("WIN.INI", "CorelGraphics4", "Dir")
- MosDir$ = GetIniKeyString(CorelAppDir$ + "\CORELAPP.INI", "Config", "ProgramsDir")
- IF MosDir$ <> "" THEN
- IF DoesFileExist(MosDir$ + "\CORELMOS.EXE", femExists) = 1 THEN
- MosFlag$ = "Yes"
- ELSE
- MosFlag$ = ""
- END IF
- AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, MosDir$
- AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, MosDir$
- ELSE
- AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS"
- AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, DEST$ + "\MOSAIC\CUSTOM"
- AddSectionFilesToCopyList "PcdMosInis", SrcDir$, DEST$ + "\MOSAIC\CONFIG"
- AddSectionFilesToCopyList "PcdMosData", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS\DATA"
- END IF
- ELSE
- AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS"
- AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, DEST$ + "\MOSAIC\CUSTOM"
- AddSectionFilesToCopyList "PcdMosInis", SrcDir$, DEST$ + "\MOSAIC\CONFIG"
- AddSectionFilesToCopyList "PcdMosData", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS\DATA"
- END IF
- FLAG1$="Yes"
- FLAG3$="Yes"
- ELSEIF ftype% = PCDAUDFILES THEN
- AddSectionFilesToCopyList "PcdAudFiles", SrcDir$, DEST$ + "\PCDAUDIO"
- ELSEIF ftype% = PCDSCRFILES THEN
- AddSectionFilesToCopyList "PcdScrFiles", SrcDir$, GetWindowsDir
- FLAG3$="Yes"
- ELSEIF ftype% = PCDWALFILES THEN
- AddSectionFilesToCopyList "PcdWalFiles", SrcDir$, GetWindowsDir
- ELSEIF ftype% = PCDQTRFILES THEN
- AddSectionFilesToCopyList "PcdQtrFiles", SrcDir$, GetWindowsDir
- AddSectionFilesToCopyList "PcdQtrSysFiles", SrcDir$, GetWindowsSysDir
- QtrFlag$="YES"
- END IF
- IF FLAG1$="Yes" THEN
- CreateIniKeyValue "WIN.INI", "Extensions", "PCD", DEST$ + "\PCDLAB\PCDSCSI.EXE ^.PCD", cmoNone
- AddSectionFilesToCopyList "PcdDllFiles", SrcDir$, GetWindowsSysDir
- IF DoesFileExist(GetWindowsDir + "PCDLIB.DLL", femExists) =1 THEN
- RemoveFile GetWindowsDir + "PCDLIB.DLL", cmoNone
- END IF
- IF DoesFileExist(GetWindowsDir + "PCDXTIF.DLL", femExists) =1 THEN
- RemoveFile GetWindowsDir + "PCDXTIF.DLL", cmoNone
- END IF
- IF DoesFileExist(GetWindowsDir + "PCDXEPS.DLL", femExists) =1 THEN
- RemoveFile GetWindowsDir + "PCDXEPS.DLL", cmoNone
- END IF
- IF DoesFileExist(GetWindowsDir + "PCDXPCX.DLL", femExists) =1 THEN
- RemoveFile GetWindowsDir + "PCDXPCX.DLL", cmoNone
- END IF
- IF DoesFileExist(GetWindowsDir + "PCDXBMP.DLL", femExists) =1 THEN
- RemoveFile GetWindowsDir + "PCDXBMP.DLL", cmoNone
- END IF
- END IF
- IF FLAG2$="Yes" THEN
- AddSectionFilesToCopyList "PcdCtlFile", SrcDir$, GetWindowsSysDir
- END IF
- IF FLAG3$="Yes" THEN
- AddSectionFilesToCopyList "PcdDllFile", SrcDir$, GetWindowsSysDir
- END IF
- AddSectionFilesToCopyList "PcdReadMe", SrcDir$, DEST$
- FLAG1$="No"
- FLAG2$="No"
- FLAG3$="No"
- 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:
- '** PCDLABFILES, PCDMOSFILES, PCDAUDFILES, PCDSCRFILES, PCDWALFILES, PCDQTRFILES
- '** Returns:
- '** none.
- '*************************************************************************
- SUB RecalcOptFiles (ftype%) STATIC
- CursorSave% = ShowWaitCursor()
- ClearCopyList
- AddOptFilesToCopyList ftype%
-
- fExtra% = 0
- IF ftype% = PCDLABFILES THEN
- ListSym$ = PCDLABNEEDS$
- ' IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
- ''Add extra cost to Windows drive for ini/progman, etc.
- ' ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- ' ReplaceListItem EXTRACOSTS$, ndrive%, "0"
- ' fExtra% = 1
- ' END IF
- ELSEIF ftype% = PCDMOSFILES THEN
- ListSym$ = PCDMOSNEEDS$
- ELSEIF ftype% = PCDAUDFILES THEN
- ListSym$ = PCDAUDNEEDS$
- ELSEIF ftype% = PCDSCRFILES THEN
- ListSym$ = PCDSCRNEEDS$
- ELSEIF ftype% = PCDWALFILES THEN
- ListSym$ = PCDWALNEEDS$
- ELSEIF ftype% = PCDQTRFILES THEN
- ListSym$ = PCDQTRNEEDS$
- IF QTRFlag$ = "YES" THEN
- QTRFlag$ = "NO"
- 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%, ""
- ' 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 PCDLABFILES
- RecalcOptFiles PCDMOSFILES
- RecalcOptFiles PCDAUDFILES
- RecalcOptFiles PCDSCRFILES
- RecalcOptFiles PCDWALFILES
- RecalcOptFiles PCDQTRFILES
-
- RestoreCursor CursorSave%
- END SUB
-
-
- '**
- '** Purpose:
- '** Sets drive status info according to latest disk space calcs.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB SetDriveStatus STATIC
-
- drive$ = MID$(DEST$, 1, 1)
- ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
- cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%))+VAL(GetListItem(PCDMOSNEEDS$, ndrive%))+VAL(GetListItem(PCDAUDNEEDS$, ndrive%))+VAL(GetListItem(PCDSCRNEEDS$, ndrive%))+VAL(GetListItem(PCDWALNEEDS$, ndrive%))+VAL(GetListItem(PCDQTRNEEDS$, ndrive%))
- free& = GetFreeSpaceForDrive(drive$)
- ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
- ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
- ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
-
- ' IF drive$ = WINDRIVE$ THEN
- ' ReplaceListItem DRIVETEXT$, 4, ""
- ' ReplaceListItem DRIVETEXT$, 5, ""
- ' ReplaceListItem DRIVETEXT$, 6, ""
- ' ELSE
- ' ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- ' cost&=VAL(GetListItem(PCDLABNEEDS$, ndrive%))+VAL(GetListItem(PCDMOSNEEDS$, ndrive%))+VAL(GetListItem(PCDAUDNEEDS$, ndrive%))+VAL(GetListItem(PCDSCRNEEDS$, ndrive%))+VAL(GetListItem(PCDWALNEEDS$, ndrive%))+VAL(GetListItem(PCDQTRNEEDS$, 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
- ' 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
-
-