'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUITSETUP = 200
CONST ASKQUITNOTHING = 201
CONST ASKQUITQTW = 202
CONST ASKEXISTSQTWDIR = 300
CONST ASKEXISTSQTWPROD = 301
CONST ASKEXISTSOLDQTWPROD = 302
CONST DESTPATHQTW = 400
CONST EXITFAILURE = 500
CONST EXITQUIT = 600
CONST EXITSUCCESSFFS = 700
CONST EXITSUCCESSQTW = 701
CONST EXITSUCCESSQTWREBOOT = 702
CONST PRODHELP = 900
CONST MODELESS = 5000
CONST CUSTINST = 6200
CONST TOOBIG = 6300
CONST BADPATH = 6400
CONST MINREQUIRED = 6500
''Bitmap IDs
CONST IDC_BM0 = 600
CONST PRODUCT = 1
CONST FILEVER = 0
''File Types
CONST GROUP = 1
CONST QTW = 2
'' actual amount plus 10%
CONST GROUPCOST = 10240
CONST QTWCOST = 2329118
GLOBAL CUIDLL$
GLOBAL WinDir$
GLOBAL WinSysDir$
GLOBAL DEST$ '' Default destination directory.
GLOBAL WINDRIVE$ '' Windows drive letter.
GLOBAL cost&
GLOBAL cost1&
GLOBAL free&
GLOBAL free1&
GLOBAL CursorSave%
''Dialog list symbol names
GLOBAL CHECKSTATES$
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
GLOBAL REQUIREDTEXT$
GLOBAL HDLIST$
'' defined functions
DECLARE SUB AddOptFilesToCopyList
DECLARE SUB RecalcOptFiles (ftype%)
DECLARE SUB RecalcPath
DECLARE SUB SetDriveStatus
DECLARE FUNCTION MakePath(szDir$, szFile$) AS STRING
Declare FUNCTION MakeDirPath (szDir$) AS STRING
DECLARE FUNCTION RemoveSlash(szDir$) AS STRING
Declare Function CheckFileForDateAndVersion(szFile$, szDate$, szVersion$) As String
Declare Sub AskExit(nDialog%)
Declare Sub AskQuit(nDialog%)
Declare Sub GetPath
Declare Sub InstallQTWFiles
Declare Sub ModifyIniForQTW
Declare Sub InstallGroup
Declare Sub BadDirPath
Declare Sub NotEnoughRoom
Declare Sub WelcomeToSetup
Declare Sub MinimumRequired
Declare Sub ModifyAutoexec
Declare Sub CustomInstall
Declare Function GetProcessor() As Integer
Declare Function MeetsMinRequired() As Integer
'' external procedures
Declare Function MaximizeWindow LIB "mscuistf.dll" (hwnd%) As Integer
Declare Function DoMemManInfo LIB "mscuistf.dll" (item%) As Integer
Declare Function SetTo256Min LIB "mscuistf.dll" () As Integer
Declare Function GetVerInfo LIB "mscuistf.dll" (szPath$, szVer$, Product%) As Integer
DECLARE FUNCTION GetModuleHandle LIB "kernel" (szModName$) AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
DECLARE FUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER
Declare Function sndPlaySound Lib "MMSystem" (lpsound As Any, flag As Integer) As Integer
Declare Function waveOutGetNumDevs Lib "MMSystem" () As Integer
Declare Function GetDC Lib "User" (hWnd%) As Integer
Declare Function GetDeskTopWindow Lib "User" () As Integer
Declare Function GetDeviceCaps Lib "GDI" (hDC%, nIndex%) As Integer
DECLARE FUNCTION GetPrivateProfileString LIB "Kernel" (lpApplicationName As String, lpKeyName As String, lpDefault As String, lpReturnedString As String, nSize As Integer, lpFileName As String) As Integer
Declare Function GlobalCompact Lib "kernel" (flag&) As Long
Declare Function GetFreeSpace Lib "kernel" (flag%) As Long
Declare Function GetFreeSystemResources Lib "User" (fuSysResource As Integer) As Integer
Declare Function ReleaseDC Lib "User" (hWnd As Integer, hDC As Integer) As Integer
Const SM_MOUSEPRESENT = 19
INIT:
CUIDLL$ = "mscuistf.dll" '' custom user interface dll
HELPPROC$ = "FHelpDlgProc" '' Help dialog procedure
hwnd% = HwndFrame()
i% = MaximizeWindow(hwnd%) '' maximize the main window