home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Cinemania 1994 (Preview Edition)
/
Microsoft-CinemaniaPreviewEdition94-Win31.iso
/
msstp
/
mmcat.inc
< prev
next >
Wrap
Text File
|
1993-08-25
|
5KB
|
160 lines
'**************************************************************************
'* Multimedia Catalog Setup
'* include file for Microsoft Multimedia Publishing
'**************************************************************************
CONST MMCAT_CDTITLE$ = "Microsoft Cinemania '94"
CONST MMCAT_PATH$ = "mmcat\"
CONST MMCAT_NAME$ = "catalog.exe"
CONST MMCAT_CURREV% = 1
CONST MMCAT_STUB$ = "catstub.exe"
CONST MMCAT_INISEC$ = "Microsoft Multimedia Catalog"
CONST MMCAT_UPNOTIFYHD = 3820
CONST MMCAT_COPYDLG = 3821
CONST MMCAT_NEWNOTIFY = 3822
CONST MMCAT_UPCOPY = 3823
CONST MMCAT_UPNOTIFYCD = 3824
CONST MMCAT_COPYNOTIFY = 3825
CONST fYes = 1
CONST fNo = 0
GLOBAL szMMCatSrcPath$
GLOBAL szMMCatSrcDrv$
GLOBAL fCatalogCopied%
DECLARE SUB SetupMMCatalog
DECLARE SUB MMCatCDInstall
DECLARE SUB MMCatSetProgman
DECLARE FUNCTION MMCatVideoOK() As Integer
DECLARE FUNCTION GetDeviceCaps LIB "GDI" (Hdc%, nCmd%) As Integer
DECLARE FUNCTION GetDC LIB "user" (Hwnd%) As Integer
DECLARE FUNCTION ReleaseDC LIB "user" (Hwnd%, Hdc%) As Integer
MMCATFOROPENERS:
'Make sure the startup for the main script is called INIT.
GoTo INIT
Sub SetupMMCatalog STATIC
szMMCatSrcDir$ = GetSymbolValue("STF_SRCDIR")
szMMCatSrcDrv$ = Mid$(szMMCatSrcDir$,1,1)
szMMCatSrcPath$ = szMMCatSrcDir$ + MMCAT_PATH$
szMMCatTgtDir$ = GetSymbolValue("EditTextOut")
szMMCatTgtDrv$ = Mid$(szMMCatTgtDir$,1,1)
fCatalogCopied% = fNo
' Verify that the CD has a catalog to copy.
If DoesFileExist( szMMCatSrcPath$ + MMCAT_NAME$, femExists ) <> 1 Then
Exit Sub
End If
' If the user's video mode is not supported, don't copy catalog.
If MMCatVideoOK() = fNo Then
Exit Sub
End If
' Check the version number on the CD catalog.
MMCatPrevRev% = Val( GetIniKeyString( GetWindowsDir() + "win.ini", MMCAT_INISEC$, "CatalogNum" ) )
' If the catalog on this CD is obsolete, don't install it unless stub gone.
If MMCatPrevRev% > MMCAT_CURREV% Then
If DoesFileExist( GetWindowsDir() + MMCAT_STUB$, femExists ) = 1 Then
Exit Sub
End If
End If
AddSectionFilesToCopyList "MMCatStd", szMMCatSrcPath$, GetWindowsDir()
AddSectionFilesToCopyList "MMCatSys", szMMCatSrcPath$, GetWindowsSysDir()
' Bail out if not enough space.
If GetCopyListCost( "", "", "" ) <> 0 Then
ClearCopyList
Exit Sub
End If
fDone% = fNo
While fDone% = fNo
If MMCatPrevRev% > 0 Then
sz$ = UIStartDlg("mscuistf.dll", MMCAT_UPNOTIFYCD, "FModelessDlgProc", 0, "")
sz$ = "UPDATE"
Else
sz$ = UIStartDlg("mscuistf.dll", MMCAT_NEWNOTIFY, "MMCatDlgProc", 0, "")
End If
If sz$ = "UPDATE" Then
fDone% = fYes
MMCatCDInstall
UIPop 1
ElseIf sz$ = "CONTINUE" Or sz$ = "CANCEL" Then
fDone% = fYes
UIPop 1
sz$ = UIStartDlg("mscuistf.dll", MMCAT_COPYNOTIFY, "FModelessDlgProc", 0, "")
MMCatCDInstall
UIPop 1
End If
Wend
End Sub
Sub MMCatCDInstall STATIC
iTmp% = SetSilentMode( 1 )
CopyFilesInCopyList
RemoveFile GetWindowsDir() + "picclip.vbx", cmoNone
RemoveFile GetWindowsDir() + "spush.vbx", cmoNone
iTmp% = SetSilentMode( iTmp% )
CreateIniKeyValue GetWindowsDir() + "win.ini", MMCAT_INISEC$, "CatalogNum", Str$(MMCAT_CURREV%), cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "win.ini", MMCAT_INISEC$, "Path", szMMCatSrcPath$, cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "win.ini", MMCAT_INISEC$, "ParentCD", MMCAT_CDTITLE$, cmoOverwrite
fCatalogCopied% = fYes
End Sub
Sub MMCatSetProgman STATIC
If fCatalogCopied% = fNo Then
Exit Sub
End If
TARGRP$ = GetSymbolValue( "TARGETGROUP" )
If TARGRP$ = "" Then
TARGRP$ = "Microsoft Multimedia"
End If
CreateProgManGroup TARGRP$, "", cmoNone
ShowProgManGroup TARGRP$, 1, cmoNone
szMMCatExe$ = GetWindowsDir() + MMCAT_STUB$
CreateProgManItem TARGRP$, MMCAT_INISEC$, szMMCatExe$, szMMCatExe$, cmoOverwrite
End Sub
Function MMCatVideoOK STATIC As Integer
whNUMCOLORS = 24
whRC_PALETTE = 256
whRASTERCAPS = 38
whBITSPIXEL = 12
hdc = GetDC( 0 )
f8Bit = (GetDeviceCaps( hdc, whNUMCOLORS ) > 16)
fPalette = (GetDeviceCaps( hdc, whRASTERCAPS ) And whRC_PALETTE)
fHiColor = (GetDeviceCaps( hdc, whBITSPIXEL ) >= 15)
hdc = ReleaseDC( 0, hdc )
If f8Bit And fPalette Then
MMCatVideoOK = fYes
ElseIf fHiColor Then
MMCatVideoOK = fYes
Else
MMCatVideoOK = fNo
End If
End Function