File:  [WindowsNT SDKs] / mstools / win32s / setup / 32sinst.mst
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:22:54 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntsdk-oct-1992, HEAD
Microsoft Windows NT Build 328 10-12-1992

'**************************************************************************
'*                       MSSetup Toolkit Sample 1
'**************************************************************************

'' $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 FREECELLINST  = 1400
CONST FREECELLPATH  = 1500
CONST HELPFREECELL  = 1600


''Bitmap ID
CONST LOGO = 1

GLOBAL DESTSYS$      ''Windows\System directory.
GLOBAL DEST32S$      ''Windows\System\Win32s directory
GLOBAL DESTFREE$     ''Freecell directory

DECLARE SUB Install
DECLARE SUB UpdateSystemIni
DECLARE SUB RebootSystem
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" (arg1$) AS INTEGER

INIT:
    CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
    HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure

    SetBitmap CUIDLL$, LOGO
    SetTitle "Microsoft Win32s Setup Program"

    szInf$ = GetSymbolValue("STF_SRCINFPATH")
    IF szInf$ = "" THEN
	szInf$ = GetSymbolValue("STF_CWDDIR") + "32sinst.inf"
    END IF
    ReadInfFile szInf$

    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:
    IF GetWindowsMajorVersion < 3 THEN
	ExitCode% = EXITFAILNOTWIN31
	GOTO QUIT
    END IF
    IF GetWindowsMajorVersion = 3 AND GetWindowsMinorVersion < 1 THEN
	ExitCode% = EXITFAILNOTWIN31
	GOTO QUIT
    END IF
    IF GetWindowsMode < 2  THEN     '' Not Enhanced or Windows NT
	ExitCode% = EXITFAILNOTENH
	GOTO QUIT
    END IF
    ExitCode% = EXITSUCCESS


WELCOME:
    sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", HELPWELCOME, HELPPROC$)
    IF sz$ = "CONTINUE" THEN
	UIPop 1
    ELSE
	GOSUB ASKQUIT
	GOTO WELCOME
	END IF


GETWIN32SPATH:
    SetSymbolValue "EditTextIn", DESTSYS$
    SetSymbolValue "EditFocus", "END"

GETPATHL1:
    sz$ = UIStartDlg(CUIDLL$, VERPATH, "FDispDlgProc", HELPWELCOME, HELPPROC$)

    IF sz$ = "CONTINUE" THEN
	IF IsDirWritable(DESTSYS$) = 0 THEN
	    GOSUB BADPATH
	    GOTO GETPATHL1
	END IF
	UIPop 1
    ELSEIF sz$ = "REACTIVATE" THEN
	GOTO GETPATHL1
    ELSEIF sz$ = "BACK" THEN
	UIPop 1
	GOTO WELCOME
    ELSE
	GOSUB ASKQUIT
	GOTO GETPATHL1
    END IF

COPYFILES:

    CreateDir DEST32S$, cmoNone
    OpenLogFile MakePath(DEST32S$, "W32SSET.LOG"), 0

    Install
    UpdateSystemIni

    CloseLogFile

FREECELL:
    sz$ = UIStartDlg(CUIDLL$, FREECELLINST, "FInfoDlgProc",0, "")
    IF sz$ = "CONTINUE" THEN
	UIPop 1
    ELSE
	GOTO QUIT
    END IF

GETFREEPATH:
    DESTFREE$ = MID$(DESTSYS$,1,3) + "WIN32APP\FREECELL\"
    SetSymbolValue "EditTextIn", DESTFREE$
    SetSymbolValue "EditFocus", "END"

GETFREEPATHL1:
    sz$ = UIStartDlg(CUIDLL$, FREECELLPATH, "FEditDlgProc", HELPFREECELL, HELPPROC$)

    IF sz$ = "CONTINUE" THEN
	DESTFREE$ = GetSymbolValue("EditTextOut")

    ''Validate new path.
	IF IsDirWritable(DESTFREE$) = 0 THEN
		GOSUB BADPATH
		GOTO GETFREEPATHL1
	END IF
	UIPop 1

	GOTO COPYFREECELL
    ELSEIF sz$ = "REACTIVATE" THEN
	GOTO GETFREEPATHL1
    ELSEIF sz$ = "EXIT" THEN
	UIPop 1
	GOTO QUIT
    END IF

COPYFREECELL:
    ClearCopyList
    CreateDir DESTFREE$, cmoNone

    OpenLogFile MakePath(DEST32S$, "SETUP.LOG"), 0

    SrcDir$ = GetSymbolValue("STF_SRCDIR")
    WriteToLogFile ""
    WriteToLogFile "  User chose as destination directory: '" + DESTFREE$ + "'"
    WriteToLogFile ""
    WriteToLogFile "May have had to create the directory: " + DESTFREE$
    WriteToLogFile ""

    AddSectionFilesToCopyList "Win32appFreecell", SrcDir$, DESTFREE$
    CopyFilesInCopyList

    CreateProgmanGroup "Win32 Applications", "", cmoNone
    ShowProgmanGroup   "Win32 Applications", 1, cmoNone
    CreateProgmanItem  "Win32 Applications", "Freecell", DESTFREE$ + "FREECELL.EXE", "", cmoOverwrite

    CloseLogFile



QUIT:
    ON ERROR GOTO ERRQUIT
    IF ERR = 0 THEN
	dlg% = ExitCode%
    ELSEIF ERR = STFQUIT THEN
	dlg% = EXITQUIT
    ELSE
	dlg% = EXITFAILURE
    END IF

QUITL1:
    sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
    IF sz$ = "REACTIVATE" THEN
	GOTO QUITL1
    END IF
    UIPop 1

    RebootSystem

    END

ERRQUIT:
    i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
    END



BADPATH:
    sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
    IF sz$ = "REACTIVATE" THEN
	GOTO BADPATH
    END IF
    UIPop 1
    RETURN



  ASKQUIT:
    sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")

    IF sz$ = "EXIT" THEN
	UIPopAll
	ERROR STFQUIT
    ELSEIF sz$ = "REACTIVATE" THEN
	GOTO ASKQUIT
    ELSE
	UIPop 1
    END IF
    RETURN



'**
'** Purpose:
'**     Builds the copy list and performs all installation operations.
'** Arguments:
'**     none.
'** Returns:
'**     none.
'*************************************************************************
SUB Install STATIC

    SrcDir$ = GetSymbolValue("STF_SRCDIR")

    WriteToLogFile ""
    WriteToLogFile "  User chose as destination directory: '" + DESTSYS$ + "'"
    WriteToLogFile ""
    WriteToLogFile "May have had to create the directory: " + DESTSYS$
    WriteToLogFile ""

    AddSectionFilesToCopyList "WindowsSystem", SrcDir$, DESTSYS$
    AddSectionFilesToCopyList "WindowsSystemWin32s", SrcDir$, DESTSYS$ + "WIN32S\"

    t% = RestartWindows( GetWindowsSysDir() + "OLECLI.DLL" )
    SetRestartDir GetWindowsDir()
    CopyFilesInCopyList

END SUB

SUB UpdateSystemIni STATIC

    VxDPath$ = DEST32S$ + "W32S.386"
    SystemIniPath$ = GetWindowsDir()

    t% = MakeSystemIni(SystemIniPath$, VxdPath$)

END SUB

SUB RebootSystem STATIC

    i% = RestartListEmpty()
    i% = ExitExecRestart()

END SUB


'**
'** Purpose:
'**     Appends a file name to the end of a directory path,
'**     inserting a backslash character as needed.
'** Arguments:
'**     szDir$  - full directory path (with optional ending "\")
'**     szFile$ - filename to append to directory
'** Returns:
'**     Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
    IF szDir$ = "" THEN
	MakePath = szFile$
    ELSEIF szFile$ = "" THEN
	MakePath = szDir$
    ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
	MakePath = szDir$ + szFile$
    ELSE
	MakePath = szDir$ + "\" + szFile$
    END IF
END FUNCTION

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.