home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.uv.es
/
2014.11.ftp.uv.es.tar
/
ftp.uv.es
/
pub
/
windows
/
network
/
wsock
/
Netscape
/
n16e122.exe
/
setup.mst
< prev
next >
Wrap
Text File
|
1995-09-26
|
11KB
|
328 lines
'**************************************************************************
'* Netscape Setup
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST PROGROUP = 260
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
CONST SW_MINIMIZE = 6
CONST SW_RESTORE = 9
CONST SW_SHOW = 5
CONST IDYES = 6
DECLARE FUNCTION FindWindow LIB "user" (szClassName$, szWindow$) AS INTEGER
DECLARE SUB ShowWindow LIB "user" (hwnd%, nCmdShow%)
DECLARE SUB WinExec LIB "kernel" (szCmdLine$, nCmdShow%)
DECLARE SUB UpdateNetscapeIni LIB "mscuistf.dll" (szIniPath$)
DECLARE FUNCTION IsBadWin32s LIB "mscuistf.dll" () AS INTEGER
DECLARE SUB Install
DECLARE SUB CreateNewsDir (szNetscapeIni$, szNewsDir$)
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Netscape Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
' See if the user is running a version of Win32s less than 1.2
IF IsBadWin32s() THEN
szErrText$ = "Version 1.1 of the Netscape Navigator uses OLE 2.02, which is not compatible with this version of Win32s."
szErrText$ = szErrText + " You must upgrade to Win32s version 1.2 before installing the Netscape Navigator."
szErrText$ = szErrText + "\nFor more information, please read the Netscape Navigator README.TXT file."
i% = DoMsgBox(szErrText$, "Netscape Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
END IF
' If there is an existing Netscape installation then use the current
' directory as the default location; otherwise use \NETSCAPE
DEST$ = GetIniKeyString("WIN.INI", "Netscape", "ini")
IF DEST$ = "" THEN
DEST$ = MID$(GetWindowsDir, 1, 1) + ":\NETSCAPE"
ELSE
SPLITPATH DEST$, drv$, dir$, filename$, ext$
DEST$ = drv$ + MID$(dir$, 1, LEN(dir$) - 1)
END IF
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FGetPathDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
CHOOSEGROUP:
SetSymbolValue "ProgramGroup", "Netscape"
CHOOSEGROUP1:
sz$ = UIStartDlg(CUIDLL$, PROGROUP, "FProgramGroupDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO CHOOSEGROUP1
ELSE
GOSUB ASKQUIT
GOTO CHOOSEGROUP1
END IF
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
IF DoMsgBox("Installation is complete. Would you like to read the README file now?", "Netscape Setup", MB_YESNO) = IDYES THEN
WinExec "NOTEPAD " + MakePath(DEST$, "README.TXT"), SW_SHOW
END IF
END
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!", "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:
'** Creates specified news directory
'** Arguments:
'** Path to Netscape INI file and directory to create.
'** Returns:
'** none.
'*************************************************************************
SUB CreateNewsDir (szNetscapeIni$, szNewsDir$) STATIC
' Check for a file with the same name as the directory we are trying to create
IF DoesFileExist(szNewsDir$, femExists) THEN
' Try using MOZNEWS as the directory name
IF DoesFileExist(MakePath(DEST$, "MOZNEWS"), fmExists) = 0 THEN
CreateDir MakePath(DEST$, "MOZNEWS"), cmoNone
' Add a line to the Netscape INI file pointing to the news directory
CreateIniKeyValue szNetscapeIni$, "News", "News Directory", MakePath(DEST$, "MOZNEWS"), cmoOverwrite
END IF
ELSE
CreateDir szNewsDir$, cmoNone
' Add a line to the Netscape INI file pointing to the news directory
CreateIniKeyValue szNetscapeIni$, "News", "News Directory", szNewsDir$, cmoOverwrite
END IF
END SUB
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
' Create user specified directory and CACHE sub-directory
CreateDir DEST$, cmoNone
CreateDir MakePath(DEST$, "CACHE"), cmoNone
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
' Files needed for OLE2 go in the Windows SYSTEM directory
AddSectionFilesToCopyList "OLE2", SrcDir$, GetWindowsSysDir
' If there is an existing NETSCAPE.INI file then ask the user if they
' want to overwrite the existing file
IF DoesFileExist(MakePath(DEST$, "NETSCAPE.INI"), femExists) THEN
IF DoMsgBox("Do you want to overwrite the existing NETSCAPE.INI file?", "Netscape Setup", MB_YESNO) = IDYES THEN
AddSectionFilesToCopyList "INI", SrcDir$, DEST$
END IF
ELSE
AddSectionFilesToCopyList "INI", SrcDir$, DEST$
END IF
CopyFilesInCopyList
' Merge OLE2 registration into system registry
WinExec "REGEDIT /S OLE2.REG", SW_SHOW
' Modify the win.ini file to have a [Netscape] section with a keyname-value
' pair for the Netscape INI file location
CreateIniKeyValue "WIN.INI", "Netscape", "ini", MakePath(DEST$, "NETSCAPE.INI"), cmoOverwrite
szNetscapeIni$ = MakePath(DEST$, "NETSCAPE.INI")
' If the user specified an installation location other than the default
' location, then update the netscape.ini file accordingly
IF DEST$ <> "C:\NETSCAPE" THEN
UpdateNetscapeIni szNetscapeIni$
END IF
' See if there is a news directory specified in the INI file
szNewsDir$ = GetIniKeyString(szNetscapeIni$, "News", "News Directory")
IF szNewsDir$ = "" THEN
CreateNewsDir szNetscapeIni$, MakePath(DEST$, "NEWS")
ELSEIF DoesDirExist(szNewsDir$) = 0 THEN
CreateNewsDir szNetscapeIni$, szNewsDir$
END IF
' Check to see if the NEWSRC file specified in the NETSCAPE.INI actually exists
szNewsRC$ = GetIniKeyString(szNetscapeIni$, "Main", "News RC")
IF szNewsRC$ <> "" THEN
IF DoesFileExist(szNewsRC$, femExists) = 0 THEN
' Make the default NEWSRC file be in the NEWS sub-directory
CreateIniKeyValue szNetscapeIni$, "Main", "News RC", MakePath(DEST$, "NEWS\NEWSRC"), cmoOverwrite
END IF
END IF
' Setup Netscape to use the audio player as an external viewer
CreateIniKeyValue szNetscapeIni$, "Viewers", "audio/basic", MakePath(DEST$, "NAPLAYER.EXE"), cmoOverwrite
CreateIniKeyValue szNetscapeIni$, "Viewers", "audio/x-aiff", MakePath(DEST$, "NAPLAYER.EXE"), cmoOverwrite
CreateIniKeyValue szNetscapeIni$, "Suffixes", "audio/basic", "au,snd", cmoOverwrite
CreateIniKeyValue szNetscapeIni$, "Suffixes", "audio/x-aiff", "aif,aiff,aifc", cmoOverwrite
' Make sure that the user doesn't have a home page containing mcom.com
szHomePage$ = GetIniKeyString(szNetscapeIni$, "Main", "Home Page")
IF InStr(LCase$(szHomePage$), "mcom.com") THEN
' IF szHomePage$ = "http://home.mcom.com/home/welcome.html" THEN
CreateIniKeyValue szNetscapeIni$, "Main", "Home Page", "http://home.netscape.com/", cmoOverwrite
END IF
' If the user doesn't have an existing cookie file, then see if they have an existing
' internetMCI cookie file and if they do make a copy of it
szCookieFile$ = GetIniKeyString(szNetscapeIni$, "Cookies", "Cookie File")
IF szCookieFile$ = "" THEN
szCookieFile$ = MakePath(DEST$, "COOKIES.TXT")
END IF
IF DoesFileExist(szCookieFile$, femExists) = 0 THEN
szInternetMCI$ = GetIniKeyString("WIN.INI", "IMCI", "ini")
IF szInternetMCI$ <> "" THEN
szMCICookie$ = GetIniKeyString(szInternetMCI$, "Cookies", "Cookie File")
IF szMCICookie$ <> "" THEN
IF DoesFileExist(szMCICookie$, femExists) THEN
CopyFile szMCICookie$, szCookieFile$, cmoNone, 0
END IF
END IF
END IF
END IF
' Show the Program Manager
ShowWindow FindWindow("PROGMAN", NULL), SW_RESTORE
' Update program group and program items
Group$ = GetSymbolValue("ProgramGroup")
CreateProgmanGroup Group$, "", cmoNone
ShowProgmanGroup Group$, 1, cmoNone
SLEEP 1
CreateProgmanItem Group$, "Netscape", MakePath(DEST$, "NETSCAPE.EXE"), "", cmoOverwrite
' Only add a README file icon if this is the default program group
if Group$ = "Netscape" then
CreateProgmanItem Group$, "Read Me", "notepad "+ MakePath(DEST$, "README.TXT"), "", cmoOverwrite
end if
SLEEP 1
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