home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazin 1996 March
/
CD_03_96.BIN
/
tcdemo
/
tcdemo.mst
< prev
next >
Wrap
Text File
|
1996-02-01
|
5KB
|
168 lines
'**************************************************************************
'* THiNK - CROSS Setup Program
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
''Dialog ID's
CONST W1 = 100
CONST W2 = 200
CONST W3 = 300
CONST W4 = 1400
CONST W5 = 500
CONST W6 = 600
CONST APPHELP = 900
CONST WS_VISIBLE =&H10000000
CONST WS_BORDER =&H00800000
CONST WS_CLIPCHILDREN =&H02000000
CONST GWL_STYLE = -16
CONST SW_SHOWMAXIMIZED = 3
''File Types
''Bitmap ID
CONST LOGO = 1
GLOBAL FILEDIALOG ''File path dialog ID
GLOBAL DEST$ ''Default destination directory.
GLOBAL instdir$
GLOBAL CHECKSTATES$ ''Dialog list symbol names
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL lang%
GLOBAL TMPDEST$ '' tmpfile destination
GLOBAL OPTCUR$
GLOBAL bInstallDVA%
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetRealWindowsSysDir AS STRING
DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
DECLARE SUB RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$)
DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%, iShow%) AS INTEGER
DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
INIT:
hWnd%=HwndFrame()
i1&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
j1%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
bInstallDVA% = 0
OPTCUR$ ="1"
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
instdir$ = "C:\THINK_X"
SetBitmap CUIDLL$, LOGO
''SetTitle "Th!nk Cross Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "tcdemo.inf"
END IF
ReadInfFile szInf$
lang%=1
sz$ = UIStartDlg(CUIDLL$,W1+lang%, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOTO QUIT
END IF
GETPATH:
SetSymbolValue "EditTextIn", instdir$
SetSymbolValue "EditFocus", "END"
PATH:
sz$ = UIStartDlg(CUIDLL$,W3+lang%, "FEditDlgProc", APPHELP, HELPPROC$)
instdir$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(instdir$) = 0 THEN
GOSUB BADPATH
GOTO PATH
END IF
UIPop 1
ELSE
GOTO QUIT
END IF
INSTALL:
SrcDir$=GetSymbolValue("STF_SRCDIR")
CreateDir instdir$, cmoNone
AddSectionFilesToCopyList "Files", SrcDir$, instdir$
DEST$ = GetWindowsSysDir
IF OnWin3x() = 1 THEN
AddSectionFilesToCopyList "system", SrcDir$, DEST$
IF VflatdPresent() = 0 THEN
CreateSysIniKeyValue GetWindowsDir + "system.ini", "386Enh", "device", GetWindowsSysDir+"dva.386", cmoOverwrite
bInstallDVA% = 1
END IF
END IF
AddSectionFilesToCopyList "system",SrcDir$,DEST$
CopyFilesInCopyList
CreateProgmanGroup "JoWooD", "", cmoNone
ShowProgmanGroup "JoWooD", 1, cmoNone
CreateProgmanItem "JoWooD", "THiNK-X for Windows DEMO", instdir$+"\tcdemo.exe", "", cmoOverwrite
REA:
sz$ = UIStartDlg(CUIDLL$,W6+lang%,"FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
END IF
QUIT:
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, W4+lang%, "FInfo0DlgProc", 0, "")
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOTO QUIT
END IF
RETURN
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
FUNCTION GetRealWindowsSysDir STATIC AS STRING
szBuf$ = string$(260, 32)
cbBuf% = GetRealSystemDir(szBuf$, 260)
IF cbBuf% = 0 THEN
ERROR STFERR
ELSE
IF cbBuf% > 259 THEN
res% = DoMsgBox("Buffer Overflow", "MS-Setup Error", MB_ICONHAND+MB_OK)
ERROR STFERR
END IF
szBuf$ = RTRIM$(szBuf$)
IF MID$(szBuf$, 1, 1) = "\" THEN
szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
ELSEIF MID$(szBuf$, 2, 1) <> ":" THEN
szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
END IF
IF MID$(szBuf$, LEN(szBuf$), 1) <> "\" THEN
szBuf$ = szBuf$ + "\"
END IF
GetRealWindowsSysDir = szBuf$
END IF
szBuf$ = ""
END FUNCTION