home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / d / d001 / 1.ddi / SETUP.MST < prev    next >
Encoding:
Text File  |  1992-10-27  |  15.3 KB  |  411 lines

  1. '**************************************************************************
  2. '*                       VfW 1.0 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 SMALLDEST        = 2100
  22. CONST SMALLWIN      = 2200
  23. CONST BADPATH       = 6400
  24.  
  25. ''Bitmap ID
  26. CONST LOGO = 1
  27.  
  28. ''Disk Sizes
  29. CONST OPT1_WIN = 1024000   '' 1 MB
  30. CONST OPT1_DEST = 0
  31.  
  32. CONST OPT2_WIN = 1536000   '' 1.5 MB
  33. CONST OPT2_DEST = 600000   '' 600KB
  34.  
  35. CONST OPT3_WIN = 1536000   '' 1.5 MB
  36. CONST OPT3_DEST= 1024000   '' 1 MB
  37.  
  38. CONST WINDSURF = 1024000
  39.  
  40. GLOBAL AVISize&         '' File size for optional AVI Sample Files
  41. GLOBAL File1
  42. GLOBAL WantedWinSize&  '' Total Disk Size required for installation
  43. GLOBAL WantedDestSize&  '' Total Disk Size required for installation
  44.  
  45. ''File Types
  46. GLOBAL DEST$        ''Default destination directory.
  47. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  48. GLOBAL OPTCUR$      ''Option selection from option dialog.
  49. GLOBAL CHECKSTATES$
  50.  
  51. DECLARE SUB Install
  52. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  53.  
  54. INIT:
  55.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  56.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  57.  
  58.     MajorVer% = GetWindowsMajorVersion()
  59.     MinorVer% = GetWindowsMinorVersion()
  60.  
  61.     IF  MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  62.     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)
  63.         END
  64.     END IF
  65.  
  66.     SetBitmap CUIDLL$, LOGO
  67.     SetTitle "Video for Windows 1.0"
  68.  
  69.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  70.     IF szInf$ = "" THEN
  71.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  72.     END IF
  73.     ReadInfFile szInf$
  74.  
  75.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  76.     DEST$ = WINDRIVE$ + ":\WINVIDEO"
  77.  
  78.     OPTCUR$ = "2"                         '' Set default option to Playback and Video Tools
  79.  
  80. WELCOME:
  81.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  82.     IF sz$ = "CONTINUE" THEN
  83.         UIPop 1
  84. WELCOMEL1:
  85.     '' Get user and company name...
  86.         IF InitSystem(1, "", 0) = 0 THEN
  87.             GOSUB ASKQUIT
  88.             GOTO WELCOMEL1
  89.         END IF
  90.     ELSE
  91.         GOSUB ASKQUIT
  92.         GOTO WELCOME
  93.     END IF
  94.  
  95. '' Set the default value for the Sample Files RADIO Button.
  96.     AddListItem "CheckItemsIn", "ON"
  97.  
  98. OPTION:
  99.     SetSymbolValue "RadioDefault", OPTCUR$
  100. OPTL1:
  101.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP2, HELPPROC$)
  102.     OPTCUR$ = GetSymbolValue("ButtonChecked")
  103.  
  104.     IF sz$ = "CONTINUE" THEN
  105.         UIPop(1)
  106.     ELSEIF sz$ = "REACTIVATE" THEN
  107.         GOTO OPTL1
  108.     ELSE
  109.         GOSUB ASKQUIT
  110.         GOTO OPTION
  111.     END IF
  112.  
  113. AVIFiles:
  114.     sz$ = UIStartDlg(CUIDLL$, CHECK, "FCheckDlgProc", 0, "")
  115.  
  116. '' Re-set file selection based on the user selection in case she decides to go back
  117. '' to the previous dialog box
  118.     SetSymbolValue "CheckItemsIn", GetListItem("CheckItemsOut", 1)
  119. ''    AddListItem "CheckItemsIn", GetListItem("CheckItemsOut", 2)
  120.  
  121.     IF sz$ = "CONTINUE" THEN
  122.         UIPop 1
  123.     ELSEIF sz$ = "BACK" then
  124.         UIPop 1
  125.         GOTO OPTION
  126.     ELSEIF sz$ = "REACTIVATE" THEN
  127.         GOTO AVIFiles
  128.     ELSE
  129.         GOSUB ASKQUIT
  130.     END IF
  131.  
  132. GETPATH:
  133.     SetSymbolValue "EditTextIn", DEST$
  134.     SetSymbolValue "EditFocus", "END"
  135. GETPATHL1:
  136.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP3, HELPPROC$)
  137.     DEST$ = GetSymbolValue("EditTextOut")
  138.  
  139.     IF sz$ = "CONTINUE" THEN
  140.         IF IsDirWritable(DEST$) = 0 THEN
  141.             GOSUB BADPATH
  142.             GOTO GETPATHL1
  143.         END IF
  144.         UIPop 1
  145.     ELSEIF sz$ = "REACTIVATE" THEN
  146.         GOTO GETPATHL1
  147.     ELSEIF sz$ = "BACK" THEN
  148.         UIPop 1
  149.         GOTO AVIFiles
  150.     ELSE
  151.         GOSUB ASKQUIT
  152.         GOTO GETPATH
  153.     END IF
  154.  
  155. ClearCopyList
  156.  
  157. '' Settting Sample AVI Files to be copied
  158.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  159.     AVISize = 0
  160.     File1 = 0
  161.  
  162.         IF GetListItem("CheckItemsOut", 1) = "ON" THEN
  163.             AddSectionFilesToCopyList "AVI File1", SrcDir$, DEST$
  164.             AVISize& = WINDSURF
  165.         File1 = 1
  166.         END IF
  167.  
  168. ''Set disk size accorting to user selected option
  169.         IF OPTCUR$ = "1" THEN
  170.             WantedWinSize&=OPT1_WIN
  171.         WantedDestSize&=OPT1_DEST
  172.         ElseIf OPTCUR$ = "2" THEN
  173.             WantedWinSize&=OPT2_WIN
  174.         WantedDestSize&=OPT2_DEST
  175.         Else
  176.             WantedWinSize&=OPT3_WIN
  177.         WantedDestSize&=OPT3_DEST
  178.         End If
  179.  
  180. '' Calculate destination disk size requirements with the AVI Sample Files
  181.         WantedDestSize& = WantedDestSize& + AVISize&
  182.  
  183. '' Get disk space for the Windows Drive
  184.         DiskSize&=GetFreeSpaceForDrive(WINDRIVE$)
  185.  
  186. '' Check to see that there is enough space in the windows drive
  187.     If WantedWinSize& > DiskSize& then
  188.         GOSUB SMALLWIN
  189.         GOTO GETPATH
  190.     END IF
  191.  
  192. '' Get drive letter for the destination path
  193.         Drive$=Mid$(DEST$,1,1)
  194.  
  195. '' Cet disk space for the destination path
  196.         DiskSize&=GetFreeSpaceForDrive(Drive$)
  197.  
  198. '' Check to see that there is enough space in the destination drive
  199.         If WantedDestSize& > DiskSize& then
  200.             GOSUB SMALLDEST
  201.             GOTO GETPATH
  202.         End If
  203.  
  204. Install
  205.  
  206. QUIT:
  207.     ON ERROR GOTO ERRQUIT
  208.  
  209.     IF ERR = 0 THEN
  210.         dlg% = EXITSUCCESS
  211.     ELSEIF ERR = STFQUIT THEN
  212.         dlg% = EXITQUIT
  213.     ELSE
  214.         dlg% = EXITFAILURE
  215.     END IF
  216. QUITL1:
  217.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  218.     IF sz$ = "REACTIVATE" THEN
  219.         GOTO QUITL1
  220.     END IF
  221.     UIPop 1
  222.  
  223.     END
  224.  
  225. ERRQUIT:
  226.     i% = DoMsgBox("Setup sources were corrupted, call the included support number", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  227.     END
  228.  
  229. BADPATH:
  230.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  231.     IF sz$ = "REACTIVATE" THEN
  232.         GOTO BADPATH
  233.     END IF
  234.     UIPop 1
  235.     RETURN
  236.  
  237. ASKQUIT:
  238.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  239.  
  240.     IF sz$ = "EXIT" THEN
  241.         UIPopAll
  242. ''        ERROR STFQUIT
  243.     END
  244.     ELSEIF sz$ = "REACTIVATE" THEN
  245.         GOTO ASKQUIT
  246.     ELSE
  247.         UIPop 1
  248.     END IF
  249.     RETURN
  250.  
  251. SMALLDEST:
  252.     sz$ = UIStartDlg(CUIDLL$, SMALLDEST, "FInfo0DlgProc", 0, "")
  253.     IF sz$ = "REACTIVATE" THEN
  254.         GOTO SMALLDEST
  255.     END IF
  256.     UIPop 1
  257.     RETURN
  258.  
  259. SMALLWIN:
  260.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  261.     IF sz$ = "REACTIVATE" THEN
  262.         GOTO SMALLWIN
  263.     END IF
  264.     UIPop 1
  265.     RETURN
  266.  
  267. '**
  268. '** Purpose:
  269. '**     Builds the copy list and performs all installation operations.
  270. '** Arguments:
  271. '**     none.
  272. '** Returns:
  273. '**     none.
  274. '*************************************************************************
  275. SUB Install STATIC
  276.  
  277. SrcDir$ = GetSymbolValue("STF_SRCDIR")
  278. WinDir$ = GetWindowsDir()
  279. WinSysDir$ = GetWindowsSysDir()
  280.  
  281. CreateDir DEST$, cmoNone
  282.  
  283. '' Setting up OLD files that need to be removed from the users computer
  284.         AddSectionFilesToCopyList "Remove Files", SrcDir$, DEST$
  285.  
  286. '' Setting RUNTIME files to be copied
  287.         AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  288.         AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  289.  
  290.     IF File1 = 1 then
  291.             AddSectionFilesToCopyList "Release Notes 1", SrcDir$, DEST$
  292.     ELSE
  293.             AddSectionFilesToCopyList "Release Notes", SrcDir$, DEST$
  294.     END IF
  295.  
  296.         AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  297.  
  298. '' Seeting Media Browser, VidEdit and VidCap files to be copied (if appropriate)
  299.         IF OPTCUR$ = "2" OR OPTCUR$ = "3" THEN
  300.             AddSectionFilesToCopyList "MBrowser", SrcDir$, WinDir$
  301.             AddSectionFilesToCopyList "MBrowser Bitmaps", SrcDir$, WinSysDir$
  302.             AddSectionFilesToCopyList "VidEdit", SrcDir$, DEST$
  303.             AddSectionFilesToCopyList "VidCap", SrcDir$, DEST$
  304.         END IF
  305.  
  306. '' Seeting BitEdit, PalEdit and WaveEdit files to be copied (if appropriate)
  307.         IF OPTCUR$ = "3" THEN
  308.             AddSectionFilesToCopyList "BitEdit", SrcDir$, DEST$
  309.             AddSectionFilesToCopyList "PalEdit", SrcDir$, DEST$
  310.             AddSectionFilesToCopyList "WaveEdit", SrcDir$, DEST$
  311.         END IF
  312.  
  313. '' Seeting Tools Support files to be copied (if appropriate)
  314.         IF OPTCUR$ = "2" OR OPTCUR$ = "3" THEN
  315.             CreateDir DEST$ + "\INCLUDE", cmoNone
  316.             AddSectionFilesToCopyList "Tool Stuff", SrcDir$, WinSysDir$
  317.             AddSectionFilesToCopyList "Include Files", SrcDir$, DEST$ + "\INCLUDE"
  318.         END IF
  319.  
  320. CopyFilesInCopyList
  321.  
  322. ''Updating WIN.INI and SYSTEM.INI
  323.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  324.         CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeo.drv", cmoOverwrite
  325.         CreateIniKeyValue "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  326.         CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  327.  
  328.         IF OPTCUR$ = "2" OR OPTCUR$ = "3" THEN
  329.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Animals", "VFW_SAMPLES,\ANIMALS.MBR,vidclip.bmp,Video for Windows  Animals,Video for Windows CD-ROM",cmoOverwrite
  330.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Funstuff_Animation", "VFW_SAMPLES,\ANIMATN.MBR,funclip.bmp,Video for Windows  Funstuff Animation,Video for Windows CD-ROM",cmoOverwrite
  331.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__People_and_Places", "VFW_SAMPLES,\CANTFRGT.MBR,vidclip.bmp,Video for Windows  People and Places,Video for Windows CD-ROM",cmoOverwrite
  332.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Environment", "VFW_SAMPLES,\ENVIRMNT.MBR,vidclip.bmp,Video for Windows  Environment,Video for Windows CD-ROM",cmoOverwrite
  333.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Family", "VFW_SAMPLES,\FAMILY.MBR,vidclip.bmp,Video for Windows  Family,Video for Windows CD-ROM",cmoOverwrite
  334.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Frontier", "VFW_SAMPLES,\FRONTIER.MBR,vidclip.bmp,Video for Windows  Frontier,Video for Windows CD-ROM",cmoOverwrite
  335.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Global", "VFW_SAMPLES,\GLOBAL.MBR,vidclip.bmp,Video for Windows  Global,Video for Windows CD-ROM",cmoOverwrite
  336.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Kids", "VFW_SAMPLES,\KIDS.MBR,vidclip.bmp,Video for Windows  Kids,Video for Windows CD-ROM",cmoOverwrite
  337.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Funstuff_Larger_Samples", "VFW_SAMPLES,\LARGER.MBR,funclip.bmp,Video for Windows  Funstuff Larger Samples,Video for Windows CD-ROM",cmoOverwrite
  338.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Leisure", "VFW_SAMPLES,\LEISURE.MBR,vidclip.bmp,Video for Windows  Leisure,Video for Windows CD-ROM",cmoOverwrite
  339.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Landscape", "VFW_SAMPLES,\LNDSCAPE.MBR,vidclip.bmp,Video for Windows  Landscape,Video for Windows CD-ROM",cmoOverwrite
  340.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Funstuff_Performances", "VFW_SAMPLES,\PERFORM.MBR,funclip.bmp,Video for Windows  Funstuff Performances,Video for Windows CD-ROM",cmoOverwrite
  341.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Space", "VFW_SAMPLES,\SPACE.MBR,vidclip.bmp,Video for Windows  Space,Video for Windows CD-ROM",cmoOverwrite
  342.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Funstuff_Sports", "VFW_SAMPLES,\SPORTS.MBR,funclip.bmp,Video for Windows  Funstuff Sports,Video for Windows CD-ROM",cmoOverwrite
  343.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Transportation", "VFW_SAMPLES,\TRANSPTN.MBR,vidclip.bmp,Video for Windows  Transportation,Video for Windows CD-ROM",cmoOverwrite
  344.             CreateIniKeyValue WinDir$ + "MBROWSER.INI", "Collections", "Video_for_Windows__Workers", "VFW_SAMPLES,\WORKERS.MBR,vidclip.bmp,Video for Windows  Workers,Video for Windows CD-ROM",cmoOverwrite
  345.         End IF
  346.  
  347. Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  348.  
  349. '' Updating Progman Groups
  350.         CreateProgmanGroup "Video for Windows 1.0", "", cmoNone
  351.         ShowProgmanGroup  "Video for Windows 1.0", 1, cmoNone
  352. '' Mplayer
  353.         CreateProgmanItem "Video for Windows 1.0", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  354.  
  355.     IF File1 = 1 then
  356.             CreateProgmanItem "Video for Windows 1.0", "Windsurf Clip", MakePath(Dest$, "WndSurf1.avi"), "", cmoOverwrite
  357.     END IF
  358.  
  359. '' Readme.txt
  360.         CreateProgmanItem "Video for Windows 1.0", "Release Notes", MakePath(DEST$, "vfw1.wri"), "", cmoOverwrite
  361.  
  362.         IF OPTCUR$ = "2" OR OPTCUR$ = "3" THEN
  363. '' Browser
  364.             CreateProgmanGroup "Accessories", "", cmoNone
  365.             ShowProgmanGroup  "Accessories", 1, cmoNone
  366.             CreateProgmanItem "Accessories", "Media Browser", MakePath(WinDir$, "mbrowser.exe"), "", cmoOverwrite
  367.  
  368. '' VidEdit
  369.             CreateProgmanItem "Video for Windows 1.0", "VidEdit", MakePath(DEST$,"videdit.exe"), "", cmoOverwrite
  370. '' VidCap
  371.             CreateProgmanItem "Video for Windows 1.0", "VidCap", MakePath(DEST$,"vidcap.exe"), "", cmoOverwrite
  372.         END IF
  373.  
  374.         IF OPTCUR$ = "3" THEN
  375.             CreateProgmanGroup "Multimedia Data Tools", "", cmoNone
  376.             ShowProgmanGroup  "Multimedia Data Tools", 1, cmoNone
  377. '' BitEdit
  378.             CreateProgmanItem "Multimedia Data Tools", "BitEdit", MakePath(DEST$,"bitedit.exe"), "", cmoOverwrite
  379. '' PlaEdit
  380.             CreateProgmanItem "Multimedia Data Tools", "PalEdit", MakePath(DEST$,"paledit.exe"), "", cmoOverwrite
  381. '' WaveEdit
  382.             CreateProgmanItem "Multimedia Data Tools", "WaveEdit", MakePath(DEST$,"waveedit.exe"), "", cmoOverwrite
  383.         END IF
  384.  
  385. Run ("profdisp.exe")
  386.  
  387. END SUB
  388.  
  389. '**
  390. '** Purpose:
  391. '**     Appends a file name to the end of a directory path,
  392. '**     inserting a backslash character as needed.
  393. '** Arguments:
  394. '**     szDir$  - full directory path (with optional ending "\")
  395. '**     szFile$ - filename to append to directory
  396. '** Returns:
  397. '**     Resulting fully qualified path name.
  398. '*************************************************************************
  399. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  400.     IF szDir$ = "" THEN
  401.         MakePath = szFile$
  402.     ELSEIF szFile$ = "" THEN
  403.         MakePath = szDir$
  404.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  405.         MakePath = szDir$ + szFile$
  406.     ELSE
  407.         MakePath = szDir$ + "\" + szFile$
  408.     END IF
  409. END FUNCTION
  410.  
  411.