home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
cyber.net 2
/
cybernet2.ISO
/
dkdemo
/
dksetup
/
dkgen.inc
< prev
next >
Wrap
Text File
|
1995-04-06
|
21KB
|
618 lines
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'dklang.inc'
CONST SOURCE_BINARIES_SUBDIR = "DKCODE"
CONST SOURCE_SETUP_SUBDIR = "DKSETUP"
CONST SETUP_INF_FILENAME = "SETUP.INF"
CONST CUIDLL_FILENAME = "mscuistf.dll"
CONST SETUP_INI_BINARIES_SECTION_NAME = "BIN"
CONST SETUP_INI_WING_BINARIES_NAME = "WinG Runtime"
CONST SETUP_INI_WING32_BINARIES_NAME = "WinG32"
CONST SETUP_INI_ACM_SECTION_NAME = "ACM Drivers"
CONST SETUP_INI_FONTS_SECTION_NAME = "Fonts"
CONST PRODUCT_INI_DIR_SECTION_NAME = "Directory"
CONST PRODUCT_INI_DIR_ENTRY_NAME = "Data"
CONST STR_COMPANYNAME = "DK Multimedia"
CONST STR_COPYRIGHT = "⌐ 1995 DK Multimedia"
CONST MINIMUM_DISK_SPACE = 2048 ' For Minimum install
' Procs
CONST PROC_HELP = "FHelpDlgProc"
DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (szEXE$, szParams$) AS INTEGER
DECLARE FUNCTION Ctl3dRegister LIB "CTL3D.DLL" (hInst%) AS INTEGER
DECLARE FUNCTION Ctl3dUnregister LIB "CTL3D.DLL" (hInst%) AS INTEGER
DECLARE FUNCTION Ctl3dAutoSubClass LIB "CTL3D.DLL" (hInst%) AS INTEGER
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 InstallTTF LIB "mscuistf.dll" (szTTF$) AS INTEGER
DECLARE FUNCTION InstallFON LIB "mscuistf.dll" (szFON$) AS INTEGER
DECLARE FUNCTION FIsVGA LIB "mscuistf.dll" AS INTEGER
DECLARE FUNCTION FIs256Colour LIB "mscuistf.dll" AS INTEGER
DECLARE FUNCTION Welcome() AS INTEGER
DECLARE FUNCTION TestSystem() AS INTEGER
DECLARE FUNCTION GetDiskSpaceNeeded(drive%) AS LONG
DECLARE SUB Initialise(prodName$, defInstallPath$, msgCaption$)
DECLARE SUB DeInitialise()
DECLARE SUB AskQuit()
DECLARE SUB BadPath()
DECLARE SUB NetworkDrive()
DECLARE SUB UpdateIndeoAVIDrivers()
DECLARE SUB UpdateWinGDrivers()
DECLARE SUB UpdateADPCMDrivers()
DECLARE SUB UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%)
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetRealWindowsSysDir AS STRING
DECLARE SUB UpdateWinG32 (szOrig$)
DECLARE SUB HandleRestart()
DECLARE SUB InitCommonInstall()
DECLARE SUB EndCommonInstall(appReadmeFile$, inRoot%)
DECLARE SUB InstallFonts()
' Error messages
CONST ERR_OK = 100
CONST ERR_EXITFAIL = 101
CONST ERR_WINVERFAIL = 102
CONST ERR_NODISKSPACE = 103
' Navigation messages
CONST NAV_FORWARD = 0
CONST NAV_BACK = 1
' Bitmap ID
CONST LOGO = 1
' Dialog ID's
CONST IDD_WELCOME = 100
CONST IDD_CUSTOMHELP = 106
CONST IDD_SPEED = 111
CONST IDD_ASKQUIT = 200
CONST IDD_DESTPATH = 300
CONST IDD_EXITFAILURE = 400
CONST IDD_EXITQUIT = 600
CONST IDD_EXITSUCCESS = 700
CONST IDD_APPHELP = 900
CONST IDD_DONENEWSYSSOFT = 1100
CONST IDD_DONENOSYSSOFT = 1800
CONST IDD_NEWSYSTEMSOFTWARE = 2300
CONST IDD_NEWADPCM = 2600
CONST IDD_WARNNOSYSSOFT = 3100
CONST IDD_MAILMAN = 1500
CONST IDD_CUSTOM = 6200
CONST IDD_BADPATH = 6400
CONST IDD_NEED31 = 6401
CONST IDD_NOMOUSE = 6402
CONST IDD_BADVGA = 6403
CONST IDD_NOT256 = 6404
CONST IDD_POORMACHINE = 6405
CONST IDD_AWFULMACHINE = 6406
CONST IDD_PATHHELP = 6407
CONST IDD_WHIZZHELP = 6408
CONST IDD_URKADPCM = 6409
CONST IDD_ADPCMHELP = 6410
CONST IDD_NODISKSPACE = 6411
CONST IDD_NETWORKDRIVE = 6412
GLOBAL szWinPath As String
GLOBAL szWinSysPath As String
GLOBAL szWinDrive As String
GLOBAL szSrcSetupPath As String
GLOBAL szSrcBinPath As String
GLOBAL szDestPath As String
GLOBAL szOldDestPath As String
GLOBAL szPengePath As String
GLOBAL szINFPath As String
GLOBAL szAppINIPath As String
GLOBAL szMsgCaption As String
GLOBAL szButton As String
GLOBAL szMinimalInstall As String
GLOBAL szAddPMItem As String
GLOBAL szExpressCustomChoice As String
GLOBAL fPreviousMode As Integer
GLOBAL fWillNotFit As Integer
GLOBAL fSystemUpdated As Integer
GLOBAL hDlg As Integer
GLOBAL dButton As Integer
GLOBAL dWinDrive As Integer
GLOBAL dDestDrive As Integer
GLOBAL dCursor As Integer
Sub InitCommonInstall() STATIC
AddToBillboardList CUIDLL_FILENAME, IDD_MAILMAN, "MailmanDlgProc", 2500
SetCopyGaugePosition -1, 150
fSystemUpdated = 0
End Sub
Sub EndCommonInstall(appReadmeFile$, inRoot%) STATIC
if RestartListEmpty = 0 or fSystemUpdated = 1 then
hDlg = IDD_DONENEWSYSSOFT
else
hDlg = IDD_DONENOSYSSOFT
end if
QuitLoop:
szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfoDlgProc", 0, "")
select case szButton
case "REACTIVATE"
goto QuitLoop
case "CONTINUE"
if inRoot% = 1 then
szReadMe$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appReadmeFile$)
else
szReadMe$ = MakePath(szSrcBinPath, appReadmeFile$)
end if
run "notepad.exe " + szReadMe$, NOWAIT
goto QuitLoop
case "BACK"
HandleRestart
case "EXIT"
if hDlg = IDD_DONENEWSYSSOFT then
dButton = DoMsgBox( STR_SYSMESSAGE, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
end if
end select
UIPop 1
End Sub
Sub Initialise(prodName$, defInstallPath$, msgCaption$) STATIC
ret% = Ctl3dRegister(HinstFrame())
ret% = Ctl3dAutoSubClass(HinstFrame())
szMsgCaption$ = msgCaption$
cursor% = ShowWaitCursor()
ClearCopyList
szWinSysPath = GetWindowsSysDir ()
szWinPath = GetWindowsDir ()
dWinDrive = asc(mid$(szWinPath, 1,1)) - asc("A")+1
szWinDrive = mid$(szWinPath, 1,1)
szSrcSetupPath = GetSymbolValue ("STF_SRCDIR")
szSrcBinPath = mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1) + SOURCE_BINARIES_SUBDIR
szDestPath = szWinDrive + ":" + defInstallPath$
SetTitle szMsgCaption$
SetBitmap CUIDLL_FILENAME, 1
SetAbout prodName$, STR_COPYRIGHT
fPreviousMode = SetBeepingMode (1)
fPreviousMode = SetDecompMode (1)
fPreviousMode = SetSilentMode (0)
szINFPath = GetSymbolValue("STF_SRCINFPATH")
if szINFPath = "" then
szINFPath = GetSymbolValue("STF_CWDDIR") + SETUP_INF_FILENAME
end if
ReadInfFile szINFPath
szExpressCustomChoice = "EXPRESS"
szMinimalInstall = "OFF"
szAddPMItem = "ON"
RestoreCursor(cursor%)
End Sub
Sub DeInitialise() STATIC
ret% = Ctl3dRegister(HinstFrame())
End Sub
Sub AskQuit() STATIC
begin:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_ASKQUIT, "FQuitDlgProc", 0, "")
select case szButton
case "REACTIVATE"
goto begin
case "EXIT"
error STFQUIT
case "CONTINUE"
UIPop 1
end select
End Sub
Sub BadPath() STATIC
begin:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_BADPATH, "FInfo0DlgProc", 0, "")
select case szButton
case "REACTIVATE"
goto begin
end select
UIPop 1
End Sub
Sub NetworkDrive() STATIC
begin:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_NETWORKDRIVE, "FInfo0DlgProc", 0, "")
select case szButton
case "REACTIVATE"
goto begin
end select
UIPop 1
End Sub
Function Welcome() STATIC As Integer
begin:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_WELCOME, "FInfoDlgProc", IDD_APPHELP, PROC_HELP)
select case szButton
case "REACTIVATE"
goto begin
case "CONTINUE"
UIPop 1
Welcome = NAV_FORWARD
case "EXIT"
AskQuit
goto begin
end select
End Function
Function TestSystem() STATIC As Integer
TestWinVer:
if GetWindowsMajorVersion() < 3 or (GetWindowsMajorVersion() = 3 and GetWindowsMinorVersion() < 10) then
TestWinVerDlgLoop:
szButton = UIStartDlg (CUIDLL_FILENAME, IDD_NEED31, "FInfoDlgProc"