home *** CD-ROM | disk | FTP | other *** search
/ The Net Power 1997 February / NetPower_2-97.mdf / nettools / webstuf / htmlbld / win32s / disk1 / 32sinst.mst < prev    next >
Text File  |  1996-08-29  |  22KB  |  646 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. GLOBAL DESTSYS$      ''Windows\System directory.
  37. GLOBAL DEST32S$      ''Windows\System\Win32s directory
  38. GLOBAL DESTFREE$     ''Freecell directory
  39. GLOBAL OLE_PROTECT%  ''Indicates whether ole2 dlls were protected from being
  40.                      '' copied.
  41.  
  42. DECLARE SUB Install(OLEONLY%, OLE2_32%, OLE2_16%, OLE2AUTO_16%, OLE16RUNAPP%)
  43. DECLARE SUB UpdateSystemIni
  44. DECLARE FUNCTION RebootSystem(OLEONLY%) AS INTEGER
  45. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  46. DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
  47. DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" AS INTEGER
  48. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  49. DECLARE FUNCTION PagingEnabled LIB "INIUPD.DLL" AS INTEGER
  50. DECLARE FUNCTION ShareEnabled LIB "INIUPD.DLL" AS INTEGER
  51. DECLARE FUNCTION IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
  52. DECLARE FUNCTION IsRunningApp LIB "INIUPD.DLL" AS INTEGER
  53. DECLARE FUNCTION SetCuiFlags LIB "MSCUISTF.DLL" (arg1%, arg2%) AS INTEGER
  54. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
  55. DECLARE FUNCTION GetModuleHandle LIB "KRNL386.EXE" (arg1$) AS INTEGER
  56. DECLARE FUNCTION LoadLibrary LIB "KRNL386.EXE" (arg1$) AS INTEGER
  57. DECLARE SUB FreeLibrary LIB "KRNL386.EXE" (arg1%)
  58. DECLARE FUNCTION SetErrorMode LIB "KRNL386.EXE" (arg1%) AS INTEGER
  59.  
  60. INIT:
  61.     CUIDLL$ = "mscuistf.dll"            '' Custom user interface dll
  62.     HELPPROC$ = "FHelpDlgProc"          '' Help dialog procedure
  63.     szOldVer$ ="1.00.000     "          '' Reserve space in string for version
  64.     WIN32ENABLED% = 0
  65.     OLEONLY% = 0
  66.     OLE2_16% = 0
  67.     OLE2AUTO_16% = 0
  68.     OLE16RUNAPP% = 0
  69.     OLE_PROTECT% = 0
  70.  
  71.     ON ERROR GOTO ERRNORMAL
  72.  
  73.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  74.  
  75.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  76.     IF szInf$ = "" THEN
  77.         szInf$ = GetSymbolValue("STF_CWDDIR") + "32sinst.inf"
  78.     END IF
  79.     ReadInfFile szInf$
  80.  
  81.     SetBitmap CUIDLL$, LOGO
  82.     SetTitle "Microsoft Win32s version " + MID$(GetSectionKeyVersion("WindowsSystem", "win32s16"), 1, 4) + " Setup Program"
  83.  
  84.     DESTSYS$ = GetWindowsSysDir()
  85.     DEST32S$ = DESTSYS + "WIN32S\"
  86.  
  87. '$IFDEF DEBUG
  88.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  89.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  90.     IF IsDriveValid(WinDrive$) = 0 THEN
  91.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  92.         GOTO QUIT
  93.     END IF
  94. '$ENDIF ''DEBUG
  95.  
  96. CHECK:
  97.     '' Can not run on versions less than 3.10.
  98.     IF GetWindowsMajorVersion < 3 THEN
  99.         ExitCode% = EXITFAILNOTWIN31
  100.         GOTO QUIT
  101.     END IF
  102.     IF GetWindowsMajorVersion = 3 AND GetWindowsMinorVersion < 10 THEN
  103.         ExitCode% = EXITFAILNOTWIN31
  104.         GOTO QUIT
  105.     END IF
  106.     '' Check that we are not runnig on Chicago, including pre-released
  107.     '' Chicago versions.
  108.     IF GetWindowsMajorVersion * 100 + GetWindowsMinorVersion > 350 THEN
  109.         ExitCode% = EXITSUCCESS
  110.         WIN32ENABLED% = 1
  111.         GOTO FREECELL
  112.     END IF
  113.     IF GetWindowsMode < 2  THEN
  114.         IF OnWindowsNT() THEN
  115.             ExitCode% = EXITFAILNOTINTEL '' Running on Windows NT (on RISC)
  116.         ELSE
  117.             ExitCode% = EXITFAILNOTENH   '' Standard Mode Windows
  118.         END IF
  119.         GOTO QUIT
  120.     END IF
  121.     IF OnWindowsNT() THEN
  122.         ExitCode% = EXITSUCCESS
  123.         WIN32ENABLED% = 1
  124.         GOTO FREECELL
  125.     END IF
  126.     ExitCode% = EXITSUCCESS
  127.  
  128.     if IsRunningApp() <> 0 THEN
  129.         ExitCode% = EXITFAILRUNAPP
  130.         GOTO QUIT
  131.     END IF
  132.  
  133.     '' Get version of Win32s to be installed from version info in INF file
  134.     szNewVer$ = GetSectionKeyVersion("WindowsSystem", "win32s16")
  135.  
  136.     '' See if OLE is included.
  137.  
  138.     OLEINCLUDED% = DoesFileExist( GetSymbolValue("STF_SRCDIR") + "OLE2THK.DL_", femExists )
  139.  
  140.     IF OLEINCLUDED% = 1 THEN
  141.         '' See whether one of the OLE 16 bit components is loaded.
  142.         IF GetModulehandle("compobj") <> 0 THEN
  143.             OLE16RUNAPP% = 1
  144.             GOTO GetOleVersion
  145.         END IF
  146.         IF GetModuleHandle("ole2") <> 0 THEN
  147.             OLE16RUNAPP% = 1
  148.             GOTO GetOleVersion
  149.         END IF
  150.         IF GetModuleHandle("ole2prox") <> 0 THEN
  151.             OLE16RUNAPP% = 1
  152.             GOTO GetOleVersion
  153.         END IF
  154.         IF GetModuleHandle("ole2conv") <> 0 THEN
  155.             OLE16RUNAPP% = 1
  156.             GOTO GetOleVersion
  157.         END IF
  158.         IF GetModuleHandle("storage") <> 0 THEN
  159.             OLE16RUNAPP% = 1
  160.             GOTO GetOleVersion
  161.         END IF
  162.         IF GetModuleHandle("ole2nls") <> 0 THEN
  163.             OLE16RUNAPP% = 1
  164.             GOTO GetOleVersion
  165.         END IF
  166.         IF GetModuleHandle("ole2disp") <> 0 THEN
  167.             OLE16RUNAPP% = 1
  168.             GOTO GetOleVersion
  169.         END IF
  170.         IF GetModuleHandle("typelib") <> 0 THEN
  171.             OLE16RUNAPP% = 1
  172.             GOTO GetOleVersion
  173.         END IF
  174.  
  175. GetOleVersion:
  176.         szOleNewVer$ = GetSectionKeyVersion("OleWindowsSystemWin32s", "ole2thk")
  177.  
  178.         '' Get version of currently installed OLE32 from version info of
  179.         '' ole2thk file
  180.         szOleOldVer$ = GetVersionOfFile( DESTSYS$ + "WIN32S\OLE2THK.DLL" )
  181.  
  182.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "COMPOBJ.DLL" )
  183.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "compobj")
  184.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  185.             OLE2_16% = 1
  186.         END IF
  187.  
  188.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2.DLL" )
  189.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2")
  190.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  191.             OLE2_16% = 1
  192.         END IF
  193.  
  194.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2PROX.DLL" )
  195.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2prox")
  196.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  197.             OLE2_16% = 1
  198.         END IF
  199.  
  200.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "STORAGE.DLL" )
  201.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "storage")
  202.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  203.             OLE2_16% = 1
  204.         END IF
  205.  
  206.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2CONV.DLL" )
  207.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2conv")
  208.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  209.             OLE2_16% = 1
  210.         END IF
  211.  
  212.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2NLS.DLL" )
  213.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2nls")
  214.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  215.             OLE2AUTO_16% = 1
  216.         END IF
  217.  
  218.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2DISP.DLL" )
  219.         szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2disp")
  220.         IF (szOle16NewVer$ > szOle16OldVer$) THEN
  221.             OLE2AUTO_16% = 1
  222.         END IF
  223.  
  224.         szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "TYPELIB.DLL" )
  225.         szOle16