home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cómo funcionan las cosas
/
DKMMTWTW.iso
/
dksetup
/
dksetup.mst
< prev
next >
Wrap
Text File
|
1995-07-27
|
9KB
|
328 lines
''$DEFINE DEBUG
'$INCLUDE 'dkgen.inc'
' Paths and INI stuff
CONST APPLICATION_INI_FILE = "twtw.ini"
CONST APPLICATION_EXE_FILE = "twtw.exe"
CONST APPLICATION_PENGE_FILE = "twtw.png"
CONST INI_FILE_SOURCE = "WinPath" ' OR "AppPath"
' Language dependant strings
CONST APPLICATION_README_FILE = "leame.txt"
CONST STR_README = "LΘame"
CONST STR_MSGCAPTION = "Instalaci≤n de C≤mo funcionan las cosas"
CONST STR_PRODUCTNAME = "C≤mo funcionan las cosas"
CONST DEFAULT_INSTALL_PATH = "\ZETA\TWTW"
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
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 = ucase$(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
if IsDriveRemovable(mid$(szDestPath,1,1)) then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
' 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", ""
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
szButton = UIStartDlg(CUIDLL_FILENAME, IDD_CUSTOM, "FCustInstDlgProc", IDD_CUSTOMHELP, PROC_HELP)
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
Install
UpdateProgramManager STR_PRODUCTNAME, APPLICATION_EXE_FILE, APPLICATION_PENGE_FILE, APPLICATION_README_FILE, STR_README, FALSE
'$IFDEF DEBUG
DumpCopyList MakePath(szDestPath, "copylist.txt")
'$ENDIF ''DEBUG
EndCommonInstall APPLICATION_README_FILE, 0
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
stop
end
quitError:
dButton = DoMsgBox (STR_QUITERROR, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
end
Finish:
DeInitialise
stop
end
Sub Install() STATIC
cursor% = ShowWaitCursor()
CreateDir szDestPath, cmoNone
SetRestartDir szDestPath
RestoreCursor(cursor%)
CopyFilesInCopyList
if INI_FILE_SOURCE = "AppPath" then
szAppINIPath = MakePath(szDestPath, APPLICATION_INI_FILE)
else
szAppINIPath = MakePath(szWinPath, APPLICATION_I