home *** CD-ROM | disk | FTP | other *** search
Wrap
'************************************************************************** '* Sampler Setup '************************************************************************** '$INCLUDE 'setupapi.inc' '$INCLUDE 'msdetect.inc' '' '$INCLUDE 'msshared.inc' 'OPTION EXPLICIT DECLARE FUNCTION FIsVGA LIB "mscuistf.dll" AS INTEGER DECLARE FUNCTION FIs256Colour LIB "mscuistf.dll" AS INTEGER ''Dialog ID's CONST WELCOME = 100 CONST CUSTOMHELP = 106 CONST SPEED = 111 CONST BILLBOARD = 113 CONST ASKQUIT = 200 CONST DESTPATH = 300 CONST EXITFAILURE = 400 CONST EXITQUIT = 600 CONST EXITSUCCESS = 700 CONST OPTIONS = 800 CONST APPHELP = 900 CONST DONENEWSYSSOFT = 1100 CONST MAILMAN = 1500 CONST DONENOSYSSOFT = 1800 CONST NEWSYSTEMSOFTWARE = 2300 CONST NEWADPCM = 2600 CONST WARNNOSYSSOFT = 3100 CONST PROGMANGRP = 3742 CONST CUSTOM = 6200 CONST NOSPACE = 6300 CONST BADPATH = 6400 CONST NEED31 = 6401 CONST NOMOUSE = 6402 CONST BADVGA = 6403 CONST NOT256 = 6404 CONST POORMACHINE = 6405 CONST AWFULMACHINE = 6406 CONST PATHHELP = 6407 CONST WHIZZHELP = 6408 CONST URKADPCM = 6409 CONST ADPCMHELP = 6410 ''Bitmap ID CONST LOGO = 1 GLOBAL CURSOR% '' Old mouse cursor state GLOBAL DEST$ '' Default destination directory. GLOBAL ProdSrc$, dirCode$, dirSetup$ GLOBAL SysSrc$ GLOBAL SRCDIR$ '' Source Drive GLOBAL FussyUser$ '' "1" for express installation, "2" for custom. GLOBAL MINIMAL$ '' "ON" for minimal installation, "OFF" for normal GLOBAL PROGMAN$ '' "ON" for invoke program manager, "OFF" otherwise GLOBAL CUSTCHECK$ '' the state of all Custom dialogue check boxes GLOBAL PROGGRP$ '' Name of Program Manager Group GLOBAL PRODNAME$ '' Product Name GLOBAL COMPNAME$ '' Company Name GLOBAL WINSYSDIR$ '' Windows System Driver GLOBAL DESTDRIVE$ '' Destination drive GLOBAL WINDRIVE$ '' Windows drive (system directory) GLOBAL WinDir$ '' Windows directory GLOBAL DD% '' Integer DESTDRIVE$ GLOBAL WD% '' Integer WINDRIVE$ GLOBAL SizeReq& '' Total installation size? GLOBAL IcoFile$ GLOBAL CrapLng% GLOBAL Junk& GLOBAL CUIDLL$ GLOBAL HELPPROC$ GLOBAL SZINF$ GLOBAL OPTCUR$ GLOBAL I% GLOBAL SZ$, Key$, SrcDrive$, SrcPengeDir$ GLOBAL VerNew$ GLOBAL VerOld$ GLOBAL dlg% GLOBAL INI$ GLOBAL INSTRINI$ GLOBAL Count%, RebootMsg%, uLen% GLOBAL OLDNTH&, NEWNTH& GLOBAL OldYear%, NewYear%, OldMonth%, NewMonth%, OldDay%, NewDay% GLOBAL ExeFile$, PengeFile$, IniFile$, Section$, Moi$ DECLARE SUB Install DECLARE FUNCTION IsVersionLater (VersionOld$, VersionNew$) AS INTEGER DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING DECLARE FUNCTION IsDateLater (DateOld$, DateNew$) AS INTEGER '****************************************************************** '** Declare the funcitons in USER.EXE we need to register a '** unique message identifier and needed to post that message '** to the NSETUP.EXE program. See the Windows api documentation '** for additional information on these functions. '****************************************************************** DECLARE FUNCTION PostMessage LIB "user" (hwnd%, msg%, wparam%, lparam&) AS INTEGER INIT: Cursor% = ShowWaitCursor () dirCode$ = "" dirSetup$ = "DKSETUP" CUIDLL$ = "mscuistf.dll" ''Custom user interface dll HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure PRODNAME$ = "Eyewitness Encyclopedia of Science" COMPNAME$ = "DK Multimedia" PROGGRP$=COMPNAME$+" Samples" ExeFile$ = "ees.exe" IcoFile$ = "science.ico" PengeFile$ = "" IniFile$ = "" Section$ = "Sampler" Moi$ = ProdName$ + " Setup" WinSysDir$ = GetWindowsSysDir () WinDir$ = GetWindowsDir () WINDRIVE$ = MID$ (GetWindowsSysDir (), 1, 1) INSTRINI$ = MakePath(GetWindowsDir(),IniFile$) SrcDir$ = GetSymbolValue ("STF_SRCDIR") uLen% = Len (SrcDir$) - Len (dirSetup$) ProdSrc$ = Mid$ (SrcDir$, 1, uLen% - 1) + dirCode$ SysSrc$ = SrcDir$ SetAbout PRODNAME$, "⌐ 1994 " + COMPNAME$ CrapLng% = SetBeepingMode (1) SetBitmap CUIDLL$, LOGO SetTitle PRODNAME$ + " Setup" CrapLng% = SetDecompMode (1) szInf$ = GetSymbolValue("STF_SRCINFPATH") IF szInf$ = "" THEN szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF" END IF ReadInfFile szInf$ OPTCUR$ = "1" DEST$ = "C:\" MINIMAL$ = "OFF" PROGMAN$ = "ON" '*************************************************************** '** Here we go registering the message so we can communicate '** with NSETUP.EXE. '*************************************************************** WELCOME: RestoreCursor (Cursor%) sz$="Welcome to the Dorling Kindersley CD-ROM Demonstration Setup program. This program updates Program Manager " sz$=sz$+"by adding icons to the "+PROGGRP$+" group for the demonstrations on the CD-ROM. Please ensure " sz$=sz$+"Program Manager is running. Do you wish to continue?" i% = DoMsgBox (sz$,Moi$,MB_ICONQUESTION+MB_YESNO) if i% = IDNO then end end if TEST31: Cursor% = ShowWaitCursor () IF GetWindowsMajorVersion () > 3 THEN GOTO TESTVGA END IF IF GetWindowsMajorVersion () < 3 THEN GOTO GORDONBENNETT END IF IF GetWindowsMinorVersion () >= 10 THEN GOTO TESTVGA END IF GORDONBENNETT: RestoreCursor (Cursor%) sz$="This demonstration requires Windows version 3.1 or later." i% = DoMsgBox (sz$,Moi$,MB_ICONSTOP+MB_OK) End TESTVGA: IF GetScreenHeight () >= 480 AND GetScreenWidth () >= 640 THEN GOTO TESTMOUSE ELSE RestoreCursor (Cursor%) sz$="This demonstration requires a screen with a resolution of at least 640x480. Please install appropriate " sz$=sz$+"screen drivers." i% = DoMsgBox (sz$,Moi$,MB_ICONSTOP+MB_OK) End END IF TESTMOUSE: IF HasMouseInstalled() > 0 THEN GOTO TESTCOLOUR ELSE RestoreCursor (Cursor%) sz$="This demonstration requires a mouse or alternative pointing device." i% = DoMsgBox (sz$,Moi$,MB_ICONSTOP+MB_OK) End END IF TESTCOLOUR: IF FIs256Colour() > 0 THEN GOTO WHIZZO ELSE RestoreCursor (Cursor%) sz$="This demonstration is designed for a system with at least 256 colors. If you wish to " sz$=sz$+"appreciate it fully, install appropriate screen drivers. Do you wish to continue?" i% = DoMsgBox (sz$,Moi$,MB_ICONQUESTION+MB_YESNO) if i%=IDNO then End end if END IF WHIZZO: CreateProgmanGroup PROGGRP$, "", cmoNone ShowProgmanGroup PROGGRP$, 1, cmoNone sz$ = MakePath(ProdSrc$,IcoFile$) + ",,,,"+ProdSrc$ szInf$ = MakePath (ProdSrc$,ExeFile$) CreateProgmanItem PROGGRP$, PRODNAME$, szInf$, sz$, cmoOverwrite sz$="Setup has added an icon to Program Manager. To run the sample, just double click on the appropriate icon " sz$=sz$+"in Program Manager. When the program is running, click on Start to see the demonstration. Please disable " sz$=sz$+"all screen savers before running the demonstration." i% = DoMsgBox (sz$,Moi$,MB_OK) sz$="If you have not already installed Apple's QuickTime on your system, please do so now. You will find a copy " sz$=sz$+"in the QT subdirectory. Run the version of SETUP.EXE you find there." i% = DoMsgBox (sz$,Moi$,MB_OK) QUIT: End ERRQUIT: i% = DoMsgBox("The setup sources were corrupted. You may be able to correct the problem by using SCANDISK to fix your hard disk.", Moi$, MB_OK+MB_TASKMODAL+MB_ICONHAND) END '** '** 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