'$include 'declares.inc'
'***************************************************************************
'*          CBT VARIBLES FOR CBTSETUP.INF
'***************************************************************************
global CBTAppName$
global CBTAppDir$
global CBTWinSysNeeded as long
global CBTOtherNeeded as long
global CBTUpdateNeeded as long
global CBTGroupTitle$
global CBTGroupFile$
global CBTFileTitle$
global CBTExeName$
global CBTExeTitle$
global CBTNumOfDisks%
global CBTUpdateDisk%
global DiskIDCtr%
'terry 10/11/94
global Resourceoption$
global CBTDiskIDFile$(1 to 10)
global CBTThreeDDialogs%
global CBTSourceDir$
global CBTDestDir$
global CBTIconName$
global CBTTotalNeeded as long
global OtherAvailable as long
global WinSysAvailable as long
global TotalAvailable as long
global CBTCourseName as string
'***************************************************************************
' REMOVAL PROGRAM VARIABLES
'***************************************************************************
global CBTRemoveDir$
global CBTNamDir$
global SaveNameFiles as integer




Global InstallInWinSysDir as integer
Global UpdateNeeded  as integer
Global GaugeHeight as integer
Global percenthwnd as integer
Global gaugehwnd as integer
Global percentageCopiedSoFar as integer
Global filesize as integer
Global TotalCopiedSoFar as long
Global hwndCB as integer
Global CBTInstallationType as integer
global CBTCustomDir as String
Global RegDirectory as string

Const CUSTOM = 0
Const DEFAULT = 1

'****************************************************************************

TYPE _FList
    FType as integer
    FDisk as integer
    FName as string
    FSize as long
    FCopy as integer
end type

TYPE VS_FIXEDFILEINFO
   wLength              AS INTEGER
   wValueLength         AS INTEGER
   szKey                AS STRING * 16
   dwSignature          AS LONG
   dwStrucVersion       AS LONG
   dwFileVersionMS      AS LONG
   dwFileVersionLS      AS LONG
   dwProductVersionMS   AS LONG
   dwProductVersionLS   AS LONG
   dwFileFlagsMask      AS LONG
   dwFileFlags          AS LONG
   dwFileOS             AS LONG
   dwFileType           AS LONG
   dwFileSubtype        AS LONG
   dwFileDateMS         AS LONG
   dwFileDateLS         AS LONG
END TYPE


Declare Sub      TBPaint3DBackground    lib "mstest" (b%, r%, t%, l%, hdc%, u3d%, border%)

Declare Sub      GetDriveInfo           (drive$, FreeSpace as pointer to long, ClusterSize as pointer to long)

Declare Sub      BuildHeaders
Declare Sub      BuildInstallList
Declare Sub      CenterWindow (hwnd%)
Declare Function ConfigureSystem () as integer
Declare Function CreateDir (Path$) as integer
Declare Function GetNextFile () as integer
Declare Function InsertDisk (Label$) as integer
Declare Function ReadInfFile () as integer
Declare Function VerifyDir (Path$, Pos%, fDelete%) as integer
declare function VerifyProgmanItem (buf$, Path$) as integer

'Dialog procs...

Declare Function ChooseSetupType    (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function ConfirmOptions     (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function CopyDis            (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function CopyDisWarn        (hwnd%, msg%, wparam%, lparam&) as integer

Declare Function CustomSetup        (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function DefDialogProc      (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function SetBasePath        (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function SetCPath           (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function SetProgPath        (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function SetSamplePath      (hwnd%, msg%, wparam%, lparam&) as integer
Declare Function Welcome            (hwnd%, msg%, wparam%, lparam&) as integer
declare function DlgInitSetup (hDlg%, msg%, wparam%, lparam&) as integer
declare function DlgInstall (hDlg%, msg%, wparam%, lparam&) as integer
declare function DlgWhereInstall (hDlg%, msg%, wparam%, lparam&) as integer
declare function DlgCancelDrive (hDlg%, msg%, wparam%, lparam&) as integer
declare function DlgUpdate  (hDlg%, msg%, wparam%, lparam&) as integer


declare Function CopyFile% (SourcePath$ ,  DestinationPath$ , SrcFilename$ ,  DestFileName$ )
declare Function FileExists% (path$)
declare Function CreateProgmanGroup%(hdlg%)
declare Function GetSetupInf%(sourcedir$)
declare Function CheckDriveExists%(drive$)
declare Function FillComboBox% (hwndCB%)

declare function lzinit% lib "lzexpand" (fptr%)
declare function lzopenfile% lib "lzexpand" (filename$, lpof as OFSTRUCT, style as integer)
declare function copylzfile& lib "lzexpand" (source%, destination%)
declare sub      lzclose lib "lzexpand" (fptr%)
declare sub      lzdone lib "lzexpand" ()
Declare Function DiskSpaceFree Lib "SETUPKIT.DLL" () As Long

declare sub      PromptForDisk(hdlg%)
declare sub      PromptForUpdateDisk(hdlg%)
declare Function Copyfiles(hdlg%) as integer
declare Function GetDestFileName$(filename$)
Declare Function CheckDriveCapacity%(hdlg%)
declare function getfilesize(filename$) as long
Declare Function DlgWelcomeHelp(hwnd%, msg%, wparam%, lparam&) as integer

Declare Function CopyGauge(hwnd%, msg%, wparam%, lparam&) as integer

Declare Sub      RGBWash (hdc as integer, lprc as RECT)
Declare Function WndFunc (hwnd%, msg%, wparam%, lparam&) as long

Declare Function dlgRemovepath(hwnd%, msg%, wparam%, lparam&) as integer
Declare Function dlgremoveexit(hwnd%, msg%, wparam%, lparam&) as integer
Declare Function DlgNAMsave(hwnd%, msg%, wparam%, lparam&) as integer

global ResourceFile$
global Threed%
global DestDrive$
global DestPath$
global WinDir$
global WinSysDir$

Global BinDest$
Global BasePath$
Global DestFile$
Global ErrMsg$
Global IncDest$
Global Message$
Global Path$
Global WindowsDir$

Global ErrNum%
Global ErrorFlag%
Global fWin30%
Global fWin31%
Global hBitmap%
Global hCursor%
Global hbr%
Global hInstDll%
Global NumFiles%
Global RetVal%
Global SampCt%
Global tmp%

Global DiskFree&
Global IncSize&
Global ProgSize&
Global SampSize&

Const WM_COPYFILE = WM_USER + 1000


'****************************************************************************
'*  Messages
'****************************************************************************

Const InitialiseMsg$ = "Initialising Setup. Please Wait ..."
Const MsgCreatingProgman$ = "Setup is now updating your Program Manager group to include "
Const MsgDriveDoesNotExist$ = "The specified drive does not exist."
Const MsgWaitInstall$ = "Please Wait, getting ready to copy files."
Const SetupCaption$ = "CBT Remove"
Const CBTErrorDialog$ = "Error reading the resource file. "
Const CBTResFileNotFound$ = "Resource file not found"
Const OPT_CHECKED = 1
Const OPT_UNCHECKED = 0


Const ErrAutoexec$      = "An error occurred while modifing your AUTOEXEC.BAT file.  You must add the Microsoft Test directory to your path before using Microsoft Test 2.00."
Const ErrBadPath$       = "The directory you typed is invalid or incomplete.  Please type a full path with drive letter; for example '"
Const ErrCantCreateDir$ = "Cannot create the directory" + chr$ (13)
Const ErrCantOpen$      = "Cannot open the file " + chr$ (34)
Const ErrCopyFail$      = "An error occurred while copying "
Const ErrFileInUse$     = "Setup could not update the following file because it is in use by another program.  Stop all other Windows programs and retry." + chr$ (13) + chr$ (13)
Const ErrFileReqd$      = chr$ (34) + ".  This file is required to install Microsoft Test."
Const ErrInsertDisk$    = "Please insert the diskette labled:" + chr$ (13)
Const ErrInsuffSpace$   = "The drive you have selected does not have enough free space to install the options specified."
Const ErrInsuffSpaceWinSys$   = "There is insufficent space to install the windows resource files in the system directory"
Const ErrNameReqd$      = "You must enter a name"
Const ErrNoHeader$      = "You header files were not created."
Const ErrNoProgmanDDE$  = "Setup was unable to communicate with the Program Manager to add the Microsoft Test items."
Const ErrOtherVxd$      = "Setup has detected a another copy of mstest.386 installed.  Do you want to delete this entry and install a new driver?"
Const ErrQueryExit$     = "Are you sure you want to exit setup?"
Const ErrSysFileIgnore$ = "You have chosen to not copy a windows system file.  This may cause Microsoft Test to run incorrectly or not at all.  Are you sure you want to skip this file?"
Const ErrSysIniRdonly$  = "Setup needs to install a new 'system.ini file, but your current version is marked Read Only.  Do you want Setup to save the new file in 'system.new?"
Const ErrUnknown$       = "Setup has encountered an unrecoverable error and cannot continue.  Restart windows and try again."
Const ErrHelpFile$      = "Setup has encountered an error building the windows SDK help file.  You may be low on disk space."



Const NumShades     = 64
Const CANTOPENSRC   = -1
Const CANTOPENDEST  = -2
Const FILEINUSE     = -3


' copy protection stuff

'Declare Sub SetSeed Lib "CBTCPROT.DLL" (ByVal Seed%)
'Declare Sub SetupArray Lib "CBTCPROT.DLL" ()
'Declare Function ReturnNext% Lib "CBTCPROT.DLL" ()
'Declare Function ReturnCRC% Lib "CBTCPROT.DLL" (ByVal Seed%, ByVal Length%, ByVal Strng$)
'Declare Function Splitter% Lib "CBTCPROT.DLL" (ByVal Strng$, Seed&, Yr%, Mnth%, Dy%, ProdCode%, Licenses%, CRC&)
'Declare Sub Combiner Lib "CBTCPROT.DLL" (ByVal Strng$, ByVal Seed&, ByVal Yr%, ByVal Mnth%, ByVal Dy%, ByVal ProdCode%, ByVal Licenses%)
'Declare Function UpDSplitter% Lib "CBTCPROT.DLL" (ByVal Strng$, Seed&, Yr%, Mnth%, Dy%, ProdCode%, Licenses%, CRC&, ByVal V1%, ByVal V2%)
'Declare Sub UpDCombiner Lib "CBTCPROT.DLL" (ByVal Strng$, ByVal Seed&, ByVal Yr%, ByVal Mnth%, ByVal Dy%, ByVal ProdCode%, ByVal Licenses%, ByVal V1%, ByVal V2%)
'Declare Function TrueName% Lib "CBTCPROT.DLL" (ByVal Source$, ByVal TrueName$)
'Declare Sub InitThePreamble Lib "CBTCPROT.DLL" (PreStart As Any, ByVal D%, ByVal M%, ByVal Y%, ByVal H%, ByVal Mint%, ByVal S%, ByVal PN%, ByVal Path$, CRC1%)
'Declare Function SplitThePreamble% Lib "CBTCPROT.DLL" (ByVal Seed%, PreStart As Any, D%, M%, Y%, H%, Mint%, S%, PN%, ByVal ThePath$, CRC1%)
'Declare Function IncInteger% Lib "CBTCPROT.DLL" (ByVal I%)
'Declare Function DecInteger% Lib "CBTCPROT.DLL" (ByVal I%)
'Declare Function UIntAdd% Lib "CBTCPROT.DLL" (ByVal I%, ByVal J%)

' These global variables hold the serial number info
Global TheSeed&, TheDay%, TheYear%, TheMonth%, TheProduct%, TheLicenses%, TheCRC&
' This is the serial number
Global TheSerial$
' This is true if a valid serial number has been entered...
Global ValidSerial%

' This structure contains the information which goes at the
' front of the slot file...

Type PreambleStruct
    FTime As Integer
    FDate As Integer
    ProdNo As Integer
    FPath As String * 130
    CRC As Integer
End Type
Type SlotInfo
    Slots As Integer
    FreeSlots As Integer
    FirstFree As Integer
    SerialNumbers As Integer
End Type

Type ASlot
    FlagMonth As Integer
    HourMinDay As Integer
End Type

Global SerialNumbers(255) As String * 11   ' This will hold all the serial numbers
Global SerialCount%    ' The count of serial numbers
Global PrestartProduct% ' The product code in Prestart

'Terry 15/11/94
global Username as string
global CompanyName as string
global Serial as string

'Terry 17/11/94
global Nam as string
global compnam as string
global serials as string
global NamVB as string
global compnamVB as string
global serialsVB as string
