home *** CD-ROM | disk | FTP | other *** search
/ Beauty & the Beast / BEAUTY.iso / setup.mst < prev    next >
Text File  |  1996-03-28  |  11KB  |  315 lines

  1. '**************************************************************************
  2. '*                  Beauty And The Beast and VFW 1.1e 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 WinSys32Dir$
  29. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  30. GLOBAL CHECKSTATES$
  31. GLOBAL MinorVer%
  32. GLOBAL OnNT$
  33.  
  34. DECLARE SUB Install
  35. DECLARE SUB InstallTitle
  36. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  37. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  38. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  39. DECLARE SUB Reboot LIB "iniupd.dll"
  40. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  41.  
  42. INIT:
  43.   
  44.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  45.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  46.     
  47.     WIN32ENABLED% = 0
  48.     MajorVer% = GetWindowsMajorVersion()
  49.     MinorVer% = GetWindowsMinorVersion()
  50.     Processor% = GetProcessorType()
  51.     WinDir$ = GetWindowsDir()
  52.     DEST$ = GetWindowsDir()
  53.     WinSysDir$ = GetWindowsSysDir()
  54.     WinSys32Dir$ = WinDir$ + "system32"
  55.  
  56.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  57.     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)
  58.     END
  59.     END IF
  60.  
  61.     'Prevents installation on 286
  62.     IF Processor% < 3 THEN
  63.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  64.     END
  65.     END IF
  66.  
  67.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  68.     IF OnWindowsNT() THEN
  69.       OnNT$ = "TRUE"
  70.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  71.       IF WowVersion$ = "" THEN
  72.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  73.          END
  74.       END IF
  75.     END IF
  76.  
  77.     SetBitmap CUIDLL$, LOGO
  78.     SetTitle "'Beauty And The Beast' and Video for Windows 1.1e Runtime"
  79.  
  80.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  81.     IF szInf$ = "" THEN
  82.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  83.     END IF
  84.     ReadInfFile szInf$
  85.  
  86.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  87.  
  88. WELCOME:
  89.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  90.     IF sz$ = "CONTINUE" THEN
  91.        UIPop 1
  92.      ELSE
  93.     GOSUB ASKQUIT
  94.     GOTO WELCOME
  95.     END IF
  96.  
  97. ''Prepare Copy list and check size
  98.  
  99.     ClearCopyList
  100.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  101.  
  102. '' Remove DCISVGA file
  103.     AddSectionFilesToCopyList "remove", SrcDir$, WinSysDir$
  104.  
  105. ''  Runtime files (on Windows disk)
  106. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  107.  
  108.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN            'These files not necessary on Windows NT
  109.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  110.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  111.     END IF
  112.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  113.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  114.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  115.     IF OnNT$ = "TRUE" THEN
  116.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  117.     ENDIF
  118. ''*************************************************************************************************************************
  119. ''*************************************************************************************************************************
  120. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  121. ''and add a "DCI Provider" section with to the SETUP.INF file.
  122. ''
  123. ''    AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  124. ''*************************************************************************************************************************
  125. ''*************************************************************************************************************************
  126.  
  127. ''  Check windrive diskspace
  128.     SizeReq& = GetCopyListCost ("","", "")
  129.     IF SizeReq& <> 0 THEN
  130.     GOSUB SMALLWIN
  131.     END
  132.     END IF
  133.  
  134. ' VFW installation
  135. Install 
  136.  
  137. ' install Jones MultiMedia Title
  138. InstallTitle
  139.  
  140. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  141. '' else, it gives the user the choice
  142.     RESTRT% = RestartListEmpty ()
  143.     Exe$ = DEST$ + "\_msrstrt.exe"
  144.     Batch$ = DEST$ + "\_mssetup.bat"
  145.     empty$ = ""
  146. RESTART:
  147.     IF RESTRT% = 0 THEN
  148.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  149.        IF sz$ = "REACTIVATE" THEN
  150.       GOTO RESTART
  151.        ENDIF
  152.        I% = ExitExecRestart ()
  153.        RemoveFile Exe$, cmoForce
  154.        RemoveFile Batch$, cmoForce
  155.        END
  156.     ELSE
  157.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  158.        IF sz$ = "CONTINUE" THEN
  159.       I% = ExitWindowsExec (Exe$, empty$)
  160.       IF I% = 0 THEN
  161.          GOTO RESTART
  162.       ELSE
  163.          END
  164.      ENDIF
  165.        ELSEIF sz$ = "EXIT" THEN
  166.       UIPopAll
  167.       END
  168.        ELSEIF sz$ = "REACTIVATE" THEN
  169.       GOTO RESTART
  170.        ELSE
  171.       UIPop 1
  172.        END IF
  173.     END IF
  174.  
  175.  
  176. QUIT:
  177.     ON ERROR GOTO ERRQUIT
  178.  
  179.     IF ERR = 0 THEN
  180.     dlg% = EXITSUCCESS
  181.     ELSEIF ERR = STFQUIT THEN
  182.     dlg% = EXITQUIT
  183.     ELSE
  184.     dlg% = EXITFAILURE
  185.     END IF
  186. QUITL1:
  187.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  188.     IF sz$ = "REACTIVATE" THEN
  189.     GOTO QUITL1
  190.     END IF
  191.     UIPop 1
  192.     END
  193.  
  194. ERRQUIT:
  195.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  196.     END
  197.  
  198.  
  199. ASKQUIT:
  200.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  201.  
  202.     IF sz$ = "EXIT" THEN
  203.     UIPopAll
  204. ''        ERROR STFQUIT
  205.     END
  206.     ELSEIF sz$ = "REACTIVATE" THEN
  207.     GOTO ASKQUIT
  208.     ELSE
  209.     UIPop 1
  210.     END IF
  211.     RETURN
  212.  
  213. SMALLWIN:
  214.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  215.     IF sz$ = "REACTIVATE" THEN
  216.     GOTO SMALLWIN
  217.     END IF
  218.     UIPop 1
  219.     RETURN
  220.  
  221. '**
  222. '** Purpose:
  223. '**     Performs all installation operations.
  224. '** Arguments:
  225. '**     none.
  226. '** Returns:
  227. '**     none.
  228. '*************************************************************************
  229. SUB Install STATIC
  230.  
  231.     SetRestartDir WinDir$
  232.     CopyFilesInCopyList
  233.  
  234. ''Updating WIN.INI and SYSTEM.INI
  235. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  236.  
  237. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  238.     IF VflatdPresent() = 0 THEN
  239.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  240.     END IF
  241. END IF
  242.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  243.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  244.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  245.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
  246.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  247.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  248.     IF I% = 0  THEN
  249.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
  250.     END IF
  251.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
  252.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  253.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  254.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  255.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  256.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  257.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  258.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  259.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  260.  
  261. ''*************************************************************************************************************************
  262. ''*************************************************************************************************************************
  263. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the    <provider> with your own file name
  264. ''
  265. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  266. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  267. ''*************************************************************************************************************************
  268. ''*************************************************************************************************************************
  269.  
  270. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  271. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  272.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  273.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  274.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  275.  
  276. '' Mplayer
  277.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  278.  
  279. END IF    ''NT and next version of Windows installation stop here.
  280.  
  281.     Run ("profdisp.exe")   
  282. END SUB
  283.  
  284. '**
  285. '** Purpose:
  286. '**     Appends a file name to the end of a directory path,
  287. '**     inserting a backslash character as needed.
  288. '** Arguments:
  289. '**     szDir$  - full directory path (with optional ending "\")
  290. '**     szFile$ - filename to append to directory
  291. '** Returns:
  292. '**     Resulting fully qualified path name.
  293. '*************************************************************************
  294. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  295.     IF szDir$ = "" THEN
  296.     MakePath = szFile$
  297.     ELSEIF szFile$ = "" THEN
  298.     MakePath = szDir$
  299.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  300.     MakePath = szDir$ + szFile$
  301.     ELSE
  302.     MakePath = szDir$ + "\" + szFile$
  303.     END IF
  304. END FUNCTION
  305.  
  306. SUB InstallTitle STATIC
  307.  
  308.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  309.  
  310.     CreateProgmanGroup "Memorex Software Series", "", cmoNone
  311.     ShowProgmanGroup  "Memorex Software Series", 1, cmoNone
  312.     CreateProgmanItem "Memorex Software Series", "Beauty And The Beast", MakePath(SrcDir$,"beauty.exe "), "", cmoOverwrite
  313.  
  314. END SUB
  315.