home *** CD-ROM | disk | FTP | other *** search
/ Asymetrix Demo / Asymetrix.iso / prg / dvp / disk1 / setup.mst < prev    next >
Encoding:
Text File  |  1994-07-10  |  14.8 KB  |  431 lines

  1. '**************************************************************************
  2. '*                  Digitial Video Producer Version 3 Setup  
  3. '*
  4. '* this is the MS Setup script for the installation of DVP 3.0
  5. '* - installs Indeo 3.1 or Indeo 3.22 base on the value of the NEWINDEO setting
  6. '* - optionally prompt the user to restart Windows or not based on the value of teh CHILDINSTALL setting
  7. '*
  8. '**************************************************************************
  9. '$INCLUDE 'setupapi.inc'
  10. '$INCLUDE 'mscpydis.inc'    ''System
  11. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  12.  
  13. ''Dialog ID's
  14. CONST WELCOME       = 100
  15. CONST ASKQUIT       = 200
  16. CONST DESTPATH      = 300
  17. CONST EXITFAILURE   = 400
  18. CONST EXITQUIT      = 600
  19. CONST EXITSUCCESS   = 700
  20. CONST APPHELP       = 900
  21. CONST CHECK         = 2500
  22. CONST SMALLWIN      = 2200
  23. CONST RESTART       = 2600
  24. CONST RESTARTII     = 2700    
  25.  
  26. '' *** Installing new indeo ( 3.2 ) then 1 otherwise equals 0
  27. const NEWINDEO = 1                                           
  28. '' *** This installation program launched by another install then 1 otherwise 0
  29. const CHILDINSTALL = 1
  30.  
  31. ''Bitmap ID
  32. CONST LOGO = 1
  33.  
  34. GLOBAL SizeReq&  '' Total Disk Size required for installation
  35.  
  36. ''File Types
  37. GLOBAL WinDir$
  38. GLOBAL WinSysDir$
  39. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  40. GLOBAL CHECKSTATES$
  41.  
  42. DECLARE SUB Install
  43. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  44. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  45. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  46. DECLARE SUB Reboot LIB "iniupd.dll"
  47. DECLARE FUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  48.  
  49.     '' *** debug line in case needed later - i% = DoMsgBox(sz$, "Debug", 1)
  50.  
  51.  
  52. INIT:
  53.  
  54.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  55.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  56.                
  57.     '' *** Check version number of Windows that is supported                           
  58.     WIN32ENABLED% = 0
  59.     MajorVer% = GetWindowsMajorVersion()
  60.     MinorVer% = GetWindowsMinorVersion()  
  61.     
  62.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  63.     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)
  64.     END
  65.     END IF
  66.  
  67.     IF MajorVer% >= 4 THEN
  68.        i% = DoMsgBox("This version of Digital Video Producer does not run on Windows NT.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  69.        END
  70.     END IF
  71.  
  72.     IF OnWindowsNT() THEN
  73.        i% = DoMsgBox("This version of Video for Windows does not run on Windows NT.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  74.       END
  75.     END IF
  76.      
  77.     '' *** Setup reference to bitmap for background windows in setup installation
  78.     SetBitmap CUIDLL$, LOGO
  79.     SetTitle "Asymetrix Digital Video Producer Setup"
  80.  
  81.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  82.     IF szInf$ = "" THEN
  83.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  84.     END IF
  85.     ReadInfFile szInf$
  86.  
  87.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  88.  
  89. WELCOME:    
  90.           
  91.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  92.     IF sz$ = "CONTINUE" THEN
  93.        UIPop 1
  94.      ELSE
  95.     GOSUB ASKQUIT
  96.     GOTO WELCOME
  97.     END IF
  98.  
  99.     ''**Prepare Copy list and check size
  100.  
  101. ASKDIR:
  102.     SetSymbolValue "EditTextIn", WINDRIVE$ + ":\dvp"
  103.     SetSymbolValue "EditFocus", "ALL"
  104.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", 0, "")
  105.     
  106.     '' ** if want to exit, then prompt to be sure      
  107.     IF sz$ = "EXIT" THEN
  108.         GOSUB ASKQUIT
  109.         GOTO ASKDIR
  110.     END IF
  111.     
  112.     SpliceDir$ = GetSymbolValue("EditTextOut")
  113.     IF MID$(SpliceDir$, 1,1) = "\" THEN
  114.     SpliceDir$ = WINDRIVE$ + ":" + SpliceDir$
  115.     ELSEIF MID$(SpliceDir$, 2, 1) <> ":" THEN
  116.     SpliceDir$ = WINDRIVE$ + ":\" + SpliceDir$
  117.     ENDIF
  118.     Exist% = DoesDirExist(SpliceDir$)
  119.     IF Exist% = 0 THEN
  120.         CreateDir SpliceDir$, cmoNone
  121.         Exist% = DoesDirExist(SpliceDir$)
  122.         IF Exist% = 0 THEN
  123.             Msg$ = "The directory " + SpliceDir$ + " cannot be created."
  124.             Rtn% = DoMsgBox(Msg$, "Asymetrix Digital Video Producer Setup Error", 1)
  125.             IF Rtn% = 1 THEN
  126.             GOTO ASKDIR
  127.             END IF
  128.             GOTO ASKQUIT
  129.         END IF
  130.     END IF
  131.  
  132.            
  133. '' Clear dialogs
  134.     UIPopAll
  135.  
  136.     ClearCopyList
  137.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  138.     WinDir$ = GetWindowsDir()
  139.     DEST$ = GetWindowsDir()
  140.     WinSysDir$ = GetWindowsSysDir()
  141.                                    
  142. ''  *** Create the copy list by referencing the section names defined in dsklayout program
  143. ''  *** place dvphelp section first to force the progress indicator to display quickly
  144.     AddSectionFilesToCopyList "dvphelp", SrcDir$, SpliceDir$
  145.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  146.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  147.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  148.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  149.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  150.     ''*** no longer exist AddSectionFilesToCopyList "Indeo-ini", SrcDir$, WinDir$
  151.     AddSectionFilesToCopyList "dvp", SrcDir$, SpliceDir$
  152.  
  153. ''  Check windrive diskspace
  154.     SizeReq& = GetCopyListCost ("","", "")
  155.     IF SizeReq& <> 0 THEN
  156.     GOSUB SMALLWIN
  157.     ''** changed to let the user enter a different drive 
  158.     ''END
  159.     GOTO ASKDIR
  160.     END IF
  161.  
  162.     ''*** Install all the files
  163.     Install
  164.                                  
  165.     ''*** Register DVP and delete DVP.REG when finished
  166.     RegFile$ = MakePath(SpliceDir$, "dvp.reg")
  167.     FILEEXIST% = DoesFileExist(RegFile$, femExists)        
  168.     IF FILEEXIST% = 1 THEN                                     
  169.        Run ("regedit.exe /s " + RegFile$ )
  170.        RemoveFile RegFile$, cmoNone
  171.     END IF      
  172.     
  173.     '' *** If mplayer.reg exist, then register mplayer and then delete the file         
  174.     RegFile$ = MakePath(WinDir$, "mplayer.reg")
  175.     FILEEXIST% = DoesFileExist(RegFile$, femExists)        
  176.     IF FILEEXIST% = 1 THEN                                     
  177.        Run ("regedit.exe /s " + RegFile$ )
  178.        RemoveFile RegFile$, cmoNone
  179.     END IF      
  180.     
  181.    '' *** If ole2.reg exist, then register ole services and then delete the file
  182.     RegFile$ = MakePath(WinSysDir$, "ole2.reg")
  183.     FILEEXIST% = DoesFileExist(RegFile$, femExists)        
  184.     IF FILEEXIST% = 1 THEN                                     
  185.        Run ("regedit.exe /s " + RegFile$ )
  186.        RemoveFile RegFile$, cmoNone
  187.     END IF      
  188.  
  189.     '' *** profile the display      
  190.     Run ("profdisp.exe")   
  191.  
  192.     
  193.     ''  *** Create the Program Group for the application and the program items within   
  194.     CreateProgmanGroup "Digital Video Producer", "", cmoNone
  195.     SpliceCmd$ = MakePath(SpliceDir$, "dvp.EXE")
  196.     CaptureCmd$ = MakePath(SpliceDir$, "dvpcap.EXE")
  197.     CreateProgmanItem "Digital Video Producer", "Digital Video Producer", SpliceCmd$, "", cmoOverwrite
  198.     CreateProgmanItem "Digital Video Producer", "Digital Video Producer Capture", CaptureCmd$, "", cmoOverwrite 
  199.     CreateProgmanItem "Digital Video Producer", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  200.  
  201.     '' *** CLEANUP OF OLD INDEO: If there exists a file named INDEO.DRV in the Windows System directory, delete it.
  202.     IF NEWINDEO = 1 THEN
  203.        DelFile$ = MakePath ( WinSysDir$,"indeo.drv")
  204.        FILEEXIST% = DoesFileExist(DelFile$, femExists)
  205.        IF FILEEXIST% = 1 THEN
  206.           RemoveFile DelFile$, cmoForce
  207.        END IF    
  208.     ENDIF   
  209.    
  210.     '' *** CLEANUP OF OLD INDEO: If there exists a file named INDEO.INI in the Windows directory, delete it.
  211.     IF NEWINDEO = 1 THEN           
  212.        DelFile$ = MakePath ( WinDir$,"indeo.ini")
  213.        FILEEXIST% = DoesFileExist(DelFile$, femExists)
  214.        IF FILEEXIST% = 1 THEN
  215.           RemoveFile DelFile$, cmoForce
  216.        END IF    
  217.     END IF                     
  218.    
  219.     '' *** CLEANUP OF OLD INDEO: If there exists a file named IR30.DLL in the Windows Systems directory, delete it.
  220.     IF NEWINDEO = 1 THEN
  221.        DelFile$ = MakePath ( WinSysDir$,"ir30.dll")
  222.        FILEEXIST% = DoesFileExist(DelFile$, femExists)
  223.        IF FILEEXIST% = 1 THEN
  224.           RemoveFile DelFile$, cmoForce
  225.        END IF    
  226.     END IF                     
  227.     
  228.     '' *** CLEANUP OF OLD SPLICE: If there exists a file named FLICFILE.DLL in the Windows Systems directory, delete it.
  229.     DelFile$ = MakePath ( WinSysDir$,"flicfile.dll")
  230.     FILEEXIST% = DoesFileExist(DelFile$, femExists)
  231.     IF FILEEXIST% = 1 THEN
  232.        RemoveFile DelFile$, cmoForce
  233.     END IF    
  234.      
  235.    '' *** CLEANUP OF OLD SPLICE: If there exists a file named IMAGESEQ.DLL in the Windows Systems directory, delete it.
  236.     DelFile$ = MakePath ( WinSysDir$,"imageseq.dll")
  237.     FILEEXIST% = DoesFileExist(DelFile$, femExists)
  238.     IF FILEEXIST% = 1 THEN
  239.        RemoveFile DelFile$, cmoForce
  240.     END IF    
  241.     
  242.     '' *** Running from another Install, just inform user to restart Windows before running DVP then terminate
  243.     IF CHILDINSTALL = 1 THEN    
  244.        i% = DoMsgBox("Asymetrix Digital Video Producer installation is complete.  Restart Windows before running this application.", "Asymetrix Digital Video Producer Setup", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  245.        END
  246.     END IF      
  247.    
  248.     '' *** Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  249.     '' *** else, it gives the user the choice
  250.     RESTRT% = RestartListEmpty ()
  251.     Exe$ = DEST$ + "\_msrstrt.exe"
  252.     Batch$ = DEST$ + "\_mssetup.bat"
  253.     empty$ = ""                          
  254.     
  255. RESTART:
  256.  
  257.     '' *** there is something in the restart list, prompt the user about need to restart windows
  258.     IF RESTRT% = 0 THEN
  259.        sz$ = UIStartDlg(cuidll$, RESTART, "FInfo0DlgProc", 0, "")
  260.        IF sz$ = "REACTIVATE" THEN
  261.           GOTO RESTART
  262.        ENDIF
  263.        I% = ExitExecRestart ()
  264.        RemoveFile Exe$, cmoForce
  265.        RemoveFile Batch$, cmoForce
  266.        END
  267.        
  268.     '' *** otherwise, tell user that they will need to restart window and ask if they want us to do it now   
  269.     ELSE
  270.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  271.           
  272.        '' *** select to restart Windows nows           
  273.        IF sz$ = "CONTINUE" THEN          
  274.        
  275.           '' *** exit windows and run the DOS program to install the remaining files
  276.           I% = ExitWindowsExec (Exe$, empty$)
  277.           
  278.           '' *** can't restart Windows due to error
  279.           IF I% = 0 THEN
  280.              GOTO RESTART
  281.              
  282.           '' *** terminate the installation program   
  283.           ELSE
  284.              END
  285.           ENDIF                                        
  286.           
  287.        '' *** user does not want to restart Windows now   
  288.        ELSEIF sz$ = "EXIT" THEN
  289.           UIPopAll
  290.           END
  291.           
  292.        ELSEIF sz$ = "REACTIVATE" THEN
  293.           GOTO RESTART
  294.           
  295.        ELSE
  296.           UIPop 1
  297.           
  298.        END IF
  299.        
  300.     END IF
  301.  
  302.  
  303. QUIT:
  304.     ON ERROR GOTO ERRQUIT
  305.  
  306.     IF ERR = 0 THEN
  307.     dlg% = EXITSUCCESS
  308.     ELSEIF ERR = STFQUIT THEN
  309.     dlg% = EXITQUIT
  310.     ELSE
  311.     dlg% = EXITFAILURE
  312.     END IF
  313. QUITL1:
  314.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  315.     IF sz$ = "REACTIVATE" THEN
  316.     GOTO QUITL1
  317.     END IF
  318.     UIPop 1
  319.     END
  320.  
  321. ERRQUIT:
  322.     i% = DoMsgBox("An installation problem occured.  Please call Product Support.", "Asymetrix Digital Video Producer Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  323.     END
  324.  
  325.  
  326. ASKQUIT:
  327.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  328.  
  329.     IF sz$ = "EXIT" THEN
  330.     UIPopAll
  331. ''        ERROR STFQUIT
  332.     END
  333.     ELSEIF sz$ = "REACTIVATE" THEN
  334.     GOTO ASKQUIT
  335.     ELSE
  336.     UIPop 1
  337.     END IF
  338.     RETURN
  339.  
  340. SMALLWIN:
  341.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  342.     IF sz$ = "REACTIVATE" THEN
  343.     GOTO SMALLWIN
  344.     END IF
  345.     UIPop 1
  346.     RETURN                                                                 
  347.  
  348.     
  349. '*************************************************************************
  350. '** SubRoutine Install
  351. '**
  352. '** Purpose:
  353. '**     Installs the files and updates ini file settings
  354. '** Arguments:
  355. '**     none.
  356. '** Returns:
  357. '**     none.
  358. '*************************************************************************
  359. SUB Install STATIC
  360.  
  361.     SetRestartDir WinDir$
  362.     CopyFilesInCopyList
  363.  
  364.     '' *** Updating SYSTEM.INI
  365.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  366.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite  
  367.  
  368.     '' *** updating SYSTEM.INI indeo driver settings that are version independent
  369.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "msrle.drv", cmoOverwrite 
  370.     
  371.     '' *** new indeo, so set correct driver settings
  372.     IF NEWINDEO THEN
  373.     
  374.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  375.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  376.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  377.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  378.        
  379.     '' *** old indeo, so use the indeov.drv umbrella driver   
  380.     ELSE             
  381.     
  382.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  383.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  384.     IF I% = 0  THEN
  385.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  386.     END IF
  387.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  388.     
  389.     END IF   
  390.  
  391.     '' *** Updating WIN.INI 
  392.     CreateIniKeyValue "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  393.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  394.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  395.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  396.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  397.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  398.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  399.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  400.     IF VflatdPresent() = 0 THEN
  401.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  402.     END IF              
  403.     
  404. END SUB
  405.                                        
  406.                                        
  407. '*************************************************************************
  408. '** Subroutine - MakePath
  409. '**
  410. '** Purpose:
  411. '**     Appends a file name to the end of a directory path,
  412. '**     inserting a backslash character as needed.
  413. '** Arguments:
  414. '**     szDir$  - full directory path (with optional ending "\")
  415. '**     szFile$ - filename to append to directory
  416. '** Returns:
  417. '**     Resulting fully qualified path name.
  418. '*************************************************************************
  419. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  420.     IF szDir$ = "" THEN
  421.     MakePath = szFile$
  422.     ELSEIF szFile$ = "" THEN
  423.     MakePath = szDir$
  424.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  425.     MakePath = szDir$ + szFile$
  426.     ELSE
  427.     MakePath = szDir$ + "\" + szFile$
  428.     END IF
  429. END FUNCTION
  430.  
  431.