home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enciclopedia de la Ciencia
/
DKMMSCIE.ISO
/
dksetup
/
dksetup.mst
< prev
next >
Wrap
Text File
|
1995-09-06
|
15KB
|
467 lines
''$DEFINE DEBUG
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' SCIENCE (SP)
'
' VfW drivers & WING
'
' VERSION:04/09/95 Add WING driver to science for use with v1.1
'
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'01/08/95 No min install as ini problem not resolved
'07/07/95 Correct dkgen.inc so unregisters use of ctl3d
'04/07/95 Make sure files in bin section of inf file 'always' overwrite
'28/07/95 Ini file not created for minimum install, uses file provided in dkcode
'27/06/95 Test for directory names max 8 chars
'26/06/95 For minimum install, ini file is now not installed
'19/06/95 Moved test for cirrus drivers to mst file as only applies to sampler
'05/06/95 Fonts installed on users machine
'01/06/95 No choice about adding icon to prog man, altered dkgen.inc & rc file
' (custom, customhelp & speed dlg boxes need changing)
'22/05/95 Code for bundling with sampler
'22/05/95 Large readme need Write (will need to change dlg box in rc file)
'15/05/95 No warning that directory does not exist
'03/05/95 Ini file put in executable directory rather than Windows dir to stop
' clash with foreign products with same name files
'$INCLUDE 'dkgen.inc'
'IF WITH SAMPLER ( add to .inf & dkcode ) + see add to prog man below
'CONST SAMPLER_PATH = "SAMPLER"
'CONST APPLICATION_MENU_FILE = "custmenu.exe"
'CONST APPLICATION_EXE2_FILE = "dksd2pc.exe"
'DECLARE FUNCTION TestForCirrus LIB "dkutils.dll" () As INTEGER
'IF USING SPECIFIC FONTS
'DECLARE FUNCTION InstallFont LIB "dkutils.dll" (szFont$) AS INTEGER
'DECLARE SUB UpdateFonts()
' Paths and INI stuff
CONST APPLICATION_INI_FILE = "SCIENCE.ini"
CONST APPLICATION_EXE_FILE = "SCIENCE.exe"
CONST APPLICATION_PENGE_FILE = "SCIENCE.png"
CONST INI_FILE_SOURCE = "WinPath" ' OR "AppPath"
CONST EDITOR_EXE = "notepad.exe " 'OR "write.exe "
' Language dependant strings
CONST APPLICATION_README_FILE = "leame.txt"
CONST STR_README = "Enciclopedia de la Ciencia Léame"
CONST STR_MSGCAPTION = "Instalación de Enciclopedia de la Ciencia"
CONST STR_PRODUCTNAME = "Enciclopedia de la Ciencia"
CONST DEFAULT_INSTALL_PATH = "\ZETA\SCIENCE"
DECLARE SUB Install()
DECLARE SUB AddFilesToCopyList(szInstallType$)
DECLARE FUNCTION IsCDROMDrive LIB "dkutils.dll" (wDrive%) As INTEGER
Init:
Initialise STR_PRODUCTNAME, DEFAULT_INSTALL_PATH, STR_MSGCAPTION
WelcomeDlg:
if Welcome() = NAV_BACK then
' Don nothing - cant go back
end if
if TestSystem() = NAV_BACK then
goto WelcomeDlg
end if
'IF WITH SAMPLER
'TestCirrus:
' if TestForCirrus() = 1 then
' dButton = DoMsgBox(STR_CIRRUS, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
' end if
'IF EARLIER PRODS WITH NO SAMPLER
' UpdateADPCMDrivers
ExpressCustomDlg:
' defaults to Express
'if szExpressCustomChoice = "EXPRESS" then
' SetSymbolValue "RadioDefault", "1"
'else
' SetSymbolValue "RadioDefault", "1"
'end if
ECDlgLoop:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_SPEED, "FRadioDlgProc", IDD_WHIZZHELP, PROC_HELP)
select case szButton
case "REACTIVATE"
goto ECDlgLoop
case "BACK"
UIPop 1
goto WelcomeDlg
case "CONTINUE" ' Install
UIPop 1
if GetSymbolValue("ButtonChecked") = "1" then
szExpressCustomChoice = "EXPRESS"
goto ExpressInstallLoop
else
szExpressCustomChoice = "CUSTOM"
goto CustomInstallLoop
end if
case "EXIT"
AskQuit
goto ECDlgLoop
end select
CustomInstallLoop:
GetPathDlg:
SetSymbolValue "EditTextIn", szDestPath
szOldDestPath = szDestPath
SetSymbolValue "EditFocus", "ALL"
GetPathDlgLoop:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_DESTPATH, "FEditDlgProc", IDD_PATHHELP, PROC_HELP)
select case szButton
case "REACTIVATE"
goto GetPathDlgLoop
case "BACK"
UIPop 1
szDestPath = szOldDestPath
goto ECDlgLoop
case "CONTINUE"
UIPop 1
szDestPath = GetSymbolValue("EditTextOut")
if mid$(szDestPath, 2, 1) = ":" and mid$(szDestPath, 3, 1) <> "\" then
szTemp$ = mid$(szDestPath, 1, 2) + "\" + mid$(szDestPath, 3, len(szDestPath)-2)
szDestPath = szTemp
end if
if mid$(szDestPath, 2, 1) <> ":" then
if mid$(szDestPath, 1,1) <> "\" then
szDestPath = mid$(szWinPath, 1,1) + ":\" + szDestPath
else
szDestPath = mid$(szWinPath, 1,1) + ":" + szDestPath
end if
elseif IsDriveValid(mid$(szDestPath, 1,1)) = 0 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
' check for "foreign" chars in path
slength% = len(szDestPath)
found% = 0
for i% = 1 to slength%
if asc(mid$(szDestPath, i%, 1)) > 126 then
found% = 1
end if
next i%
if found% = 1 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
wDrive% = asc(mid$(szDestPath, 1,1)) - asc("A")
if IsCDROMDrive(wDrive%) > 0 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
if IsDriveNetwork(mid$(szDestPath,1,1)) = 1 then
szDestPath = szOldDestPath
UIPop 1
NetworkDrive
goto GetPathDlg
end if
if IsDirWritable(szDestPath) = 0 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
'check dir names not > 8 chars
dirlength% = 0
i% = 3
while i% <> slength%
i% =i%+1
dirlength% = dirlength% +1
if mid$(szDestPath, i%, 1)="\" then
if dirlength% > 9 then
szDestPath = szOldDestPath
dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
goto GetPathDlg
else
dirlength% = 0
endif
end if
wend
if dirlength% > 8 then
szDestPath = szOldDestPath
dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
goto GetPathDlg
endif
' if DoesDirExist(szDestPath) = 0 then
' dButton = DoMsgBox( STR_DIRNOTEXIST, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
' if dButton = 7 then
' goto GetPathDlg
' end if
' end if
UIPop 1
case "EXIT"
AskQuit
goto GetPathDlg
end select
GetCustomChoicesDlg:
SetSymbolValue "CheckItemsState", ""
''''''''''''''''''''' NO MIN INSTALL'''''''''''''''''''''''''''''''
' AddListItem "CheckItemsState", szMinimalInstall
' AddListItem "CheckItemsState", szAddPMItem
GetCustomChoicesLoop:
ClearCopyList
if szMinimalInstall = "OFF" then
AddFilesToCopyList "FULL"
else
AddFilesToCopyList "MINIMAL"
end if
dDestDrive = asc(mid$(szDestPath, 1,1)) - asc("A")+1
dWinDrive = asc(mid$(szWinPath, 1,1)) - asc("A")+1
SetSymbolValue "DriveStatusText", ""
AddListItem "DriveStatusText", mid$(szDestPath, 1,1) + ":"
AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dDestDrive) / 1024) + " K"
AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szDestPath, 1,1))/1024) + " K"
if dDestDrive = dWinDrive then
AddListItem "DriveStatusText", ""
AddListItem "DriveStatusText", ""
AddListItem "DriveStatusText", ""
else
AddListItem "DriveStatusText", mid$(szWinPath, 1,1) + ":"
AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dWinDrive)/ 1024 ) + " K"
AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szWinPath, 1,1))/1024) + " K"
end if
AddListItem "DriveStatusText", szDestPath
ChooseInstall:
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_CUSTOM, "FCustInstDlgProc", IDD_CUSTOMHELP, PROC_HELP)
''''''''''''''''''''' NO MIN INSTALL'''''''''''''''''''''''''''''''
' szMinimalInstall = GetListItem("CheckItemsState", 1)
' szAddPMItem = GetListItem("CheckItemsState", 2)
select case szButton
case "REACTIVATE"
goto GetCustomChoicesLoop
case "BACK"
UIPop 1
goto GetPathDlg
case "CONTINUE"
UIPop 1
case "EXIT"
AskQuit
goto GetCustomChoicesLoop
end select
ClearCopyList
if szMinimalInstall = "OFF" then
AddFilesToCopyList "FULL"
else
AddFilesToCopyList "MINIMAL"
end if
goto CommonInstallLoop
ExpressInstallLoop:
AddFilesToCopyList "FULL"
goto CommonInstallLoop
CommonInstallLoop:
InitCommonInstall
if szMinimalInstall = "ON" and GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < MINIMUM_DISK_SPACE then
error ERR_NODISKSPACE
elseif GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < GetDiskSpaceNeeded( asc(mid$(szDestPath, 1,1))-asc("A")+1 ) then
error ERR_NODISKSPACE
end if
'IF LATER PROD OR WITH SAMPLER
UpdateWinGDrivers
UpdateIndeoAVIDrivers
'IF USING SPECIFIC FONTS
' UpdateFonts
Install
CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
ShowProgmanGroup STR_COMPANYNAME, 1, cmoNone
' szReadmeTitle$ = STR_PRODUCTNAME + " " + STR_README
'IF WITH SAMPLER
' szSamplerPath$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), SAMPLER_PATH)
' szSamplerPath$ = MakePath(szSamplerPath$, APPLICATION_EXE2_FILE)
' if szMinimalInstall = "ON" then
' szInf$ = MakePath(szSrcBinPath, APPLICATION_MENU_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
' CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
' CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
' else
' szInf$ = MakePath(szDestPath, APPLICATION_MENU_FILE) + " " + MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
' CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
' CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
' end if
'IF NO SAMPLER
if szMinimalInstall = "ON" then
szInf$ = MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_PENGE_FILE)
CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
else
szInf$ = MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, APPLICATION_PENGE_FILE)
CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
end if
'$IFDEF DEBUG
DumpCopyList MakePath(szDestPath, "copylist.txt")
'$ENDIF ''DEBUG
EndCommonInstall APPLICATION_README_FILE, 0, EDITOR_EXE
quit:
on error goto quit
select case ERR
case 0
hDlg = IDD_EXITSUCCESS
case STFQUIT
hDlg = IDD_EXITQUIT
case ERR_NODISKSPACE
hDlg = IDD_NODISKSPACE
case else
hDlg = IDD_EXITFAILURE
end select
UIPop 10
quit2:
szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfo0DlgProc", 0, "")
select case szButton
case "REACTIVATE"
goto quit2
end select
UIPop 1
DeInitialise
stop
end
quitError:
dButton = DoMsgBox (STR_QUITERROR, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
DeInitialise
stop
end
Sub Install() STATIC
cursor% = ShowWaitCursor()
CreateDir szDestPath, cmoNone
SetRestartDir szDestPath
RestoreCursor(cursor%)
CopyFilesInCopyList 'creates dir even if min install
'IF LATER PROD OR WITH SAMPLER
Run ("regedit.exe /s " + MakePath(szWinPath, "mplayer.reg"))
Run ("regedit.exe /s " + MakePath(szWinSysPath, "OLE2.reg"))
Run ("regedit.exe /s " + MakePath(szWinSysPath, "cleanup.reg"))
Run ("profdisp.exe")
if INI_FILE_SOURCE = "AppPath" then
szAppINIPath = MakePath(szDestPath, APPLICATION_INI_FILE)
else
szAppINIPath = MakePath(szWinPath, APPLICATION_INI_FILE)
end if
szPengePath = mid$(szSrcSetupPath, 1,len(szSrcSetupPath)-len(SOURCE_SETUP_SUBDIR)-2) ' -2 removes backslash
if szMinimalInstall = "OFF" then
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szPengePath, cmoOverwrite
endif
End Sub
Sub AddFilesToCopyList(szInstallType$) STATIC
cursor% = ShowWaitCursor()
select case szInstallType
case "FULL"
AddSectionFilesToCopyList SETUP_INI_BINARIES_SECTION_NAME, szSrcBinPath, szDestPath
case "MINIMAL"
' nothing
end select
'IF EARLIER PRODS AND NO SAMPLER
' if fSystemUpdated = 1 then
' AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
' end if
'IF LATER PROD OR WITH SAMPLER
AddSectionFilesToCopyList SETUP_INI_WING_BINARIES_NAME, szSrcBinPath, szWinSysPath
AddSectionFilesToCopyList SETUP_INI_WING32_BINARIES_NAME, szSrcBinPath, szWinSysPath
AddSectionFilesToCopyList "VfW Runtime", szSrcBinPath, szWinSysPath
AddSectionFilesToCopyList "OLE2", szSrcBinPath, szWinSysPath
AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
AddSectionFilesToCopyList "MPlayer", szSrcBinPath, szWinPath
AddSectionFilesToCopyList "AVICodecs", szSrcBinPath, szWinSysPath
RestoreCursor(cursor%)
End Sub
'IF USING SPECIFIC FONTS
'Sub UpdateFonts() STATIC
' ' Check TT enabled
' MakeListFromSectionFilename "Fonts_list", "Fonts"
'
' listLength% = GetListLength("Fonts_list")
' if listLength% > 0 then
' for item% = 1 to listLength%
' szFontFile$ = GetListItem("Fonts_list", item%)
' ' Check if exists
' 'Install font
' ret% = InstallFont(MakePath(szSrcBinPath, szFontFile))
' ' Write WIN.INI
' next
' end if
'End Sub