home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1996 January
/
Chip_Special_Best_Web_Sites_01-96.iso
/
pc
/
zugang
/
maz
/
addsetup.ms_
/
addsetup.ms
Wrap
Text File
|
1995-09-11
|
8KB
|
270 lines
'**************************************************************************
'* CHIP-Netsurf-Setup
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
''CONST OPTIONS = 800
CONST Modem_Config = 1100
CONST APPHELP = 900
CONST BADPATH = 6400
CONST Internet_HELP = 1000
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL ModemInitIn$ ''Modem Init-String Default
GLOBAL ModemDialIn$ ''Modem Dial-String Default
GLOBAL ComPort$ ''Modem-Port
GLOBAL ModemInit$ ''Modem Init-String
GLOBAL ModemDial$ ''Modem Dial-String
GLOBAL IP_Adr$ ''IP-Adresse
GLOBAL Number$ ''MAZ-Telephonnummer
GLOBAL UserName$ ''Loginname
GLOBAL ISC_POP3$ ''POP-Server
GLOBAL LoginName$
GLOBAL Vorname$
GLOBAL Nachname$
GLOBAL Password$
GLOBAL GetEudora$
GLOBAL GetAgent$
GLOBAL WinDir$ ''Windows-Verzeichnis
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "CHIP-Netsurf Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
DEST$ = "C:\NETSURF"
ModemInitIn$ = "AT&F"
ModemDialIn$ = "ATDP"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDir$ = GetWindowsDir
IF IsDriveValid(WinDir$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDir$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
WELCOME:
DEST$= GetIniKeyString("WIN.INI","NetSurf","NS_Dir")
REM Temp$=GetIniKeyString(WinDir$+"WINWEB.INI","Options","HomePage")
REM CreateIniKeyValue WinDir$+"WINWEB.INI","Options","HomePage","http://www.netsurf.de/netsurf/teilnahme/diewelt.html",cmoOverwrite
REM RUN DEST$+"\WINWEB\WINWEB.EXE"
REM CreateIniKeyValue WinDir$+"WINWEB.INI","Options","HomePage",Temp$,cmoOverwrite
SOFTWARE:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", Internet_HELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
GOTO OPTION
ELSE
GOSUB ASKQUIT
GOTO SOFTWARE
END IF
OPTION:
'' SetSymbolValue "RadioDefault", OPTCUR$
'' SetSymbolValue "Modem_InitIn", ModemInitIn$
'' SetSymbolValue "Modem_DialIn", ModemDialIn$
OPTL1:
sz$ = UIStartDlg(CUIDLL$, Modem_Config, "FModemConfDlgProc", APPHELP, HELPPROC$)
GetEudora$ = GetSymbolValue("eudora.zip")
GetAgent$= GetSymbolValue("agent.zip")
'' i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", GetEudora$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
IF sz$ = "CONTINUE" THEN
UIPop(1)
ELSEIF sz$ = "REACTIVATE" THEN
UIPop(1)
'' GOTO OPTL1
ELSE
GOSUB ASKQUIT
GOTO OPTION
END IF
GETPATH:
'' SetSymbolValue "EditTextIn", DEST$
'' SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
'' DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
'' IF IsDirWritable(DEST$) = 0 THEN
'' GOSUB BADPATH
'' GOTO GETPATHL1
'' END IF
Vorname$= GetSymbolValue("FirstName")
Nachname$= GetSymbolValue("LastName")
Loginname$= GetSymbolValue("Password")
'' i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", Vorname$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO OPTION
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
DEST$= GetIniKeyString("WIN.INI","NetSurf","NS_Dir")
ISC_POP3$ = GetIniKeyString("WIN.INI","NetSurf","POP3")
EudoraDir$=DEST$+"\EUDORA"
AgentDir$=DEST$+"\AGENT"
WinSockDir$ = DEST$+"\WINSOCK"
WS_FTPDir$ = DEST$+"\WS_FTP"
WinsockIni$ = MakePath(WinSockDir$, "TRUMPWSK.INI")
WinVNIni$ = MakePath(WinVNDir$, "WINVN.INI")
WS_FTPIni$ = MakePath(WS_FTPDir$, "WS_FTP.INI")
WinsockIni$ = MakePath(WinSockDir$, "TRUMPWSK.INI")
CreateIniKeyValue WinsockIni$, "Trumpet Winsock", "ip", "0.0.0.0", cmoOverwrite ''IP_Adr$, cmoOverwrite
CreateIniKeyValue WinsockIni$, "default vars", "$username", Loginname$, cmoOverwrite
if GetEudora$="Yes" then
CreateIniKeyValue EudoraDir$+"\EUDORA.INI","Configurations","POPAccount",Vorname$+"."+Nachname$+"@"+ISC_POP3$, cmoOverwrite
CreateIniKeyValue EudoraDir$+"\EUDORA.INI","Configurations","RealName",Vorname$+" "+Nachname$, cmoOverwrite
CreateIniKeyValue EudoraDir$+"\EUDORA.INI","Configurations","ReturnAddress",Vorname$+"."+Nachname$+"@"+ISC_POP3$, cmoOverwrite
endif
if GetAgent$="Yes" then
CreateIniKeyValue AgentDir$+"\AGENT.INI","Profile","Fullname",Vorname$+" "+Nachname$, cmoOverwrite
CreateIniKeyValue AgentDir$+"\AGENT.INI","Profile","EMailAddress",Vorname$+"."+Nachname$+"@"+ISC_POP3$, cmoOverwrite
endif
ShowProgmanGroup "CHIP Netsurf", 1, cmoNone
if GetEudora$="Yes" then
CreateProgmanItem "CHIP Netsurf", "Eudora", MakePath(EudoraDir$,"WEUDORA.EXE"), "", cmoOverwrite
endif
if GetAgent$="Yes" then
CreateProgmanItem "CHIP Netsurf", "Agent", MakePath(AgentDir$,"AGENT.EXE"), "", cmoOverwrite
endif
END SUB
'**
'** 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