home *** CD-ROM | disk | FTP | other *** search
/ Best Sellers 7: Football Classics 2 / CD1.iso / utils / win32s / disk1 / 32sinst.mst < prev    next >
Text File  |  1995-03-12  |  26KB  |  736 lines

  1. '**************************************************************************
  2. '*                  MS Test script for Win32s setup program
  3. '**************************************************************************
  4.  
  5. '' $DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. ''Dialog ID's
  11. CONST WELCOME                  = 100
  12. CONST ASKQUIT                  = 200
  13. CONST DESTPATH                 = 300
  14. CONST EXITFAILURE              = 400
  15. CONST EXITQUIT                 = 600
  16. CONST EXITSUCCESS              = 700
  17. CONST OPTIONS                  = 800
  18. CONST BADPATH                  = 6400
  19.  
  20. CONST HELPWELCOME              = 1000
  21. CONST VERPATH                  = 1100
  22. CONST EXITFAILNOTWIN31         = 1200
  23. CONST EXITFAILNOTENH           = 1300
  24. CONST EXITFAILNOTPAGING        = 1325
  25. CONST EXITFAILNOTINTEL         = 1350
  26. CONST EXITFAILRUNAPP           = 1360
  27. CONST FREECELLINST             = 1400
  28. CONST FREECELLINSTNOWIN32S     = 1450
  29. CONST FREECELLPATH             = 1500
  30. CONST HELPFREECELL             = 1600
  31.  
  32.  
  33. ''Bitmap ID
  34. CONST LOGO = 1
  35.  
  36. ''GetTempFileName flags
  37. CONST TF_FORCEDRIVE            = 128
  38.  
  39. GLOBAL DESTWIN$      ''Windows directory.
  40. GLOBAL DESTSYS$      ''Windows\System directory.
  41. GLOBAL DEST32S$      ''Windows\System\Win32s directory
  42. GLOBAL DESTFREE$     ''Freecell directory
  43. GLOBAL OLE_PROTECT%  ''Indicates whether ole2 dlls were protected from being
  44.                      '' copied.
  45. GLOBAL OLE_OLEBOOT%
  46. GLOBAL VERNUM$       '' Win32s Version Number (i.e., for v1.25 VERNUM$="125"
  47.  
  48. DECLARE SUB Install(OLEONLY%, OLE2_32%, OLE2_16%, OLE2AUTO_16%, OLE16RUNAPP%)
  49. DECLARE SUB RecoverFromCopy(szFileName$)
  50. DECLARE SUB UpdateSystemIni
  51. DECLARE FUNCTION RebootSystem(OLEONLY%) AS INTEGER
  52. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  53. DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
  54. DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" AS INTEGER
  55. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  56. DECLARE FUNCTION PagingEnabled LIB "INIUPD.DLL" AS INTEGER
  57. DECLARE FUNCTION ShareEnabled LIB "INIUPD.DLL" AS INTEGER
  58. DECLARE FUNCTION IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
  59. DECLARE FUNCTION IsRunningApp LIB "INIUPD.DLL" AS INTEGER
  60. DECLARE FUNCTION SetCuiFlags LIB "MSCUISTF.DLL" (arg1%, arg2%) AS INTEGER
  61. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
  62. DECLARE FUNCTION GetModuleHandle LIB "KRNL386.EXE" (arg1$) AS INTEGER
  63. DECLARE FUNCTION LoadLibrary LIB "KRNL386.EXE" (arg1$) AS INTEGER
  64. DECLARE SUB FreeLibrary LIB "KRNL386.EXE" (arg1%)
  65. DECLARE FUNCTION SetErrorMode LIB "KRNL386.EXE" (arg1%) AS INTEGER
  66.  
  67. DECLARE FUNCTION GetTempFileName LIB "KRNL386.EXE" (drive%, prefix$, u%, filename$) AS INTEGER
  68. DECLARE SUB WriteLine LIB "INIUPD.DLL" (filename$, text$)
  69. DECLARE FUNCTION GetTempFileAt(szDir$, szPrefix$) as string
  70. INIT:
  71.     CUIDLL$ = "mscuistf.dll"            '' Custom user interface dll
  72.     HELPPROC$ = "FHelpDlgProc"          '' Help dialog procedure
  73.     szOldVer$ ="1.00.000     "          '' Reserve space in string for version
  74.     WIN32ENABLED% = 0
  75.     OLEONLY% = 0
  76.     OLE2_16% = 0
  77.     OLE2AUTO_16% = 0
  78.     OLE16RUNAPP% = 0
  79.     OLE_PROTECT% = 0
  80.     OLE_OLEBOOT% = 0
  81.  
  82.     ON ERROR GOTO ERRNORMAL
  83.  
  84.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  85.  
  86.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  87.     IF szInf$ = "" THEN
  88.         szInf$ = GetSymbolValue("STF_CWDDIR") + "32sinst.inf"
  89.     END IF
  90.     ReadInfFile szInf$
  91.  
  92.     SetBitmap CUIDLL$, LOGO
  93.  
  94.     WIN32SVER$ = MID$(GetSectionKeyVersion("WindowsSystem", "win32s16"), 1, 4)
  95.     SetTitle "Microsoft Win32s version " + WIN32SVER$ + " Setup Program"
  96.     VERNUM$ = MID$(WIN32SVER$, 1, 1) + MID$(WIN32SVER$, 3 , 2)
  97.  
  98.     DESTWIN$ = GetWindowsDir()
  99.     DESTSYS$ = GetWindowsSysDir()
  100.     DEST32S$ = DESTSYS + "WIN32S\"
  101.  
  102. '$IFDEF DEBUG
  103.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  104.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  105.     IF IsDriveValid(WinDrive$) = 0 THEN
  106.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  107.         GOTO QUIT
  108.     END IF
  109. '$ENDIF ''DEBUG
  110.  
  111. CHECK:
  112.     '' Can not run on versions less than 3.10.
  113.     IF GetWindowsMajorVersion < 3 THEN
  114.         ExitCode% = EXITFAILNOTWIN31
  115.         GOTO QUIT
  116.     END IF
  117.     IF GetWindowsMajorVersion = 3 AND GetWindowsMinorVersion < 10 THEN
  118.         ExitCode% = EXITFAILNOTWIN31
  119.         GOTO QUIT
  120.     END IF
  121.     '' Check that we are not runnig on Chicago, including pre-released
  122.     '' Chicago versions.
  123.     IF GetWindowsMajorVersion * 100 + GetWindowsMinorVersion > 350 THEN
  124.         ExitCode% = EXITSUCCESS
  125.         WIN32ENABLED% = 1
  126.         GOTO FREECELL
  127.     END IF
  128.     IF GetWindowsMode < 2  THEN
  129.         IF OnWindowsNT() THEN
  130.             ExitCode% = EXITFAILNOTINTEL '' Running on Windows NT (on RISC)
  131.         ELSE
  132.             ExitCode% = EXITFAILNOTENH   '' Standard Mode Windows
  133.         END IF
  134.         GOTO QUIT
  135.     END IF
  136.     IF OnWindowsNT() THEN
  137.         ExitCode% = EXITSUCCESS
  138.         WIN32ENABLED% = 1
  139.         GOTO FREECELL
  140.     END IF
  141.     ExitCode% = EXITSUCCESS
  142.  
  143.     if IsRunningApp() <> 0 THEN
  144.         ExitCode% = EXITFAILRUNAPP
  145.         GOTO QUIT
  146.     END IF
  147.  
  148.     '' Get version of Win32s to be installed from version info in INF file
  149.     szNewVer$ = GetSectionKeyVersion("WindowsSystem", "win32s16")
  150.  
  151.     '' See if OLE is included.
  152.  
  153.     OLEINCLUDED% = DoesFileExist( GetSymbolValue("STF_SRCDIR") + "OLE2THK.DL_", femExists )
  154.  
  155.     IF OLEINCLUDED% = 1 THEN
  156.         '' See whether one of the OLE 16 bit components is loaded.
  157.         IF GetModulehandle("compobj") <> 0 THEN
  158.             OLE16RUNAPP% = 1
  159.             GOTO GetOleVersion
  160.         END IF
  161.         IF GetModuleHandle("ole2") <> 0 THEN
  162.             OLE16RUNAPP% = 1
  163.             GOTO GetOleVersion
  164.         END IF
  165.         IF GetModuleHandle("ole2prox") <> 0 THEN
  166.             OLE16RUNAPP% = 1
  167.             GOTO GetOleVersion
  168.         END IF
  169.         IF GetModuleHandle("ole2conv") <> 0 THEN
  170.             OLE16RUNAPP% = 1
  171.             GOTO GetOleVersion
  172.         END IF
  173.         IF GetModuleHandle("storage") <> 0 THEN
  174.             OLE16RUNAPP% = 1
  175.             GOTO GetOleVersion
  176.         END IF
  177.         IF GetModuleHandle("ole2nls") <> 0 THEN
  178.             OLE16RUNAPP% = 1
  179.             GOTO GetOleVersion
  180.         END IF
  181.         IF GetModuleHandle("ole2disp") <> 0 THEN
  182.             OLE16RUNAPP% = 1
  183.             GOTO GetOleVersion
  184.         END IF
  185.         IF GetModuleHandle("typelib") <> 0 THEN
  186.             OLE16RUNAPP% = 1
  187.             GOTO GetOleVersion
  188.         END IF
  189.  
  190. GetOleVersion:
  191.         szOleNewVer$ = GetSectionKeyVersion("OleWindowsSystemWin32s", "ole2thk")
  192.  
  193.         '' Get version of currently installed OLE32 from version info of
  194.         '' ole2thk file
  195.         szOleOldVer$ = GetVersionOfFile( DESTSYS$ + "WIN32S\OLE2THK.DLL" )
  196.  
  197.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "COMPOBJ.DLL" )
  198.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "compobj")
  199.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  200.             OLE2_16% = 1
  201.         END IF
  202.  
  203.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2.DLL" )
  204.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2")
  205.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  206.             OLE2_16% = 1
  207.         END IF
  208.  
  209.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2PROX.DLL" )
  210.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2prox")
  211.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  212.             OLE2_16% = 1
  213.         END IF
  214.  
  215.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "STORAGE.DLL" )
  216.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "storage")
  217.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  218.             OLE2_16% = 1
  219.         END IF
  220.  
  221.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2CONV.DLL" )
  222.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2conv")
  223.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  224.             OL