home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
My First Incredible, Amazing Dictionary
/
DKMMMFD.iso
/
dksetup
/
dkgen.inc
< prev
next >
Wrap
Text File
|
1995-05-02
|
23KB
|
662 lines
'12/03/95 Alternative function added, readme icon has shortened name
'$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 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 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 SUB UpdateProgramManagerAlt(prodName$, readmeName$, 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%)
' 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
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 = ucase$(GetWindowsSysDir())
szWinPath = ucase$(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"
fSystemUpdated = 0
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", IDD_AWFULMACHINE, PROC_HELP)
select case szButton
case "REACTIVATE"
goto TestWinVerDlgLoop
case "BACK"
UIPop 1
TestSystem = NAV_BACK
goto back
case "CONTINUE"
UIPop 1
goto TestVGA
case "EXIT"
AskQuit
goto TestWinVerDlgLoop
end select
end if
TestVGA:
if GetScreenWidth () < 640 or GetScreenHeight () < 480 then
TestVGADlgLoop:
szButton = UIStartDlg (CUIDLL_FILENAME, IDD_BADVGA, "FInfoDlgProc", IDD_AWFULMACHINE, PROC_HELP)
select case szButton
case "REACTIVATE"
goto TestVGADlgLoop
case "BACK"
UIPop 1
TestSystem = NAV_BACK
goto back
case "CONTINUE"
UIPop 1
goto TestMouse
case "EXIT"
AskQuit
goto TestVGADlgLoop
end select
end if
TestMouse:
if HasMouseInstalled() = false then
TestMouseDlgLoop:
szButton = UIStartDlg (CUIDLL_FILENAME, IDD_NOMOUSE, "FInfoDlgProc", IDD_AWFULMACHINE, PROC_HELP)
select case szButton
case "REACTIVATE"
goto TestMouseDlgLoop
case "BACK"
UIPop 1
TestSystem = NAV_BACK
case "CONTINUE"
UIPop 1
goto TestColour
case "EXIT"
AskQuit
goto TestMouseDlgLoop
end select
end if
TestColour:
if FIs256Colour() = false then
TestColourDlgLoop:
szButton = UIStartDlg (CUIDLL_FILENAME, IDD_NOT256, "FInfoDlgProc", IDD_POORMACHINE, PROC_HELP)
select case szButton
case "REACTIVATE"
goto TestColourDlgLoop
case "BACK"
UIPop 1
TestSystem = NAV_BACK
goto back
case "CONTINUE"
UIPop 1
TestSystem = NAV_FORWARD
case "EXIT"
AskQuit
goto TestColourDlgLoop
end select
end if
back:
End Function
'**
'** 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
Sub HandleRestart() STATIC
' Check there are system files to install AND check if Windows v3.1 or greater
if RestartListEmpty = 0 and GetWindowsMajorVersion >= 3 and GetWindowsMajorVersion >= 1 then
dButton = DoMsgBox(STR_EXIT, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
tryagain:
if ExitExecRestart = 1 then
' Exit failed
dButton = DoMsgBox(STR_EXITFAIL, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONSTOP)
goto tryagain
end if
end if
if RestartListEmpty = 1 then ' Empty, but we have to reboot
dummy% = ExitWindowsExec(MakePath(szDestPath, "_msrstrt.exe"), "")
end if
End Sub
Sub UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
Dim szReadmeTitle As String
Dim szInf As String
if onCDROM% = 1 then
CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
ShowProgmanGroup STR_COMPANYNAME, 1, cmoNone
szReadmeTitle = prodName$ + " " + readmeStr$
szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
else
if szAddPMItem = "ON" then
CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
ShowProgmanGroup STR_COMPANYNAME, 1, cmoNone
szReadmeTitle = prodName$ + " " + readmeStr$
if szMinimalInstall = "ON" then
szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
else
szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
end if
end if
end if
End Sub
' Alternative function for french stowaway
' Readme icon has shortened name
Sub UpdateProgramManagerAlt(prodName$, readmeName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
Dim szReadmeTitle As String
Dim szInf As String
if onCDROM% = 1 then
CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
ShowProgmanGroup STR_COMPANYNAME, 1, cmoNone
szReadmeTitle = readmeName$ + " " + readmeStr$
szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
else
if szAddPMItem = "ON" then
CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
ShowProgmanGroup STR_COMPANYNAME, 1, cmoNone
szReadmeTitle = readmeName$ + " " + readmeStr$
if szMinimalInstall = "ON" then
szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
else
szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
end if
end if
end if
End Sub
Function GetDiskSpaceNeeded( drive% ) STATIC As Long
Dim dDummy As Long
cursor% = ShowWaitCursor()
SetSymbolValue "ExtraSpace", ""
SetSymbolValue "Needed", ""
SetSymbolValue "Cost", ""
'Drives A - Z
for i% = 1 to 26
AddListItem "ExtraSpace", ""
next i%
ReplaceListItem "ExtraSpace", dWinDrive, str$(MINIMUM_DISK_SPACE) '2K for the INI file
dDummy = GetCopyListCost("ExtraSpace","Needed","Cost")
GetDiskSpaceNeeded = val(GetListItem ("Needed", drive))
RemoveSymbol "Needed"
RemoveSymbol "Cost"
RemoveSymbol "ExtraSpace"
RestoreCursor(cursor%)
End Function
Sub UpdateIndeoAVIDrivers() STATIC
Dim szWMDriver As String
Dim szACMDriver As String
szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
if not(szWMDriver = "msacm.drv") then
fSystemUpdated = 1
end if
if VflatdPresent() = 0 then
CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
fSystemUpdated = 1
end if
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
CreateIniKeyValue szWinPath + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
End Sub
Sub UpdateWinGDrivers() STATIC
Dim szDest As String
Dim szDest1 As String
Dim szDest2 As String
' only use DVA on Windows 3.x
if OnWin3x() = 1 then
AddSectionFilesToCopyList "dva", szSrcBinPath, szWinSysPath
if VflatdPresent() = 0 then
CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", szWinSysPath+"dva.386", cmoOverwrite
fSystemUpdated = 1
end if
end if
szDest = GetRealWindowsSysDir
szDest1 = MakePath(szDest,"wing32.dll")
szDest2 = MakePath(szDest,"wing32.xxx")
RenameFilePlease szDest1, szDest2
UpdateWinG32 GetRealWindowsSysDir()
End Sub
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
SUB UpdateWinG32 (szOrig$) STATIC
'
' Here we check the version ourselves of wing32.dll, since
' we can't get version checking for Win32 apps from Win16
'
FileNew$ = MakePath(szOrig$, "wing32.dll")
FileOrig$ = MakePath(szOrig$, "wing32.xxx")
IF IsWin32FileNewer( FileOrig$, FileNew$ ) THEN
RemoveFile FileOrig$, cmoForce
ELSE
RemoveFile FileNew$, cmoForce ' get rid of new file
RenameFilePlease FileOrig$,FileNew$ ' put back old file
END IF
END SUB
Sub UpdateADPCMDrivers() STATIC
Dim szWMDriver As String
Dim szACMDriver As String
Dim fUpdate As Integer
' Check WaveMapper driver
szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
szACMDriver = GetIniKeyString (MakePath(szWinPath, "system.ini"), "MSACM", "Install")
if not(szWMDriver = "msacm.drv") then
' Isn't installed so...
' If NO ADPCM drivers are installed so...
if (szWMDriver = "") then
' Display a dialog saying "there are no ADPCM drivers on your system..."
fUpdate = 1
else
' There is a different adpcm driver in there so warn about compatibility
loop1:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_URKADPCM, "FInfoDlgProc", IDD_ADPCMHELP, PROC_HELP)
select case szButton
case "REACTIVATE"
goto loop1
case "EXIT"
AskQuit
goto loop1
case "CONTINUE" ' YES
UIPop 1
fUpdate = 1
case "CANCEL" ' NO
UIPop 1
fUpdate = 0
case "BACK"
UIPop 1
' return back flag
end select
end if
if fUpdate = 1 then
CreateIniKeyValue szWinPath + "system.ini", "drivers", "WaveMapper", "msacm.drv", cmoOverwrite
CreateIniKeyValue szWinPath + "system.ini", "MSACM", "Install", "msadpcm.acm", cmoOverwrite
CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msacm.drv","MS Audio Compression Manager", cmoOverwrite
CreateIniKeyValue szWinPath + "control.ini", "Userinstallable.drivers", "WaveMapper", "msacm.drv", cmoOverwrite
CreateIniKeyValue szWinPath + "control.ini", "related.desc", "WaveMapper", "", cmoOverwrite
fSystemUpdated = 1
else
noSysSoftware:
' No install warning
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_WARNNOSYSSOFT, "FInfoDlgProc", 0, "")
select case szButton
case "REACTIVATE"
goto noSysSoftware
case "EXIT"
AskQuit
goto noSysSoftware
case "CONTINUE"
UIPop 1
case "BACK"
UIPop 1
goto loop1
end select
end if
end if
End Sub