home *** CD-ROM | disk | FTP | other *** search
/ ABCD InteraktĂ­v Magazin 1995 #2 / ABCD.ISO / efgh / vfw11d / setup.mst < prev    next >
Encoding:
Text File  |  1994-11-26  |  7.8 KB  |  251 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1 Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19.  
  20. ''Bitmap ID
  21. CONST LOGO = 1
  22.  
  23. GLOBAL SizeReq&  '' Total Disk Size required for installation
  24.  
  25. ''File Types
  26. GLOBAL WinDir$
  27. GLOBAL WinSysDir$
  28. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  29. GLOBAL CHECKSTATES$
  30.  
  31. DECLARE SUB Install
  32. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  33. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  34. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  35. DECLARE SUB Reboot LIB "iniupd.dll"
  36. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  37.  
  38. INIT:
  39.   
  40.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  41.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  42.     
  43.     WIN32ENABLED% = 0
  44.     MajorVer% = GetWindowsMajorVersion()
  45.     MinorVer% = GetWindowsMinorVersion()
  46.  
  47.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  48.     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)
  49.     END
  50.     END IF
  51.  
  52.     IF OnWindowsNT() THEN
  53.       i% = DoMsgBox("This version of Video for Windows does not run on Windows NT.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  54.       END
  55.     END IF
  56.  
  57.     SetBitmap CUIDLL$, LOGO
  58.     SetTitle "Video for Windows 1.1 Runtime"
  59.  
  60.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  61.     IF szInf$ = "" THEN
  62.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  63.     END IF
  64.     ReadInfFile szInf$
  65.  
  66.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  67.  
  68. WELCOME:
  69.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  70.     IF sz$ = "CONTINUE" THEN
  71.        UIPop 1
  72.      ELSE
  73.     GOSUB ASKQUIT
  74.     GOTO WELCOME
  75.     END IF
  76.  
  77. ''Prepare Copy list and check size
  78.  
  79.     ClearCopyList
  80.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  81.     WinDir$ = GetWindowsDir()
  82.     DEST$ = GetWindowsDir()
  83.     WinSysDir$ = GetWindowsSysDir()
  84.  
  85. ''  Runtime files (on Windows disk)
  86.  
  87.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  88.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  89.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  90.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  91.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  92.     AddSectionFilesToCopyList "Indeo-ini", SrcDir$, WinDir$
  93.  
  94. ''  Check windrive diskspace
  95.     SizeReq& = GetCopyListCost ("","", "")
  96.     IF SizeReq& <> 0 THEN
  97.     GOSUB SMALLWIN
  98.     END
  99.     END IF
  100.  
  101. Install
  102.  
  103. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  104. '' else, it gives the user the choice
  105.     RESTRT% = RestartListEmpty ()
  106.     Exe$ = DEST$ + "\_msrstrt.exe"
  107.     Batch$ = DEST$ + "\_mssetup.bat"
  108.     empty$ = ""
  109. end
  110. RESTART:
  111.     IF RESTRT% = 0 THEN
  112.        sz$ = UIStartDlg(cuidll$, RESTART, "FInfo0DlgProc", 0, "")
  113.        IF sz$ = "REACTIVATE" THEN
  114.       GOTO RESTART
  115.        ENDIF
  116.        I% = ExitExecRestart ()
  117.        RemoveFile Exe$, cmoForce
  118.        RemoveFile Batch$, cmoForce
  119.        END
  120.     ELSE
  121.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  122.        IF sz$ = "CONTINUE" THEN
  123.       I% = ExitWindowsExec (Exe$, empty$)
  124.       IF I% = 0 THEN
  125.          GOTO RESTART
  126.       ELSE
  127.          END
  128.      ENDIF
  129.        ELSEIF sz$ = "EXIT" THEN
  130.       UIPopAll
  131.       END
  132.        ELSEIF sz$ = "REACTIVATE" THEN
  133.       GOTO RESTART
  134.        ELSE
  135.       UIPop 1
  136.        END IF
  137.     END IF
  138.  
  139.  
  140. QUIT:
  141.     ON ERROR GOTO ERRQUIT
  142.  
  143.     IF ERR = 0 THEN
  144.     dlg% = EXITSUCCESS
  145.     ELSEIF ERR = STFQUIT THEN
  146.     dlg% = EXITQUIT
  147.     ELSE
  148.     dlg% = EXITFAILURE
  149.     END IF
  150. QUITL1:
  151.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  152.     IF sz$ = "REACTIVATE" THEN
  153.     GOTO QUITL1
  154.     END IF
  155.     UIPop 1
  156.     END
  157.  
  158. ERRQUIT:
  159.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  160.     END
  161.  
  162.  
  163. ASKQUIT:
  164.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  165.  
  166.     IF sz$ = "EXIT" THEN
  167.     UIPopAll
  168. ''        ERROR STFQUIT
  169.     END
  170.     ELSEIF sz$ = "REACTIVATE" THEN
  171.     GOTO ASKQUIT
  172.     ELSE
  173.     UIPop 1
  174.     END IF
  175.     RETURN
  176.  
  177. SMALLWIN:
  178.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  179.     IF sz$ = "REACTIVATE" THEN
  180.     GOTO SMALLWIN
  181.     END IF
  182.     UIPop 1
  183.     RETURN
  184.  
  185. '**
  186. '** Purpose:
  187. '**     Performs all installation operations.
  188. '** Arguments:
  189. '**     none.
  190. '** Returns:
  191. '**     none.
  192. '*************************************************************************
  193. SUB Install STATIC
  194.  
  195.     SetRestartDir WinDir$
  196.     CopyFilesInCopyList
  197.  
  198. ''Updating WIN.INI and SYSTEM.INI
  199.     IF VflatdPresent() = 0 THEN
  200.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  201.     END IF
  202.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  203.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  204.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  205.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  206.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  207.     IF I% = 0  THEN
  208.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  209.     END IF
  210.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  211.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  212.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  213.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  214.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  215.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  216.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  217.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  218.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  219.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  220.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  221.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  222.  
  223. '' Mplayer
  224.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  225.  
  226.     Run ("profdisp.exe")   
  227. END SUB
  228.  
  229. '**
  230. '** Purpose:
  231. '**     Appends a file name to the end of a directory path,
  232. '**     inserting a backslash character as needed.
  233. '** Arguments:
  234. '**     szDir$  - full directory path (with optional ending "\")
  235. '**     szFile$ - filename to append to directory
  236. '** Returns:
  237. '**     Resulting fully qualified path name.
  238. '*************************************************************************
  239. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  240.     IF szDir$ = "" THEN
  241.     MakePath = szFile$
  242.     ELSEIF szFile$ = "" THEN
  243.     MakePath = szDir$
  244.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  245.     MakePath = szDir$ + szFile$
  246.     ELSE
  247.     MakePath = szDir$ + "\" + szFile$
  248.     END IF
  249. END FUNCTION
  250.  
  251.