home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today (UK) 1 / cdromtoday1.bin / vfw / setup.mst < prev    next >
Text File  |  1994-03-06  |  6KB  |  195 lines

  1. '**************************************************************************
  2. '*                       VfW 1.0 Runtime Setup
  3. '**************************************************************************
  4.  
  5. '$INCLUDE 'setupapi.inc'
  6. '$INCLUDE 'mscpydis.inc'    ''System
  7. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  8.  
  9. ''Dialog ID's
  10. CONST WELCOME       = 100
  11. CONST ASKQUIT       = 200
  12. CONST DESTPATH      = 300
  13. CONST EXITFAILURE   = 400
  14. CONST EXITQUIT      = 600
  15. CONST EXITSUCCESS   = 700
  16. CONST OPTIONS       = 800
  17. CONST APPHELP       = 900
  18. CONST APPHELP2      = 1500
  19. CONST APPHELP3      = 1700
  20. CONST CHECK         = 2500
  21. CONST TOOBIG        = 6300
  22. CONST BADPATH       = 6400
  23.  
  24. ''Bitmap ID
  25. CONST LOGO = 1
  26.  
  27. ''Disk Sizes
  28.  
  29. GLOBAL File1
  30. GLOBAL File2
  31. GLOBAL WantedDiskSize&
  32.  
  33. ''File Types
  34. GLOBAL DEST$        ''Default destination directory.
  35. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  36. GLOBAL OPTCUR$      ''Option selection from option dialog.
  37. GLOBAL CHECKSTATES$
  38. GLOBAL RUNTIME$
  39. GLOBAL AVITOOLS$
  40. GLOBAL MDKTOOLS$
  41. GLOBAL TOOLS$
  42.  
  43. ''start install procedure indicator
  44. GLOBAL WinVfw$        ''Windows Video For Windows old Indeo driver path and file name
  45. GLOBAL IFileExists
  46.  
  47. SrcDir$ = GetSymbolValue("STF_SRCDIR")
  48. WinDir$ = GetWindowsDir()
  49. WinSysDir$ = GetWindowsSysDir()
  50.  
  51. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  52.  
  53. INIT:
  54.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  55.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  56.  
  57.     MajorVer% = GetWindowsMajorVersion()
  58.     MinorVer% = GetWindowsMinorVersion()
  59.  
  60.     IF  MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  61.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  62.         END
  63.     END IF
  64.  
  65.     SetBitmap CUIDLL$, LOGO
  66.     SetTitle "Video for Windows 1.0"
  67.  
  68.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  69.     IF szInf$ = "" THEN
  70.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  71.     END IF
  72.     ReadInfFile szInf$
  73.  
  74.     WINDRIVE$ = MID$(WinDir$, 1, 1)
  75.  
  76. WELCOME:
  77.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  78.     IF sz$ = "CONTINUE" THEN
  79.         UIPop 1
  80.     ELSE
  81.         GOSUB ASKQUIT
  82.         GOTO WELCOME
  83.     END IF
  84.  
  85.     IFileExists = 0
  86.  
  87. ClearCopyList
  88.  
  89.         WantedDiskSize&=1024000
  90.  
  91.         DiskSize&=GetFreeSpaceForDrive(WINDRIVE$)
  92.  
  93.         If WantedDiskSize& > DiskSize& then
  94.             GOSUB TOOBIG
  95.             ERROR STFQUIT
  96.         EndIf
  97.  
  98. '' Setting RUNTIME files to be copied
  99.         AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  100.         AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  101.         AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  102.  
  103. '' Makes sure indeo.drv was there to begin with; if not, then no need to do a restore upon user cancel
  104.     IF DoesFileExist(WinSysDir$+"indeo.drv", femExists) = 1 THEN
  105.       IFileExists = 1
  106.         ENDIF
  107.  
  108. CopyFilesInCopyList
  109.  
  110. ''Updating WIN.INI and SYSTEM.INI
  111.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  112.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeo.drv", cmoOverwrite
  113.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "isvy.drv", cmoOverwrite
  114.         CreateIniKeyValue "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  115.         CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  116.  
  117. Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  118.  
  119. Run ("profdisp")
  120.  
  121. QUIT:
  122.     ON ERROR GOTO ERRQUIT
  123.  
  124.     IF ERR = 0 THEN
  125.         dlg% = EXITSUCCESS
  126.     ELSEIF ERR = STFQUIT THEN
  127.         dlg% = EXITQUIT
  128.     IF IFileExists = 1 THEN
  129.           IF DoesFileExist(WinSysDir$+"indeo.vfw", femExists) = 1 THEN
  130.             IF DoesFileExist(WinSysDir$+"indeo.drv", femExists) = 0 THEN
  131.           WinVfw$ = WinSysDir$+"indeo.vfw"
  132.           BackupFile WinVfw$, "indeo.drv"
  133.             ENDIF
  134.           ENDIF
  135.         ENDIF
  136.     ELSE
  137.         dlg% = EXITFAILURE
  138.     END IF
  139. QUITL1:
  140.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  141.     IF sz$ = "REACTIVATE" THEN
  142.         GOTO QUITL1
  143.     END IF
  144.     UIPop 1
  145.  
  146.     END
  147.  
  148. ERRQUIT:
  149.     i% = DoMsgBox("Setup sources were corrupted, call the included support number", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  150.     END
  151.  
  152. ASKQUIT:
  153.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  154.  
  155.     IF sz$ = "EXIT" THEN
  156.         UIPopAll
  157. ''        ERROR STFQUIT
  158.         END
  159.     ELSEIF sz$ = "REACTIVATE" THEN
  160.         GOTO ASKQUIT
  161.     ELSE
  162.         UIPop 1
  163.     END IF
  164.     RETURN
  165.  
  166. TOOBIG:
  167.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  168.     IF sz$ = "REACTIVATE" THEN
  169.         GOTO TOOBIG
  170.     END IF
  171.     UIPop 1
  172.     RETURN
  173.  
  174. '**
  175. '** Purpose:
  176. '**     Appends a file name to the end of a directory path,
  177. '**     inserting a backslash character as needed.
  178. '** Arguments:
  179. '**     szDir$  - full directory path (with optional ending "\")
  180. '**     szFile$ - filename to append to directory
  181. '** Returns:
  182. '**     Resulting fully qualified path name.
  183. '*************************************************************************
  184. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  185.     IF szDir$ = "" THEN
  186.         MakePath = szFile$
  187.     ELSEIF szFile$ = "" THEN
  188.         MakePath = szDir$
  189.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  190.         MakePath = szDir$ + szFile$
  191.     ELSE
  192.         MakePath = szDir$ + "\" + szFile$
  193.     END IF
  194. END FUNCTION
  195.