home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazin 1995 October / CD_10_95.BIN / aniplay / setup.mst < prev    next >
Text File  |  1995-04-12  |  12KB  |  308 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. GLOBAL Destination$        ''Default destination directory.
  9.  
  10. ''Dialog ID's
  11. CONST SUCCESSFUL_DIALOG =         2701
  12. CONST SUCCESSFUL_RESTART_DIALOG = 2700
  13. CONST FAILED_DIALOG =             107
  14. CONST GET_DRIVE_DIALOG =          101
  15. CONST APPHELP =                   106
  16.  
  17. ''Bitmap ID
  18. CONST LOGO = 999
  19.  
  20. CONST CURVER$= "1.0"
  21.  
  22. GLOBAL SizeReq&  '' Total Disk Size required for installation
  23.  
  24. ''File Types
  25. GLOBAL WinDir$
  26. GLOBAL WinSysDir$
  27. GLOBAL WinSys32Dir$
  28. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  29. GLOBAL CHECKSTATES$
  30. GLOBAL MinorVer%
  31. GLOBAL OnNT$
  32.  
  33. DECLARE SUB Install
  34. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  35. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  36. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  37. DECLARE SUB Reboot LIB "iniupd.dll"
  38. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  39.  
  40. INIT:
  41.   
  42.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  43.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  44.     
  45.     if DoesiniKeyExist ("WIN.INI", "AnimatorStudio", "Location") THEN 
  46.         Destination$= GetiniKeyString("WIN.INI", "AnimatorStudio", "Location")
  47.     else
  48.         Destination$= "c:\animator"
  49.     ENDIF
  50.   
  51.     SetSymbolValue "DestinationDrive", Destination$
  52.     SetSymbolValue "VersionNumber", CURVER$
  53.     
  54.     WIN32ENABLED% = 0
  55.     MajorVer% = GetWindowsMajorVersion()
  56.     MinorVer% = GetWindowsMinorVersion()
  57.     Processor% = GetProcessorType()
  58.     WinDir$ = GetWindowsDir()
  59.     DEST$ = GetWindowsDir()
  60.     WinSysDir$ = GetWindowsSysDir()
  61.     WinSys32Dir$ = WinDir$ + "system32"
  62.  
  63.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  64.     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)
  65.     END
  66.     END IF
  67.  
  68.     'Prevents installation on 286
  69.     IF Processor% < 3 THEN
  70.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  71.     END
  72.     END IF
  73.  
  74.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  75.     IF OnWindowsNT() THEN
  76.       OnNT$ = "TRUE"
  77.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  78.       IF WowVersion$ = "" THEN
  79.          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)
  80.          END
  81.       END IF
  82.     END IF
  83.  
  84.     SetBitmap CUIDLL$, LOGO
  85.     SetTitle "Autodesk Animator Player Setup"
  86.  
  87.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  88.     IF szInf$ = "" THEN
  89.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  90.     END IF
  91.     ReadInfFile szInf$
  92.  
  93.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  94.  
  95. WELCOME:
  96.     sz$ = UIStartDlg(CUIDLL$, GET_DRIVE_DIALOG, "FCheckDlgProc", APPHELP, HELPPROC$)
  97.     IF sz$ = "CONTINUE" THEN
  98.        UIPop 1
  99.      ELSE
  100.     GOSUB ASKQUIT
  101.     GOTO WELCOME
  102.     END IF
  103.  
  104. ''Prepare Copy list and check size
  105.  
  106.     ClearCopyList
  107.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  108.     
  109. '' Get Destination Drive
  110.     Destination$= GetSymbolValue("DestinationDrive")
  111.  
  112. ''  Runtime files (on Windows disk)
  113. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  114.  
  115.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN                   'These files not necessary on Windows NT
  116.     AddSectionFilesToCopyList "AnimPlay", SrcDir$, Destination$
  117.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  118.     END IF 
  119.     AddSectionFilesToCopyList "ExtraHandlers", SrcDir$, WinSysDir$
  120.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  121.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  122.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  123.     IF OnNT$ = "TRUE" THEN
  124. REM    AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  125.     ENDIF
  126. ''*************************************************************************************************************************
  127. ''*************************************************************************************************************************
  128. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  129. ''and add a "DCI Provider" section with to the SETUP.INF file.
  130. ''
  131. ''      AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  132. ''*************************************************************************************************************************
  133. ''*************************************************************************************************************************
  134.  
  135. Install
  136.  
  137. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  138. '' else, it gives the user the choice
  139.     RESTRT% = RestartListEmpty ()
  140.     Exe$ = DEST$ + "\_msrstrt.exe"
  141.     Batch$ = DEST$ + "\_mssetup.bat"
  142.     empty$ = ""
  143. RESTART:
  144.     IF RESTRT% = 0 THEN
  145.        sz$ = UIStartDlg(CUIDLL$, SUCCESSFUL_DIALOG, "FInfoDlgProc", 0, "")
  146.        IF sz$ = "REACTIVATE" THEN
  147.       GOTO RESTART
  148.        ENDIF
  149.        I% = ExitExecRestart ()
  150.        RemoveFile Exe$, cmoForce
  151.        RemoveFile Batch$, cmoForce
  152.        END
  153.     ELSE
  154.        sz$ = UIStartDlg(CUIDLL$, SUCCESSFUL_RESTART_DIALOG, "FQuitDlgProc", 0, "")
  155.        IF sz$ = "CONTINUE" OR sz$ = "GO ON" THEN
  156.       I% = ExitWindowsExec (Exe$, empty$)
  157.       END
  158.       IF I% = 0 THEN
  159.          GOTO RESTART
  160.       ELSE
  161.          END
  162.      ENDIF
  163.        ELSEIF sz$ = "EXIT" THEN
  164.       UIPopAll
  165.       END
  166.        ELSEIF sz$ = "REACTIVATE" THEN
  167.       GOTO RESTART
  168.        ELSE
  169.       UIPopAll
  170.       END
  171.        END IF
  172.     END IF
  173.  
  174.  
  175. QUIT:
  176.     ON ERROR GOTO ERRQUIT
  177.  
  178.     IF ERR = 0 THEN
  179.     dlg% = EXITSUCCESS
  180.     ELSEIF ERR = STFQUIT THEN
  181.     dlg% = EXITQUIT
  182.     ELSE
  183.     dlg% = EXITFAILURE
  184.     END IF
  185. QUITL1:
  186.     sz$ = UIStartDlg(CUIDLL$, FAILED_DIALOG, "FInfoDlgProc", 0, "")
  187.     IF sz$ = "REACTIVATE" THEN
  188.     GOTO QUITL1
  189.     END IF
  190.     UIPop 1
  191.     END
  192.  
  193. ERRQUIT:
  194.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  195.     END
  196.  
  197.  
  198. ASKQUIT:
  199.     UIPopAll
  200.     END
  201. REM    sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  202.  
  203.     IF sz$ = "EXIT" THEN
  204.     UIPopAll
  205. ''        ERROR STFQUIT
  206.     END
  207.     ELSEIF sz$ = "REACTIVATE" THEN
  208.     GOTO ASKQUIT
  209.     ELSE
  210.     UIPop 1
  211.     END IF
  212.     RETURN
  213.  
  214. '**
  215. '** Purpose:
  216. '**     Performs all installation operations.
  217. '** Arguments:
  218. '**     none.
  219. '** Returns:
  220. '**     none.
  221. '*************************************************************************
  222. SUB Install STATIC
  223.  
  224.     SetRestartDir WinDir$
  225.     CopyFilesInCopyList
  226.  
  227. ''Updating WIN.INI and SYSTEM.INI
  228. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  229.  
  230.    CreateProgmanGroup "Autodesk Multimedia", "", cmoNone
  231.    ShowProgmanGroup  "Autodesk Multimedia", 1, cmoNone
  232.    CreateProgmanItem "Autodesk Multimedia", "Animator Player", MakePath(Destination$, "player.exe"), "", cmoOverwrite
  233.  
  234.    CreateIniKeyValue WinDir$ + "win.ini", "AnimatorStudio", "Location", Destination$, cmoOverwrite
  235.    CreateIniKeyValue WinDir$ + "win.ini", "AnimatorStudio", "PlayerInstall", CURVER$, cmoOverwrite
  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.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.AASC", "AASC.drv", cmoOverwrite
  262.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.AFLC", "flccodec.drv", cmoOverwrite
  263.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.AFLI", "flccodec.drv", cmoOverwrite
  264.  
  265. ''*************************************************************************************************************************
  266. ''*************************************************************************************************************************
  267. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the <provider> with your own file name
  268. ''
  269. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  270. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  271. ''*************************************************************************************************************************
  272. ''*************************************************************************************************************************
  273.  
  274. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  275. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  276.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  277.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  278.  REM Extra Handlers
  279.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "qtwfile.reg"))
  280.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "flcfile.reg"))
  281.  
  282. END IF  ''NT and next version of Windows installation stop here.
  283.  
  284.     Run ("profdisp.exe")   
  285. END SUB
  286.  
  287. '**
  288. '** Purpose:
  289. '**     Appends a file name to the end of a directory path,
  290. '**     inserting a backslash character as needed.
  291. '** Arguments:
  292. '**     szDir$  - full directory path (with optional ending "\")
  293. '**     szFile$ - filename to append to directory
  294. '** Returns:
  295. '**     Resulting fully qualified path name.
  296. '*************************************************************************
  297. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  298.     IF szDir$ = "" THEN
  299.     MakePath = szFile$
  300.     ELSEIF szFile$ = "" THEN
  301.     MakePath = szDir$
  302.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  303.     MakePath = szDir$ + szFile$
  304.     ELSE
  305.     MakePath = szDir$ + "\" + szFile$
  306.     END IF
  307. END FUNCTION
  308.