home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-02-10 | 48.4 KB | 1,323 lines
'============================================================================ ' ' ' $Workfile: SETUP.MST $ ' $Revision: 21 $ ' $Date: 2/13/96 12:39p $ ' ' Authors: Modified by Lisa Angelini. Original from Netscape ' ' Purpose: This script file is used by MS Setup to create installation ' procedures. We have modified this script from Netscape for ' the installation and setup of our files. ' ' ' $History: SETUP.MST $ ' ' ***************** Version 21 ***************** ' User: Lisa Date: 2/13/96 Time: 12:39p ' Updated in $/WorldNet.16/Install ' 1. Moved the "Would you like to delete the _ directory" message box ' after the message box that says "Are you sure you want to deinstall ' AT&T WorldNet Services". Now, both message boxes are reworded and ' follow one after another. No longer will the user be able to save the ' directory if they decide to deinstall. When they answer yes to the ' Warning message box, everything is removed. ' ' ***************** Version 20 ***************** ' User: Lisa Date: 1/31/96 Time: 11:34a ' Updated in $/WorldNet.16/Install ' 1. Set claimport to 1 in our modification of system.ini for shivappp ' ' ***************** Version 19 ***************** ' User: Lisa Date: 1/30/96 Time: 2:41p ' Updated in $/WorldNet.16/Install ' 1. Changed GroupRst's class name to the new one that Mike changed it ' to. ' 2. Reworded the message box that appears when we detect the user does ' not have a PE installation. ' ' ***************** Version 18 ***************** ' User: Baumeister Date: 1/26/96 Time: 10:26a ' Updated in $/WorldNet.16/Install ' Added custcare.bmp to the deinstall list. ' ' ***************** Version 17 ***************** ' User: Lisa Date: 1/25/96 Time: 6:57p ' Updated in $/WorldNet.16/Install ' 1. changed commented code to have new names of grouprst.exe and ' advisor.exe ' 2. changed the launcher.ini to advisor.ini where the ini file gets ' updated with the correct directory for our installation. ' ' ***************** Version 16 ***************** ' User: Lisa Date: 1/25/96 Time: 5:35p ' Updated in $/WorldNet.16/Install ' 1. Change last place where qwikfix.exe needed to be changed to ' grouprst.exe. ' ' ***************** Version 15 ***************** ' User: Lisa Date: 1/23/96 Time: 4:58p ' Updated in $/WorldNet/Install ' 1. Put in check for LAN version, i.e. not a PE version. The typical ' option will always give C:\worldnet if we find and entry in win.ini for ' a previous installation. ' 2. added dialer.ico to deletion list. ' ' ***************** Version 14 ***************** ' User: Lisa Date: 1/11/96 Time: 4:21p ' Updated in $/WorldNet/Install ' Updated with the latest release from Netscape. This is a merged ' version of their changes (mostly Service to Services) and our changes. ' Also added the new names wnsysrpt, advisor, and grouprst to the list of ' files to be deinstalled. ' ' ***************** Version 13 ***************** ' User: Lisa Date: 12/15/95 Time: 1:56p ' Updated in $/WorldNet/Install ' 1. Added a version check for Win 95 and a loop to check if QwikFix is ' finished executing, which indicates that the program group is created. ' This is needed only for Windows 95 because setup was continuing to ' proceed even though QwikFix hadn't finished creating the program group. ' As a result, the Setup message box to continue with installation was ' hidden from the user by the program group. This happened only in ' Windows 95. ' ' ***************** Version 12 ***************** ' User: Lisa Date: 12/14/95 Time: 1:05p ' Updated in $/WorldNet/Install ' 1. changed sections names AT&&T WorldNet Services and AT&&T Dial back ' to Netscape and AttDial. ' ' ***************** Version 11 ***************** ' User: Lisa Date: 12/13/95 Time: 12:12p ' Updated in $/WorldNet/Install ' 1. Change AT&T WorldNet(SM) Servics back to AT&T WorldNet Service ' until Netscape can make the appropriate changes in signup.exe. ' ' ***************** Version 10 ***************** ' User: Lisa Date: 12/13/95 Time: 11:54a ' Updated in $/WorldNet/Install ' 1. Changed the DeleteProgmanGroup argument to AT&T WorldNet(SM) ' Services so the program group gets deleted on deinstall. ' 2. Remove all the code in the subroutine AddProgramItems, except for ' ShowWindow on the program manager and added a call to WinExec ' QwikFix.exe. This creates the program group items now. ' ' ***************** Version 9 ***************** ' User: Lisa Date: 12/12/95 Time: 3:40p ' Updated in $/WorldNet/Install ' 1. Changed name of shiva section to ShivaPPP and its entry to ' ClaimPort. ' ' ***************** Version 8 ***************** ' User: Lisa Date: 12/12/95 Time: 11:15a ' Updated in $/WorldNet/Install ' 1. WinExec qwikfix.exe after program group is created in case the user ' did a reinstall and there are two registration wizard icons present. ' 2. Changed all Service text to Services. ' 3. Modified the system.ini entry for shiva to be shivappp not ' shiva.ppp ' 4. Added removal of shivappp entry in system.ini if user selects ' deinstall. ' 5. Using signup.exe not regwiz.ico for the wrapped registration wizard ' icon. ' 6. Added qwiklook.ini and getaccnt.exe to list of files to delete on ' deinstall. ' 7. Changed customer care icon title to Customer Care Tools. ' 8. Added full path to command line for notepad for the Read Me icon. ' 9. Added full path to command line for customer care icon. ' 10. Changed Netscape to AT&&T WorldNet Services in the section where ' the launcher.ini file gets modified. ' 11. Same as 10. Changed Att Dial to AT&&T Dial. ' ' ***************** Version 7 ***************** ' User: Lisa Date: 11/22/95 Time: 3:14p ' Updated in $/WorldNet/Install ' 1. Changed the launcher.ini file so eudora has the full path for its ' argument (directory). ' ' ***************** Version 6 ***************** ' User: Lisa Date: 11/21/95 Time: 3:59p ' Updated in $/WorldNet/Install ' 1. Removed an extra " from line 917. ' ' ***************** Version 5 ***************** ' User: Lisa Date: 11/20/95 Time: 2:14p ' Updated in $/WorldNet/Install ' 1. Removed QwikLook.exe and added CustCare.exe to the program group. ' 2. Added CustCare.exe to list of files to be removed. ' 3. Added launcher section to be updated in the launcher.ini so it has ' the correct directory where worldnet was installed into. ' ' ***************** Version 4 ***************** ' User: Lisa Date: 11/16/95 Time: 10:00a ' Updated in $/WorldNet/Install ' Remove qwiklook.ini from script since it doesn't exist yet. ' ' ***************** Version 3 ***************** ' User: Lisa Date: 11/15/95 Time: 2:50p ' Updated in $/WorldNet/Install ' Added line to remove qwikfix.ini. ' ' ***************** Version 2 ***************** ' User: Lisa Date: 11/13/95 Time: 4:52p ' Updated in $/WorldNet/Install ' 1. Changed fixup.exe to qwikfix.exe everywhere. ' 2. Changed the Read Me icon to point to our readme file ' att\wnreadme.txt. ' 3. Added line to delete worldnet.ico. ' ' ***************** Version 1 ***************** ' User: Lisa Date: 11/07/95 Time: 5:15p ' Created in $/WorldNet/Install '============================================================================ '************************************************************************** '* Netscape Setup '************************************************************************** '$DEFINE DEBUG ''Define for script development/debugging '$INCLUDE 'setupapi.inc' '$INCLUDE 'msdetect.inc' '$INCLUDE 'msregdb.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 REBOOT = 1000 CONST RESTART = 1001 CONST BADPATH = 6400 CONST EXISTING = 160 CONST BILLBOARD1 = 320 CONST BILLBOARD2 = 340 CONST BILLBOARD3 = 360 CONST CUSTINST = 6200 CONST INSTALLTYPE = 6500 CONST TOOBIG = 6300 ''Bitmap ID CONST LOGO = 1 ''File Types CONST APPFILES = 1 CONST STACKFILES = 2 CONST EUDORAFILES = 3 GLOBAL DEST$ ''Default destination directory. GLOBAL SRC$ ''Default source directory GLOBAL WINDRIVE$ ''Windows drive letter. ''CustInst list symbol names GLOBAL APPNEEDS$ ''Option list costs per drive GLOBAL STACKNEEDS$ GLOBAL EUDORANEEDS$ GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive GLOBAL BIGLIST$ ''List of option files cost calc results (boolean) ''Dialog list symbol names GLOBAL CHECKSTATES$ GLOBAL STATUSTEXT$ GLOBAL DRIVETEXT$ ' Constants used internaly to indicate which install ' configuration we are dealing with CONST NO_NET = 0 ''No NDIS network currently installed CONST SOME_NET = 1 ''Non-WFW NDIS network installed CONST WFW_NET = 2 ''WFW network installed (not necessarily MultiNet, but uses "net start") GLOBAL wNetType% ''One of the constants above GLOBAL bReinstall% ''User is reinstalling GLOBAL bRebootMachine% ''Reboot machine or just restart Windows GLOBAL bISPMode% ''Are we doing an ISP configuration? GLOBAL bRegOnlyMode% ''Are we reg server only install? GLOBAL szISPName$ ''The name of the ISP if in ISP mode ' Miscellaneous Windows constants not defined in existing .INC files CONST SW_MINIMIZE = 6 CONST SW_RESTORE = 9 CONST SW_SHOWNOACTIVATE = 4 CONST SW_SHOW = 5 CONST IDYES = 6 CONST IDNO = 7 CONST WNNC_NET_MultiNet = &H8000 CONST WNNC_SUBNET_WinWorkgroups = 4 CONST WNNC_NET_TYPE = 2 CONST WNNC_NET_NONE = 0 DECLARE FUNCTION FindWindow LIB "user" (szClassName$, szWindow$) AS INTEGER DECLARE FUNCTION ExitWindows LIB "user" (dwReturnCode&, nReserved%) AS INTEGER DECLARE SUB ShowWindow LIB "user" (hwnd%, nCmdShow%) DECLARE FUNCTION WNetGetCaps LIB "user" (nIndex%) AS INTEGER DECLARE SUB WinExec LIB "kernel" (szCmdLine$, nCmdShow%) DECLARE SUB PostMessage LIB "user" (hwnd%, msg%, wParam%, lParam&) DECLARE FUNCTION RegisterWindowMessage LIB "user" (szMessage$) AS INTEGER DECLARE FUNCTION IsWindows30 LIB "mscuistf.dll" () AS INTEGER DECLARE FUNCTION IsISPMode LIB "mscuistf.dll" (szPath$) AS INTEGER DECLARE FUNCTION IsRegOnlyMode LIB "mscuistf.dll" (szPath$) AS INTEGER DECLARE SUB HandleMultipleConfigurations LIB "mscuistf.dll" () DECLARE FUNCTION CommaListContains LIB "mscuistf.dll" (szStr1$, szStr2$) AS INTEGER DECLARE SUB GetProtmanPath LIB "mscuistf.dll" (szBuf$) DECLARE FUNCTION InstallOemsetup LIB "mscuistf.dll" (szPath$) AS INTEGER DECLARE FUNCTION IsNTSWinsock LIB "mscuistf.dll" (szPath$) AS INTEGER DECLARE FUNCTION IsBadWin32s LIB "mscuistf.dll" () AS INTEGER DECLARE SUB RemoveDirRecurse LIB "mscuistf.dll" (szPath$) DECLARE SUB DeleteProgmanGroup LIB "mscuistf.dll" (szGroup$) ' Helper routine to update NETSCAPE.INI if Netscape is installed in a ' directory other than C:\NETSCAPE DECLARE SUB UpdateNetscapeIni LIB "mscuistf.dll" (szIniPath$) ' Routines to modify a section of an .INI file DECLARE SUB AddProfileString LIB "mscuistf.dll" (szFileName$, szSection$, szKey$, szValue$, szRef$) DECLARE SUB RemoveProfileString LIB "mscuistf.dll" (szFileName$, szSection$, szKey$, szRef$) ' Routines to modify batch files DECLARE FUNCTION BatchFileLoad LIB "mscuistf.dll" (szPath$) AS INTEGER DECLARE FUNCTION BatchFileSave LIB "mscuistf.dll" () AS INTEGER DECLARE SUB BatchFileQuit LIB "mscuistf.dll" () DECLARE FUNCTION BatchAddVariable LIB "mscuistf.dll" (szVar$, szValue$, szRefKey$, bInsertBefore%) AS INTEGER DECLARE FUNCTION BatchFindVariable LIB "mscuistf.dll" (szVar$, szBuf$, nBufLen%, bRestart%) AS INTEGER DECLARE FUNCTION BatchReplaceVariable LIB "mscuistf.dll" (szValue$) AS INTEGER DECLARE FUNCTION BatchRemoveVariable LIB "mscuistf.dll" AS INTEGER DECLARE FUNCTION BatchAddCmd LIB "mscuistf.dll" (szCmd$, szRefKey$, bInsertBefore%) AS INTEGER DECLARE FUNCTION BatchFindCmdReference LIB "mscuistf.dll" (szRefKey$, szBuf$, nBufLen%, bRestart%) AS INTEGER DECLARE FUNCTION BatchReplaceCmd LIB "mscuistf.dll" (szCmd$) AS INTEGER DECLARE FUNCTION BatchRemoveCmd LIB "mscuistf.dll" AS INTEGER ' Local routines DECLARE SUB Install DECLARE SUB Deinstall DECLARE SUB Deinstall12 DECLARE SUB CreateNewsDir (szNetscapeIni$, szNewsDir$) DECLARE SUB CheckForOldVersion DECLARE SUB AddProgramItems DECLARE SUB UpdateSystemIni DECLARE SUB UpdateAutoexec DECLARE SUB UpdateConfigSys DECLARE SUB UpdateProtocolIni DECLARE SUB UpdateRegistry DECLARE SUB AppendToKeynameValue (szExisting$, szAdd$) DECLARE FUNCTION BuildOemFileName (x%) AS STRING DECLARE SUB AddOptFilesToCopyList (ftype%) DECLARE SUB RecalcOptFiles (ftype%) DECLARE SUB RecalcPath DECLARE SUB SetDriveStatus DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING DECLARE FUNCTION OfferToDeinstall () AS INTEGER INIT: CUIDLL$ = "mscuistf.dll" ''Custom user interface dll HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure bReinstall% = 0 bRebootMachine% = 0 SRC$ = GetSymbolValue("STF_SRCDIR") bISPMode = IsISPMode(SRC$) bRegOnlyMode = IsRegOnlyMode(SRC$) IF bISPMode THEN szInstallINI$ = SRC$ + "install.ini" szISPName$ = GetIniKeyString(szInstallINI$, "Install Options", "ISPName") END IF SetBitmap CUIDLL$, LOGO szTitle$ = "AT&T WorldNet Services" IF bISPMode THEN szTitle$ = szTitle$ + " for " + szISPName$ END IF SetTitle szTitle$ szInf$ = GetSymbolValue("STF_SRCINFPATH") IF szInf$ = "" THEN szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF" END IF ReadInfFile szInf$ ' Check to make sure we are not running Windows 3.0 IF IsWindows30 THEN i% = DoMsgBox("You must be running Windows 3.1 or Windows for Workgroups in order to install AT&T WorldNet Services.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF ' See if the user is running a version of Win32s less than 1.2 IF IsBadWin32s() THEN szErrText$ = "Version 1.2 of the AT&T WorldNet Services 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 AT&T WorldNet Services." szErrText$ = szErrText + Chr$(10) + "For more information, please read the AT&T WorldNet Services Troubleshooting Guide." i% = DoMsgBox(szErrText$, "AT&T WorldNet Services", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF ' Launch our companion app to watch for us to terminate WinExec MakePath(GetSymbolValue("STF_SRCDIR"), "watcher.exe"), SW_SHOWNOACTIVE WINDRIVE$ = MID$(GetWindowsDir, 1, 1) ' 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 OfferToDeinstall THEN IF DEST$ = "" THEN DEST$ = MID$(GetWindowsDir, 1, 1) + ":\WORLDNET" ELSE SPLITPATH DEST$, drv$, dir$, filename$, ext$ DEST$ = drv$ + MID$(dir$, 1, LEN(dir$) - 1) END IF ELSE IF DEST$ <> "" THEN SPLITPATH DEST$, drv$, dir$, filename$, ext$ DEST$ = drv$ + MID$(dir$, 1, LEN(dir$) - 1) szText$ = "AT&T WorldNet Services has detected a version of Netscape installed in the " szText$= szText$+DEST$+" directory. This may be a LAN version, or a " szText$= szText$+"Netscape browser that you use with your own stack and dialer." szText$= szText$+" AT&T WorldNet Services will be installed in the " szText$=szText$+MID$(GetWindowsDir, 1, 1)+":\WORLDNET directory, " szText$= szText$+"unless you specify a different directory using the Custom option later during this setup process. " szText$=szText$+"After Setup and Registration are complete, it is strongly recommended that " szText$=szText$+" you read the section of the Troubleshooting Guide titled 'If You Already Have Netscape Installed'." i% = DoMsgBox(szText$, "AT&T WorldNet Services", MB_OK+TASKMODAL+MB_ICONINFORMATION) END IF DEST$ = MID$(GetWindowsDir, 1, 1) + ":\WORLDNET" END IF ' Check for an old version CheckForOldVersion WELCOME: ' If there is an existing 1.2 configuration, then offer to let the user ' deinstall the product IF OfferToDeinstall THEN sz$ = UIStartDlg(CUIDLL$, EXISTING, "FExistingDlgProc", APPHELP, HELPPROC$) IF sz$ = "DEINSTALL" THEN ' Get user to confirm IF DoMsgBox("Are you sure you want to deinstall the software in the "+DEST$+" directory?", "AT&T WorldNet Services", MB_YESNO) = IDNO THEN GOTO WELCOME END IF ' Ask the user if they are sure they want to blow away the whole directory szText$="Warning! Deinstalling this software will remove ALL files in the "+DEST$+" directory" szText$ =szText$+", including ALL non-Netscape files that are in this directory. Are you sure you want to deinstall?" IF DoMsgBox(szText$, "AT&T WorldNet Services", MB_YESNO+MB_ICONHAND) = IDNO THEN GOTO WELCOME ENDIF UIPop 1 Deinstall END ELSEIF sz$ <> "CONTINUE" THEN GOSUB ASKQUIT GOTO WELCOME ELSE bReinstall% = 1 ' Change the network type to NO_NET. This way if either the user wants to ' reinstall in a different directory or the existing installation is incomplete ' (e.g. no NDIS directory) we do the correct thing wNetType% = NO_NET END IF ELSE sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$) IF sz$ <> "CONTINUE" THEN GOSUB ASKQUIT GOTO WELCOME END IF END IF UIPop 1 CHECKSTATES$ = "CheckItemsState" FOR i% = 1 TO 3 STEP 1 AddListItem CHECKSTATES$, "ON" NEXT i% ASKINSTALL: SetSymbolValue "RadioDefault", "1" SetSymbolValue "InstallDir", DEST$ ASK1: ''Find out whether the user wants a simple or custom install sz$ = UIStartDlg(CUIDLL$, INSTALLTYPE, "FRadioDlgProc", APPHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN UIPOP 1 IF GetSymbolValue("ButtonChecked") = "1" THEN GOTO CHOOSEGROUP END IF ELSEIF sz$ = "REACTIVATE" THEN GOTO ASK1 ELSE GOSUB ASKQUIT GOTO ASKINSTALL END IF SETUPCUSTINST: ''CustInst list symbols STATUSTEXT$ = "StatusItemsText" DRIVETEXT$ = "DriveStatusText" FOR i% = 1 TO 3 STEP 1 AddListItem STATUSTEXT$, "" NEXT i% FOR i% = 1 TO 3 STEP 1 AddListItem DRIVETEXT$, "" NEXT i% ReplaceListItem DRIVETEXT$, 3, DEST$ ''Disk cost list symbols APPNEEDS$ = "AppNeeds" STACKNEEDS$ = "StackNeeds" EUDORANEEDS$ = "EudoraNeeds" EXTRACOSTS$ = "ExtraCosts" BIGLIST$ = "BigList" FOR i% = 1 TO 3 STEP 1 AddListItem BIGLIST$, "" NEXT i% FOR i% = 1 TO 26 STEP 1 AddListItem EXTRACOSTS$, "0" NEXT i% RecalcPath SetDriveStatus CUSTINST: sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$) ' Note that there is no CHK1 returned as a notification. That is because ' we treat the APPFILES as CHK1 IF sz$ = "CONTINUE" THEN ''Install only if it will fit. FOR i% = 1 TO 3 STEP 1 IF GetListItem(BIGLIST$, i%) <> "" THEN GOSUB TOOBIG GOTO CUSTINST END IF NEXT i% UIPop 1 GOTO CHOOSEGROUP ELSEIF sz$ = "NEWPATH" THEN DEST$ = GetListItem(DRIVETEXT$, 3) ''Truncate display if too long. IF LEN(DEST$) > 23 THEN ReplaceListItem DRIVETEXT$, 3, MID$(DEST$, 1, 23)+"..." END IF RecalcPath SetDriveStatus GOTO CUSTINST ELSEIF sz$ = "CHK2" THEN CursorSave% = ShowWaitCursor() RecalcOptFiles STACKFILES SetDriveStatus RestoreCursor CursorSave% GOTO CUSTINST ELSEIF sz$ = "CHK3" THEN CursorSave% = ShowWaitCursor() RecalcOptFiles EUDORAFILES SetDriveStatus RestoreCursor CursorSave% GOTO CUSTINST ELSEIF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus GOTO CUSTINST ELSE UIPop 1 GOTO ASKINSTALL END IF CHOOSEGROUP: SetSymbolValue "ProgramGroup", "AT&T WorldNet Services" Install QUIT: ON ERROR GOTO ERRQUIT IF ERR = 0 THEN ' We need to check whether we need to reboot the machine or just ' restart Windows IF bRebootMachine% THEN sz$ = UIStartDlg(CUIDLL$, REBOOT, "FRebootDlgProc", APPHELP, HELPPROC$) IF sz$ = "REBOOT" THEN ' Signify that we want to reboot the machine PostMessage FindWindow("NWatcher:WndClass", NULL), RegisterWindowMessage("NWatcher"), 0, 0 END IF UIPop 1 ELSE sz$ = UIStartDlg(CUIDLL$, RESTART, "FRebootDlgProc", APPHELP, HELPPROC$) IF sz$ = "REBOOT" THEN ' Signify that we want to restart Windows PostMessage FindWindow("NWatcher:WndClass", NULL), RegisterWindowMessage("NWatcher"), 1, 0 END IF UIPop 1 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 TOOBIG: sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus GOTO TOOBIG END IF UIPop 1 RETURN 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: '** Returns 1 if it is possible to deinstall an existing implementation '** Arguments: '** none. '** Returns: '** 0 or 1. '************************************************************************* FUNCTION OfferToDeinstall STATIC AS INTEGER cb% = 256 szBuf$ = STRING$(cb%, 32) OfferToDeinstall = 0 ' Check for VTCPRAC.386 in the SYSTEM.INI file IF BatchFileLoad(MakePath(GetWindowsDir, "SYSTEM.INI")) THEN IF BatchFindCmdReference("VTCPRAC.386", szBuf$, cb%, 1) THEN OfferToDeinstall = 1 END IF BatchFileQuit END IF END FUNCTION '** '** Purpose: '** Creates Netscape program group and associated program items '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB AddProgramItems STATIC '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 '' Program item for README file 'CreateProgmanItem Group$, "Trouble Shooting Guide", MakePath(GetWindowsDir, "NOTEPAD.EXE") +" "+ MakePath(DEST$, "ATT\WNREADME.TXT"), "", cmoOverwrite 'CreateProgmanItem Group$, "Customer Care Tools", MakePath(DEST$, "ATT\CUSTCARE.EXE"), "", cmoOverwrite 'IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN '' Program item for signup.exe 'IF bISPMode THEN 'szLabel$ = "Setup " + szISPName + " Account" ''CreateProgmanItem Group$, szLabel$, MakePath(DEST$, "DIALER\SIGNUP.EXE ISP.SR"), "", cmoOverwrite 'CreateProgmanItem Group$, szLabel$, MakePath(DEST$, "ATT\GROUPRST.EXE ADVISOR.EXE SIGNUP2"), MakePath(DEST$, "DIALER\SIGNUP.EXE"), cmoOverwrite 'ELSEIF bRegOnlyMode THEN ''CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "DIALER\SIGNUP.EXE -r"), "", cmoOverwrite 'CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "ATT\ GROUPRST.EXE ADVISOR.EXE SIGNUP3"), MakePath(DEST$, "DIALER\SIGNUP.EXE"), cmoOverwrite 'ELSE ''CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "DIALER\SIGNUP.EXE"), "", cmoOverwrite 'CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "ATT\ GROUPRST.EXE ADVISOR.EXE SIGNUP"), MakePath(DEST$, "DIALER\SIGNUP.EXE"), cmoOverwrite 'END IF 'ELSE '' Program item for netscape.exe 'CreateProgmanItem Group$, "Netscape", MakePath(DEST$, "NETSCAPE.EXE"), "", cmoOverwrite 'IF GetListItem(CHECKSTATES$, EUDORAFILES) = "ON" THEN 'CreateProgmanItem Group$, "Eudora Light email", MakePath(DEST$, "EUDORA.EXE"), "", cmoOverwrite 'END IF 'END IF ' QwikFix is now responsible for creating the program group ' instead of the commented code above WinExec MakePath(DEST$, "ATT\GROUPRST.EXE"), SW_SHOWNOACTIVE SLEEP 2 ' 24323 is the decimal representation of hex 5F03 which represents ' version 3.95 (i.e., Windows 95) IF GetVersion() >= 24323 THEN QWIKFIXDONEYET: ' Loop until the QwikFix window class is removed, indicating ' that QwikFix is exiting and has created the program group. ' This delays setup from proceeding so the program group does ' not cover up the upcoming message box from setup, allowing ' the user to finish setup properly. This only occurs in Win 95. IF FindWindow("GroupRstMainWndClassMRA", NULL) THEN SLEEP 1 GOTO QWIKFIXDONEYET END IF END IF END SUB '** '** Purpose: '** Adds a registry association for the dialer application '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB UpdateRegistry STATIC ' Create a root entry called .SR associated with "NetscapePersonalEdition" CreateRegKeyValue ".sr", "NetscapePersonalEdition" ' Create a Root entry called "NetscapePersonalEdition" CreateRegKeyValue "NetscapePersonalEdition", "Netscape Connection File" ' Set the command line for "NetscapePersonalEdition" CreateRegKeyValue "NetscapePersonalEdition\shell\open\command", MakePath(DEST$, "DIALER\DIALER.EXE")+" %1" END SUB '** '** Purpose: '** Adds a new value to the keyname value if it isn't already present '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB AppendToKeynameValue (szExisting$, szAdd$) STATIC IF szExisting$ = "" THEN szExisting$ = szAdd$ ELSEIF CommaListContains(szExisting$, szAdd$) = 0 THEN szExisting$ = szExisting$+","+szAdd$ END IF END SUB '** '** Purpose: '** Makes the necessary changes to the Windows SYSTEM.INI file '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB UpdateSystemIni STATIC szSysIni$ = MakePath(GetWindowsDir, "SYSTEM.INI") IF IsFileWritable(szSysIni$) = 0 THEN i% = DoMsgBox("Setup is unable to modify "+szSysIni$+". File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF ' Shiva specific changes AddProfileString szSysIni$, "386Enh", "device", MakePath(DEST$, "system\dial.386"), "dial.386" CreateIniKeyValue szSysIni$, "Network", "SessTimeout", "240", cmoOverwrite CreateIniKeyValue szSysIni$, "ShivaPPP", "ClaimPort", "1", cmoNone ' NTS specific changes CreateIniKeyValue szSysIni$, "VNTSTIMD", "NumTCBs", "255", cmoOverwrite AddProfileString szSysIni$, "386Enh", "device", MakePath(DEST$, "system\vtcprac.386"), "vtcprac.386" AddProfileString szSysIni$, "386Enh", "device", MakePath(DEST$, "system\vntstimd.exe"), "vntstimd.exe" END SUB '** '** Purpose: '** Checks for an old version of Personal Edition '** Arguments: '** none. '** Side Effects: '** sets wNetType% '** Returns: '** none. '************************************************************************* SUB CheckForOldVersion STATIC cb% = 256 szBuf$ = STRING$(cb%, 32) ' We cannot tell conclusively by using WNetGetCaps what the ' configuration is, so we must look for some other things instead ret% = BatchFileLoad("C:\AUTOEXEC.BAT") bNetStart% = BatchFindCmdReference("NET START", szBuf$, cb%, 1) bNetbind% = BatchFindCmdReference("NETBIND", szBuf$, cb%, 1) BatchFileQuit IF bNetStart% THEN wNetType% = WFW_NET ELSEIF bNetbind% THEN wNetType% = SOME_NET ELSE wNetType% = NO_NET END IF ' See if an old version of 1.2 PE is installed on the machine ' Check for DIALNDIS.EXE in the CONFIG.SYS file IF BatchFileLoad("c:\config.sys") THEN IF BatchFindCmdReference("DIALNDIS.EXE", szBuf$, cb%, 1) THEN ' Prompt the user before doing this IF DoMsgBox("You must deinstall Netscape Personal Edition version 1.2 before installing this version. Do you want to deinstall now?", "AT&T WorldNet Services", MB_YESNO) = IDNO THEN BatchFileQuit END ELSE BatchFileQuit Deinstall12 END IF ELSE BatchFileQuit END IF ELSE ' Check for DIALNDIS.EXE in SYSTEM.INI IF BatchFileLoad(MakePath(GetWindowsDir, "SYSTEM.INI")) THEN IF BatchFindCmdReference("DIALNDIS.EXE", szBuf$, cb%, 1) THEN i% = DoMsgBox("You must deinstall version 1.2 of Netscape Navigator Personal Edition before installing this software.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) BatchFileQuit END END IF BatchFileQuit END IF END IF END SUB '** '** 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: '** Deinstalls the product '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB Deinstall STATIC cb% = 256 szBuf$ = STRING$(cb%, 32) ' Clean up WIN.INI entries except for the Navigator itself RemoveIniKey "WIN.INI", "Netscape", "dialer", cmoNone RemoveIniKey "WIN.INI", "Netscape", "eudora", cmoNone ' Next remove device drivers from SYSTEM.INI szSysIni$ = MakePath(GetWindowsDir, "SYSTEM.INI") IF IsFileWritable(szSysIni$) = 0 THEN i% = DoMsgBox("Setup is unable to modify "+szSysIni$+". File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF RemoveProfileString szSysIni$, "386Enh", "device", "dial.386" RemoveProfileString szSysIni$, "386Enh", "device", "vtcprac.386" RemoveProfileString szSysIni$, "386Enh", "device", "vntstimd.exe" RemoveIniSection szSysIni$, "VNTSTIMD", cmoNone RemoveIniSection szSysIni$, "ShivaPPP", cmoNone IF DoesFileExist(MakePath(GetWindowsDir, "NTS.INI"), femExists) THEN RemoveFile MakePath(GetWindowsDir, "NTS.INI"), cmoNone END IF ' Remove the WINSOCK.DLL from the Netscape directory IF DoesFileExist(MakePath(DEST$, "WINSOCK.DLL"), femExists) THEN RemoveFile MakePath(DEST$, "WINSOCK.DLL"), cmoNone END IF ' Remove the program manager group DeleteProgmanGroup "AT&T WorldNet Services" ' Ask the user if they want to blow away the whole NETSCAPE directory ' IF DoMsgBox("Would you like Setup to delete the "+DEST$+" directory?", "AT&T WorldNet 'Services", MB_YESNO) = IDYES THEN RemoveIniSection "WIN.INI", "Netscape", cmoNone IF DoesDirExist( MakePath(DEST$, "att") ) THEN RemoveFile MakePath(DEST$, "att\comport.dll"), cmoForce RemoveFile MakePath(DEST$, "att\ctl3d.dll"), cmoForce RemoveFile MakePath(DEST$, "att\advisor.exe"), cmoForce RemoveFile MakePath(DEST$, "att\wnsysrpt.exe"), cmoForce RemoveFile MakePath(DEST$, "att\grouprst.exe"), cmoForce RemoveFile MakePath(DEST$, "att\getaccnt.exe"), cmoForce RemoveFile MakePath(DEST$, "att\qwikfix.exe"), cmoForce RemoveFile MakePath(DEST$, "att\launch16.exe"), cmoForce RemoveFile MakePath(DEST$, "att\qwiklook.exe"), cmoForce RemoveFile MakePath(DEST$, "att\custcare.exe"), cmoForce RemoveFile MakePath(DEST$, "att\custcare.bmp"), cmoForce RemoveFile MakePath(DEST$, "att\advisor.hlp"), cmoForce RemoveFile MakePath(DEST$, "att\wnsysrpt.hlp"), cmoForce RemoveFile MakePath(DEST$, "att\launch16.hlp"), cmoForce RemoveFile MakePath(DEST$, "att\qwiklook.hlp"), cmoForce RemoveFile MakePath(DEST$, "att\worldnet.ico"), cmoForce RemoveFile MakePath(DEST$, "att\regwiz.ico"), cmoForce RemoveFile MakePath(DEST$, "att\dialer.ico"), cmoForce RemoveFile MakePath(DEST$, "att\modems.inf"), cmoForce RemoveFile MakePath(DEST$, "att\advisor.ini"), cmoForce RemoveFile MakePath(DEST$, "att\wnsysrpt.ini"), cmoForce RemoveFile MakePath(DEST$, "att\grouprst.ini"), cmoForce RemoveFile MakePath(DEST$, "att\launcher.ini"), cmoForce RemoveFile MakePath(DEST$, "att\modems.ini"), cmoForce RemoveFile MakePath(DEST$, "att\qwiklook.ini"), cmoForce RemoveFile MakePath(DEST$, "att\qwikfix.ini"), cmoForce RemoveFile MakePath(DEST$, "att\wnreadme.txt"), cmoForce RemoveFile MakePath(DEST$, "att"), cmoForce END IF IF DoesDirExist(DEST$) THEN RemoveDirRecurse DEST$ END IF ' END IF i% = DoMsgBox("The software has been succesfully deinstalled. Run Setup again to reinstall.", "AT&T WorldNet Services", MB_OK) END SUB '** '** Purpose: '** Deinstalls the 1.2 product '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB Deinstall12 STATIC cb% = 256 szBuf$ = STRING$(cb%, 32) ' First handle CONFIG.SYS IF IsFileWritable("c:\config.sys") = 0 THEN i% = DoMsgBox("Setup is unable to modify CONFIG.SYS. File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF IF BatchFileLoad("c:\config.sys") THEN IF BatchFindCmdReference(MakePath(DEST$, "NDIS\PROTMAN.DOS"), szBuf$, cb%, 1) THEN ret% = BatchRemoveCmd END IF IF BatchFindCmdReference("DIALNDIS.EXE", szBuf$, cb%, 1) THEN ret% = BatchRemoveCmd END IF IF BatchFindCmdReference("VTCPRMT.EXE", szBuf$, cb%, 1) THEN ret% = BatchRemoveCmd END IF IF BatchFileSave = 0 THEN i% = DoMsgBox("Setup was unable to modify CONFIG.SYS.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF END IF ' Next handle AUTOEXEC.BAT IF IsFileWritable("c:\autoexec.bat") = 0 THEN i% = DoMsgBox("Setup is unable to modify AUTOEXEC.BAT. File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF IF BatchFileLoad("c:\autoexec.bat") THEN IF BatchFindVariable("SHIVA", szBuf$, cb%, 1) THEN ret% = BatchRemoveVariable END IF IF BatchFindCmdReference(MakePath(DEST$, "NDIS\NETBIND"), szBuf$, cb%, 1) THEN ret% = BatchRemoveCmd END IF IF BatchFileSave = 0 THEN i% = DoMsgBox("Setup was unable to modify AUTOEXEC.BAT.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF END IF ' Clean up WIN.INI entries except for the Navigator itself RemoveIniKey "WIN.INI", "Netscape", "dialer", cmoNone RemoveIniKey "WIN.INI", "Netscape", "eudora", cmoNone ' Next remove device drivers from SYSTEM.INI szSysIni$ = MakePath(GetWindowsDir, "SYSTEM.INI") IF IsFileWritable(szSysIni$) = 0 THEN i% = DoMsgBox("Setup is unable to modify "+szSysIni$+". File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF RemoveProfileString szSysIni$, "386Enh", "device", "dial.386" RemoveProfileString szSysIni$, "386Enh", "device", "vntstimd.exe" RemoveIniSection szSysIni$, "VNTSTIMD", cmoNone ' Now remove all files that we added to the Windows and the System directories IF DoesFileExist(MakePath(GetWindowsDir, "DIALNDIS.EXE"), femExists) THEN RemoveFile MakePath(GetWindowsDir, "DIALNDIS.EXE"), cmoNone END IF IF DoesFileExist(MakePath(GetWindowsDir, "VTCPRMT.EXE"), femExists) THEN RemoveFile MakePath(GetWindowsDir, "VTCPRMT.EXE"), cmoNone END IF IF DoesFileExist(MakePath(GetWindowsSysDir, "VNTSTIMD.EXE"), femExists) THEN RemoveFile MakePath(GetWindowsSysDir, "VNTSTIMD.EXE"), cmoNone END IF IF DoesFileExist(MakePath(GetWindowsSysDir, "DIAL.386"), femExists) THEN RemoveFile MakePath(GetWindowsSysDir, "DIAL.386"), cmoNone END IF IF DoesFileExist(MakePath(GetWindowsDir, "NTS.INI"), femExists) THEN RemoveFile MakePath(GetWindowsDir, "NTS.INI"), cmoNone END IF ' Remove the WINSOCK.DLL from the Netscape directory IF DoesFileExist(MakePath(DEST$, "WINSOCK.DLL"), femExists) THEN RemoveFile MakePath(DEST$, "WINSOCK.DLL"), cmoNone END IF ' We need to reboot the machine when we're done bRebootMachine% = 1 END SUB '** '** Purpose: '** Builds the copy list and performs all installation operations. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB Install STATIC cb% = 256 szBuf$ = STRING$(cb%, 32) szSrcDir$ = GetSymbolValue("STF_SRCDIR") ' Create user specified directory and CACHE sub-directory CreateDir DEST$, cmoNone CreateDir MakePath(DEST$, "CACHE"), cmoNone ' Add files to copy ClearCopyList AddOptFilesToCopyList APPFILES AddOptFilesToCopyList STACKFILES AddOptFilesToCopyList EUDORAFILES IF bISPMode THEN AddSectionFilesToCopyList "ISP", SRC$, DEST$ END IF ' Add some billboards IF bISPMode THEN AddToBillboardList "mscuistf.dll", BILLBOARD1, "FModelessDlgProc", 1 AddToBillboardList "mscuistf.dll", BILLBOARD2, "FModelessDlgProc", 1 ELSE AddToBillboardList "mscuistf.dll", BILLBOARD1, "FModelessDlgProc", 1 AddToBillboardList "mscuistf.dll", BILLBOARD2, "FModelessDlgProc", 1 'AddToBillboardList "mscuistf.dll", BILLBOARD3, "FModelessDlgProc", 1 END IF ' Do the actual copy SetCopyGaugePosition 85, 130 CopyFilesInCopyList ' Merge OLE2 registration into system registry WinExec "REGEDIT /S OLE2.REG", SW_SHOW ' Modify launcher.ini to reflect the correct path names CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Netscape", "app1", DEST$+",netscape.exe", cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Netscape", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "AttDial", "app1", MakePath(DEST$, "dialer")+",dialer.exe att.sr", cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "AttDial", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Eudora", "app1", DEST$+",eudora.exe "+DEST$+"\eudora", cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Eudora", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup", "app1", MakePath(Dest$, "dialer")+",signup.exe", cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup2", "app1", MakePath(Dest$, "dialer")+",signup.exe isp.sr", cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup2", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup3", "app1", MakePath(Dest$, "dialer")+",signup.exe -r", cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup3", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Advisor", "Dialer", MakePath(DEST$, "dialer\dialer.exe"), cmoOverwrite ' Modify the win.ini file to have a [Netscape] section with a keyname-value ' pair for the Netscape INI file location and for the dialer CreateIniKeyValue "WIN.INI", "Netscape", "ini", MakePath(DEST$, "NETSCAPE.INI"), cmoOverwrite IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN CreateIniKeyValue "WIN.INI", "Netscape", "dialer", MakePath(DEST$, "DIALER"), cmoOverwrite END IF IF GetListItem(CHECKSTATES$, EUDORAFILES) = "ON" THEN CreateIniKeyValue "WIN.INI", "Netscape", "eudora", MakePath(DEST$, "EUDORA"), cmoOverwrite END IF 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 IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN ' Create NTS.INI file with WINSOCK section CreateIniKeyValue MakePath(GetWindowsDir, "NTS.INI"), "WINSOCK", "ETCDIR", MakePath(DEST$, "DIALER"), cmoOverwrite CreateIniKeyValue MakePath(GetWindowsDir, "NTS.INI"), "Installation", "PATH", MakePath(DEST$, "DIALER"), cmoOverwrite ' Backup the files we are going to change (only do this once) IF DoesFileExist(MakePath(DEST$, "system.ini"), femExists) = 0 THEN CopyFile MakePath(GetWindowsDir, "system.ini"), MakePath(DEST$, "system.ini"), cmoNone, 0 END IF ' Update the system.ini file UpdateSystemIni ' Make sure the SHIVA environment variable isn't set. If it is then make sure it is correct IF BatchFileLoad("c:\autoexec.bat") THEN IF BatchFindVariable("SHIVA", szBuf$, cb%, 1) THEN ret% = BatchReplaceVariable(MakePath(DEST$, "DIALER")) IF BatchFileSave = 0 THEN i% = DoMsgBox("Setup was unable to modify AUTOEXEC.BAT.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF bRebootMachine% = 1 ELSE BatchFileQuit END IF END IF ' Add a registry association for the dialer UpdateRegistry END IF ' Add a program group and associated program items AddProgramItems IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN IF bReinstall% = 0 THEN ' Inform the user that we have modified their files szText$ = "Setup has modified your SYSTEM.INI file" szText$ = szText$ + ". A copy of the old file has been placed in directory " + DEST$ i% = DoMsgBox(szText$, "AT&T WorldNet Services", MB_OK) szText$ = "" END IF END IF END SUB '** '** Purpose: '** Adds the specified option files to the copy list. '** Arguments: '** ftype% - type of files to add, one of the following: '** APPFILES, STACKFILES, EUDORAFILES '** Returns: '** none. '************************************************************************* SUB AddOptFilesToCopyList (ftype%) STATIC IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN SrcDir$ = GetSymbolValue("STF_SRCDIR") IF ftype% = APPFILES THEN AddSectionFilesToCopyList "Files", SrcDir$, DEST$ AddSectionFilesToCopyList "OLE2", SrcDir$, GetWindowsSysDir ELSEIF ftype% = STACKFILES THEN AddSectionFilesToCopyList "DIALER", SrcDir$, DEST$ AddSectionFilesToCopyList "CTL3D", SrcDir$, GetWindowsSysDir AddSectionFilesToCopyList "SYSTEM", SrcDir$, DEST$ ELSEIF ftype% = EUDORAFILES THEN AddSectionFilesToCopyList "EUDORA", SrcDir$, DEST$ END IF SrcDir$ = "" END IF END SUB '** '** Purpose: '** Recalculates disk space for the given option files and sets '** the status info symbol "StatusItemsText". '** Arguments: '** ftype% - type of files to add, one of the following: '** APPFILES, STACKFILES, EUDORAFILES '** Returns: '** none. '************************************************************************* SUB RecalcOptFiles (ftype%) STATIC ClearCopyList AddOptFilesToCopyList ftype% fExtra% = 0 IF ftype% = APPFILES THEN ListSym$ = APPNEEDS$ ''Add extra cost to Windows drive for ini/progman, etc. ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1 ' ReplaceListItem EXTRACOSTS$, ndrive%, "10240" fExtra% = 1 ELSEIF ftype% = STACKFILES THEN ListSym$ = STACKNEEDS$ ELSEIF ftype% = EUDORAFILES THEN ListSym$ = EUDORANEEDS$ END IF StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "") cost& = 0 FOR i% = 1 TO 26 STEP 1 cost& = cost& + VAL(GetListItem(ListSym$, i%)) NEXT i% ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K" IF StillNeed& > 0 THEN ReplaceListItem BIGLIST$, ftype%, "YES" ELSE ReplaceListItem BIGLIST$, ftype%, "" END IF IF fExtra% THEN ReplaceListItem EXTRACOSTS$, ndrive%, "0" END IF ListSym$ = "" END SUB '** '** Purpose: '** Recalculates disk space and sets option status info according '** to the current destination path. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB RecalcPath STATIC CursorSave% = ShowWaitCursor() RecalcOptFiles APPFILES RecalcOptFiles STACKFILES RecalcOptFiles EUDORAFILES RestoreCursor CursorSave% END SUB '** '** Purpose: '** Sets drive status info according to latest disk space calcs. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB SetDriveStatus STATIC drive$ = MID$(DEST$, 1, 1) ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1 cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(STACKNEEDS$, ndrive%)) + VAL(GetListItem(EUDORANEEDS$, ndrive%)) free& = GetFreeSpaceForDrive(drive$) ReplaceListItem DRIVETEXT$, 1, STR$(cost& / 1024) + " K" ReplaceListItem DRIVETEXT$, 2, STR$(free& / 1024) + " K" 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