home *** CD-ROM | disk | FTP | other *** search
/ Interactive Wine Cellar / Interactive Wine Cellar.iso / install / wine.mst < prev   
Encoding:
Text File  |  1995-03-24  |  10.1 KB  |  321 lines

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