home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Multimedia Moz…t - The Dissonant Quartet / Microsoft_Multimedia_Mozart_The_Dissonant_Quartet_Microsoft_Home_1993.iso / mozart / msstp / mmcat.inc < prev    next >
Text File  |  1995-03-05  |  5KB  |  162 lines

  1. '**************************************************************************
  2. '*                      Multimedia Catalog Setup
  3. '*            include file for Microsoft Multimedia Publishing
  4. '**************************************************************************
  5.  
  6. ' the CD title is set to strProduct$, which is defined in product.inc
  7. 'CONST MMCAT_CDTITLE$ = "Microsoft Dinosaurs"
  8. CONST MMCAT_PATH$    = "mmcat\"
  9. CONST MMCAT_NAME$    = "catalog.exe"
  10. CONST MMCAT_CURREV%  = 1
  11. CONST MMCAT_STUB$    = "catstub.exe"
  12. CONST MMCAT_INISEC$  = "Microsoft Multimedia Catalog"
  13.  
  14. CONST MMCAT_UPNOTIFYHD = 3820
  15. CONST MMCAT_COPYDLG    = 3821
  16. CONST MMCAT_NEWNOTIFY  = 3822
  17. CONST MMCAT_UPCOPY     = 3823
  18. CONST MMCAT_UPNOTIFYCD = 3824
  19. CONST MMCAT_COPYNOTIFY = 3825
  20.  
  21. CONST fYes = 1
  22. CONST fNo  = 0
  23.  
  24.  
  25. GLOBAL szMMCatSrcPath$
  26. GLOBAL szMMCatSrcDrv$
  27. GLOBAL fCatalogCopied%
  28.  
  29.  
  30. DECLARE SUB SetupMMCatalog
  31. DECLARE SUB MMCatCDInstall
  32. DECLARE SUB MMCatSetProgman
  33. DECLARE FUNCTION MMCatVideoOK() As Integer
  34.  
  35. DECLARE FUNCTION GetDeviceCaps LIB "GDI" (Hdc%, nCmd%) As Integer
  36. DECLARE FUNCTION GetDC LIB "user" (Hwnd%) As Integer
  37. DECLARE FUNCTION ReleaseDC LIB "user" (Hwnd%, Hdc%) As Integer
  38.  
  39. MMCATFOROPENERS:
  40.     'Make sure the startup for the main script is called INIT.
  41.     GoTo INIT
  42.  
  43.  
  44. Sub SetupMMCatalog STATIC
  45.     szMMCatSrcDir$  = GetSymbolValue("STF_SRCDIR")
  46.     szMMCatSrcDrv$  = Mid$(szMMCatSrcDir$,1,1)
  47.     szMMCatSrcPath$ = szMMCatSrcDir$ + MMCAT_PATH$
  48.     szMMCatTgtDir$  = GetSymbolValue("EditTextOut")
  49.     szMMCatTgtDrv$  = Mid$(szMMCatTgtDir$,1,1)
  50.  
  51.     fCatalogCopied% = fNo
  52.  
  53.     ' Verify that the CD has a catalog to copy.
  54.     If DoesFileExist( szMMCatSrcPath$ + MMCAT_NAME$, femExists ) <> 1 Then
  55.         Exit Sub
  56.     End If
  57.  
  58.     ' If the user's video mode is not supported, don't copy catalog.
  59.     If MMCatVideoOK() = fNo Then
  60.         Exit Sub
  61.     End If
  62.  
  63.     ' Check the version number on the CD catalog.
  64.     MMCatPrevRev% = Val( GetIniKeyString( GetWindowsDir() + "win.ini", MMCAT_INISEC$, "CatalogNum" ) )
  65.  
  66.     ' If the catalog on this CD is obsolete, don't install it unless stub gone.
  67.     If MMCatPrevRev% > MMCAT_CURREV% Then
  68.         If DoesFileExist( GetWindowsDir() + MMCAT_STUB$, femExists ) = 1 Then
  69.             Exit Sub
  70.         End If
  71.     End If
  72.  
  73.     AddSectionFilesToCopyList "MMCatStd", szMMCatSrcPath$, GetWindowsDir()
  74.     AddSectionFilesToCopyList "MMCatSys", szMMCatSrcPath$, GetWindowsSysDir()
  75.  
  76.     ' Bail out if not enough space.
  77.     If GetCopyListCost( "", "", "" ) <> 0 Then
  78.         ClearCopyList
  79.         Exit Sub
  80.     End If
  81.  
  82.     fDone% = fNo
  83.     While fDone% = fNo
  84.         If MMCatPrevRev% > 0 Then
  85.             sz$ = UIStartDlg("mscuistf.dll", MMCAT_UPNOTIFYCD, "FModelessDlgProc", 0, "")
  86.             sz$ = "UPDATE"
  87.         Else
  88.             sz$ = UIStartDlg("mscuistf.dll", MMCAT_NEWNOTIFY, "MMCatDlgProc", 0, "")
  89.         End If
  90.  
  91.         If sz$ = "UPDATE" Then
  92.             fDone% = fYes
  93.             MMCatCDInstall
  94.             UIPop 1
  95.         ElseIf sz$ = "CONTINUE" Or sz$ = "CANCEL" Then
  96.             fDone% = fYes
  97.             UIPop 1
  98.             sz$ = UIStartDlg("mscuistf.dll", MMCAT_COPYNOTIFY, "FModelessDlgProc", 0, "")
  99.             MMCatCDInstall
  100.             UIPop 1
  101.         End If
  102.     Wend
  103.  
  104. End Sub
  105.  
  106.  
  107. Sub MMCatCDInstall STATIC
  108.     SetCopyGaugePosition 1600, 1600
  109.  
  110.     'iTmp% = SetSilentMode( 1 )
  111.     CopyFilesInCopyList
  112.     RemoveFile GetWindowsDir() + "picclip.vbx", cmoNone
  113.     RemoveFile GetWindowsDir() + "spush.vbx", cmoNone
  114.     'iTmp% = SetSilentMode( iTmp% )
  115.     CreateIniKeyValue GetWindowsDir() + "win.ini", MMCAT_INISEC$, "CatalogNum", Str$(MMCAT_CURREV%), cmoOverwrite
  116.     CreateIniKeyValue GetWindowsDir() + "win.ini", MMCAT_INISEC$, "Path", szMMCatSrcPath$, cmoOverwrite
  117.     MMCAT_CDTITLE$ = strProduct$
  118.     CreateIniKeyValue GetWindowsDir() + "win.ini", MMCAT_INISEC$, "ParentCD", MMCAT_CDTITLE$, cmoOverwrite
  119.  
  120.     fCatalogCopied% = fYes
  121. End Sub
  122.  
  123.  
  124. Sub MMCatSetProgman STATIC
  125.     If fCatalogCopied% = fNo Then
  126.         Exit Sub
  127.     End If
  128.  
  129.     TARGRP$ = GetSymbolValue( "TARGETGROUP" )
  130.     If TARGRP$ = "" Then
  131.         TARGRP$ = "Microsoft Multimedia"
  132.     End If
  133.     CreateProgManGroup TARGRP$, "", cmoNone
  134.     ShowProgManGroup   TARGRP$, 1,  cmoNone
  135.  
  136.     szMMCatExe$ = GetWindowsDir() + MMCAT_STUB$
  137.  
  138.     CreateProgManItem TARGRP$, MMCAT_INISEC$, szMMCatExe$, szMMCatExe$, cmoOverwrite
  139. End Sub
  140.  
  141.  
  142. Function MMCatVideoOK STATIC As Integer
  143.    whNUMCOLORS  = 24
  144.     whRC_PALETTE = 256
  145.     whRASTERCAPS = 38
  146.     whBITSPIXEL  = 12
  147.  
  148.     hdc      = GetDC( 0 )
  149.     f8Bit    = (GetDeviceCaps( hdc, whNUMCOLORS ) > 16)
  150.     fPalette = (GetDeviceCaps( hdc, whRASTERCAPS ) And whRC_PALETTE)
  151.     fHiColor = (GetDeviceCaps( hdc, whBITSPIXEL ) >= 15)
  152.     hdc      = ReleaseDC( 0, hdc )
  153.  
  154.     If f8Bit And fPalette Then
  155.         MMCatVideoOK = fYes
  156.     ElseIf fHiColor Then
  157.         MMCatVideoOK = fYes
  158.     Else
  159.         MMCatVideoOK = fNo
  160.     End If
  161. End Function
  162.