home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Review 66
/
cdreview-66-1997-03.iso
/
essent
/
win32s
/
disk1
/
32sinst.mst
< prev
next >
Wrap
Text File
|
1995-09-08
|
26KB
|
736 lines
'**************************************************************************
'* MS Test script for Win32s setup program
'**************************************************************************
'' $DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST BADPATH = 6400
CONST HELPWELCOME = 1000
CONST VERPATH = 1100
CONST EXITFAILNOTWIN31 = 1200
CONST EXITFAILNOTENH = 1300
CONST EXITFAILNOTPAGING = 1325
CONST EXITFAILNOTINTEL = 1350
CONST EXITFAILRUNAPP = 1360
CONST FREECELLINST = 1400
CONST FREECELLINSTNOWIN32S = 1450
CONST FREECELLPATH = 1500
CONST HELPFREECELL = 1600
''Bitmap ID
CONST LOGO = 1
''GetTempFileName flags
CONST TF_FORCEDRIVE = 128
GLOBAL DESTWIN$ ''Windows directory.
GLOBAL DESTSYS$ ''Windows\System directory.
GLOBAL DEST32S$ ''Windows\System\Win32s directory
GLOBAL DESTFREE$ ''Freecell directory
GLOBAL OLE_PROTECT% ''Indicates whether ole2 dlls were protected from being
'' copied.
GLOBAL OLE_OLEBOOT%
GLOBAL VERNUM$ '' Win32s Version Number (i.e., for v1.25 VERNUM$="125"
DECLARE SUB Install(OLEONLY%, OLE2_32%, OLE2_16%, OLE2AUTO_16%, OLE16RUNAPP%)
DECLARE SUB RecoverFromCopy(szFileName$)
DECLARE SUB UpdateSystemIni
DECLARE FUNCTION RebootSystem(OLEONLY%) AS INTEGER
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION PagingEnabled LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION ShareEnabled LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
DECLARE FUNCTION IsRunningApp LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION SetCuiFlags LIB "MSCUISTF.DLL" (arg1%, arg2%) AS INTEGER
DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
DECLARE FUNCTION GetModuleHandle LIB "KRNL386.EXE" (arg1$) AS INTEGER
DECLARE FUNCTION LoadLibrary LIB "KRNL386.EXE" (arg1$) AS INTEGER
DECLARE SUB FreeLibrary LIB "KRNL386.EXE" (arg1%)
DECLARE FUNCTION SetErrorMode LIB "KRNL386.EXE" (arg1%) AS INTEGER
DECLARE FUNCTION GetTempFileName LIB "KRNL386.EXE" (drive%, prefix$, u%, filename$) AS INTEGER
DECLARE SUB WriteLine LIB "INIUPD.DLL" (filename$, text$)
DECLARE FUNCTION GetTempFileAt(szDir$, szPrefix$) as string
INIT:
CUIDLL$ = "mscuistf.dll" '' Custom user interface dll
HELPPROC$ = "FHelpDlgProc" '' Help dialog procedure
szOldVer$ ="1.00.000 " '' Reserve space in string for version
WIN32ENABLED% = 0
OLEONLY% = 0
OLE2_16% = 0
OLE2AUTO_16% = 0
OLE16RUNAPP% = 0
OLE_PROTECT% = 0
OLE_OLEBOOT% = 0
ON ERROR GOTO ERRNORMAL
SrcDir$ = GetSymbolValue("STF_SRCDIR")
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "32sinst.inf"
END IF
ReadInfFile szInf$
SetBitmap CUIDLL$, LOGO
WIN32SVER$ = MID$(GetSectionKeyVersion("WindowsSystem", "win32s16"), 1, 4)
SetTitle "Microsoft Win32s version " + WIN32SVER$ + " Setup Program"
VERNUM$ = MID$(WIN32SVER$, 1, 1) + MID$(WIN32SVER$, 3 , 2)
DESTWIN$ = GetWindowsDir()
DESTSYS$ = GetWindowsSysDir()
DEST32S$ = DESTSYS + "WIN32S\"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
CHECK:
'' Can not run on versions less than 3.10.
IF GetWindowsMajorVersion < 3 THEN
ExitCode% = EXITFAILNOTWIN31
GOTO QUIT
END IF
IF GetWindowsMajorVersion = 3 AND GetWindowsMinorVersion < 10 THEN
ExitCode% = EXITFAILNOTWIN31
GOTO QUIT
END IF
'' Check that we are not runnig on Chicago, including pre-released
'' Chicago versions.
IF GetWindowsMajorVersion * 100 + GetWindowsMinorVersion > 350 THEN
ExitCode% = EXITSUCCESS
WIN32ENABLED% = 1
GOTO FREECELL
END IF
IF GetWindowsMode < 2 THEN
IF OnWindowsNT() THEN
ExitCode% = EXITFAILNOTINTEL '' Running on Windows NT (on RISC)
ELSE
ExitCode% = EXITFAILNOTENH '' Standard Mode Windows
END IF
GOTO QUIT
END IF
IF OnWindowsNT() THEN
ExitCode% = EXITSUCCESS
WIN32ENABLED% = 1
GOTO FREECELL
END IF
ExitCode% = EXITSUCCESS
if IsRunningApp() <> 0 THEN
ExitCode% = EXITFAILRUNAPP
GOTO QUIT
END IF
'' Get version of Win32s to be installed from version info in INF file
szNewVer$ = GetSectionKeyVersion("WindowsSystem", "win32s16")
'' See if OLE is included.
OLEINCLUDED% = DoesFileExist( GetSymbolValue("STF_SRCDIR") + "OLE2THK.DL_", femExists )
IF OLEINCLUDED% = 1 THEN
'' See whether one of the OLE 16 bit components is loaded.
IF GetModulehandle("compobj") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
IF GetModuleHandle("ole2") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
IF GetModuleHandle("ole2prox") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
IF GetModuleHandle("ole2conv") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
IF GetModuleHandle("storage") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
IF GetModuleHandle("ole2nls") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
IF GetModuleHandle("ole2disp") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
IF GetModuleHandle("typelib") <> 0 THEN
OLE16RUNAPP% = 1
GOTO GetOleVersion
END IF
GetOleVersion:
szOleNewVer$ = GetSectionKeyVersion("OleWindowsSystemWin32s", "ole2thk")
'' Get version of currently installed OLE32 from version info of
'' ole2thk file
szOleOldVer$ = GetVersionOfFile( DESTSYS$ + "WIN32S\OLE2THK.DLL" )
szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "COMPOBJ.DLL" )
szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "compobj")
IF (szOle16NewVer$ > szOle16OldVer$) THEN
OLE2_16% = 1
END IF
szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2.DLL" )
szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2")
IF (szOle16NewVer$ > szOle16OldVer$) THEN
OLE2_16% = 1
END IF
szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2PROX.DLL" )
szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2prox")
IF (szOle16NewVer$ > szOle16OldVer$) THEN
OLE2_16% = 1
END IF
szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "STORAGE.DLL" )
szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "storage")
IF (szOle16NewVer$ > szOle16OldVer$) THEN
OLE2_16% = 1
END IF
szOle16OldVer$ = GetVersionOfFile( DESTSYS$ + "OLE2CONV.DLL" )
szOle16NewVer$ = GetSectionKeyVersion("OleWindowsSystem", "ole2conv")
IF (szOle16NewVer$ > szOle16OldVer$) THEN
OL