home *** CD-ROM | disk | FTP | other *** search
/ Harley Hahn's Internet & Web Yellow Pages 1997 / YellowPages1997.iso / pc / disk1 / setup.ms_ / setup.bin
Encoding:
Text File  |  1996-02-10  |  48.4 KB  |  1,323 lines

  1. '============================================================================
  2. '           
  3. '
  4. ' $Workfile: SETUP.MST $
  5. ' $Revision: 21 $
  6. ' $Date: 2/13/96 12:39p $
  7. '
  8. ' Authors: Modified by Lisa Angelini.  Original from Netscape
  9. '
  10. ' Purpose: This script file is used by MS Setup to create installation
  11. '       procedures.  We have modified this script from Netscape for
  12. '       the installation and setup of our files.
  13. '
  14. ' $History: SETUP.MST $
  15. ' *****************  Version 21  *****************
  16. ' User: Lisa         Date: 2/13/96    Time: 12:39p
  17. ' Updated in $/WorldNet.16/Install
  18. ' 1.  Moved the "Would you like to delete the _ directory" message box
  19. ' after the message box that says "Are you sure you want to deinstall
  20. ' AT&T WorldNet Services".  Now, both message boxes are reworded and
  21. ' follow one after another.  No longer will the user be able to save the
  22. ' directory if they decide to deinstall.  When they answer yes to the
  23. ' Warning message box, everything is removed.
  24. ' *****************  Version 20  *****************
  25. ' User: Lisa         Date: 1/31/96    Time: 11:34a
  26. ' Updated in $/WorldNet.16/Install
  27. ' 1.  Set claimport to 1 in our modification of system.ini for shivappp
  28. ' *****************  Version 19  *****************
  29. ' User: Lisa         Date: 1/30/96    Time: 2:41p
  30. ' Updated in $/WorldNet.16/Install
  31. ' 1.  Changed GroupRst's class name to the new one that Mike changed it
  32. ' to.
  33. ' 2.  Reworded the message box that appears when we detect the user does
  34. ' not have a PE installation.
  35. ' *****************  Version 18  *****************
  36. ' User: Baumeister   Date: 1/26/96    Time: 10:26a
  37. ' Updated in $/WorldNet.16/Install
  38. ' Added custcare.bmp to the deinstall list.
  39. ' *****************  Version 17  *****************
  40. ' User: Lisa         Date: 1/25/96    Time: 6:57p
  41. ' Updated in $/WorldNet.16/Install
  42. ' 1.  changed commented code to have new names of grouprst.exe and
  43. ' advisor.exe
  44. ' 2.  changed the launcher.ini to advisor.ini where the ini file gets
  45. ' updated with the correct directory for our installation.
  46. ' *****************  Version 16  *****************
  47. ' User: Lisa         Date: 1/25/96    Time: 5:35p
  48. ' Updated in $/WorldNet.16/Install
  49. ' 1.  Change last place where qwikfix.exe needed to be changed to
  50. ' grouprst.exe.
  51. ' *****************  Version 15  *****************
  52. ' User: Lisa         Date: 1/23/96    Time: 4:58p
  53. ' Updated in $/WorldNet/Install
  54. ' 1.  Put in check for LAN version, i.e. not a PE version.  The typical
  55. ' option will always give C:\worldnet if we find and entry in win.ini for
  56. ' a previous installation.
  57. ' 2.  added dialer.ico to deletion list.
  58. ' *****************  Version 14  *****************
  59. ' User: Lisa         Date: 1/11/96    Time: 4:21p
  60. ' Updated in $/WorldNet/Install
  61. ' Updated with the latest release from Netscape.  This is a merged
  62. ' version of their changes (mostly Service to Services) and our changes.
  63. ' Also added the new names wnsysrpt, advisor, and grouprst to the list of
  64. ' files to be deinstalled.
  65. ' *****************  Version 13  *****************
  66. ' User: Lisa         Date: 12/15/95   Time: 1:56p
  67. ' Updated in $/WorldNet/Install
  68. ' 1.  Added a version check for Win 95 and a loop to check if QwikFix is
  69. ' finished executing, which indicates that the program group is created.
  70. ' This is needed only for Windows 95 because setup was continuing to
  71. ' proceed even though QwikFix hadn't finished creating the program group.
  72. ' As a result, the Setup message box to continue with installation was
  73. ' hidden from the user by the program group.  This happened only in
  74. ' Windows 95.
  75. ' *****************  Version 12  *****************
  76. ' User: Lisa         Date: 12/14/95   Time: 1:05p
  77. ' Updated in $/WorldNet/Install
  78. ' 1.  changed sections names AT&&T WorldNet Services and AT&&T Dial back
  79. ' to Netscape and AttDial.
  80. ' *****************  Version 11  *****************
  81. ' User: Lisa         Date: 12/13/95   Time: 12:12p
  82. ' Updated in $/WorldNet/Install
  83. ' 1.  Change AT&T WorldNet(SM) Servics back to AT&T WorldNet Service
  84. ' until Netscape can make the appropriate changes in signup.exe.
  85. ' *****************  Version 10  *****************
  86. ' User: Lisa         Date: 12/13/95   Time: 11:54a
  87. ' Updated in $/WorldNet/Install
  88. ' 1.  Changed the DeleteProgmanGroup argument to AT&T WorldNet(SM)
  89. ' Services so the program group gets deleted on deinstall.
  90. ' 2.  Remove all the code in the subroutine AddProgramItems, except for
  91. ' ShowWindow on the program manager and added a call to WinExec
  92. ' QwikFix.exe.  This creates the program group items now.
  93. ' *****************  Version 9  *****************
  94. ' User: Lisa         Date: 12/12/95   Time: 3:40p
  95. ' Updated in $/WorldNet/Install
  96. ' 1.  Changed name of shiva section to ShivaPPP and its entry to
  97. ' ClaimPort.
  98. ' *****************  Version 8  *****************
  99. ' User: Lisa         Date: 12/12/95   Time: 11:15a
  100. ' Updated in $/WorldNet/Install
  101. ' 1.  WinExec qwikfix.exe after program group is created in case the user
  102. ' did a reinstall and there are two registration wizard icons present.
  103. ' 2.  Changed all Service text to Services.
  104. ' 3.  Modified the system.ini entry for shiva to be shivappp not
  105. ' shiva.ppp
  106. ' 4.  Added removal of shivappp entry in system.ini if user selects
  107. ' deinstall.
  108. ' 5.  Using signup.exe not regwiz.ico for the wrapped registration wizard
  109. ' icon.
  110. ' 6.  Added qwiklook.ini and getaccnt.exe to list of files to delete on
  111. ' deinstall.
  112. ' 7.  Changed customer care icon title to Customer Care Tools.
  113. ' 8.  Added full path to command line for notepad for the Read Me icon.
  114. ' 9.  Added full path to command line for customer care icon.
  115. ' 10.  Changed Netscape to AT&&T WorldNet Services in the section where
  116. ' the launcher.ini file gets modified.
  117. ' 11.  Same as 10.  Changed Att Dial to AT&&T Dial.
  118. ' *****************  Version 7  *****************
  119. ' User: Lisa         Date: 11/22/95   Time: 3:14p
  120. ' Updated in $/WorldNet/Install
  121. ' 1.  Changed the launcher.ini file so eudora has the full path for its
  122. ' argument (directory).
  123. ' *****************  Version 6  *****************
  124. ' User: Lisa         Date: 11/21/95   Time: 3:59p
  125. ' Updated in $/WorldNet/Install
  126. ' 1.  Removed an extra " from line 917.
  127. ' *****************  Version 5  *****************
  128. ' User: Lisa         Date: 11/20/95   Time: 2:14p
  129. ' Updated in $/WorldNet/Install
  130. ' 1.  Removed QwikLook.exe and added CustCare.exe to the program group.
  131. ' 2.  Added CustCare.exe to list of files to be removed.
  132. ' 3.  Added launcher section to be updated in the launcher.ini so it has
  133. ' the correct directory where worldnet was installed into.
  134. ' *****************  Version 4  *****************
  135. ' User: Lisa         Date: 11/16/95   Time: 10:00a
  136. ' Updated in $/WorldNet/Install
  137. ' Remove qwiklook.ini from script since it doesn't exist yet.
  138. ' *****************  Version 3  *****************
  139. ' User: Lisa         Date: 11/15/95   Time: 2:50p
  140. ' Updated in $/WorldNet/Install
  141. ' Added line to remove qwikfix.ini.
  142. ' *****************  Version 2  *****************
  143. ' User: Lisa         Date: 11/13/95   Time: 4:52p
  144. ' Updated in $/WorldNet/Install
  145. ' 1.  Changed fixup.exe to qwikfix.exe everywhere.
  146. ' 2.  Changed the Read Me icon to point to our readme file
  147. ' att\wnreadme.txt.
  148. ' 3.  Added line to delete worldnet.ico.
  149. ' *****************  Version 1  *****************
  150. ' User: Lisa         Date: 11/07/95   Time: 5:15p
  151. ' Created in $/WorldNet/Install
  152. '============================================================================
  153.  
  154. '**************************************************************************
  155. '*                              Netscape Setup
  156. '**************************************************************************
  157.  
  158. '$DEFINE DEBUG  ''Define for script development/debugging
  159.  
  160. '$INCLUDE 'setupapi.inc'
  161. '$INCLUDE 'msdetect.inc'
  162. '$INCLUDE 'msregdb.inc'
  163.  
  164. ''Dialog ID's
  165. CONST WELCOME       = 100
  166. CONST ASKQUIT       = 200
  167. CONST PROGROUP      = 260
  168. CONST DESTPATH      = 300
  169. CONST EXITFAILURE   = 400
  170. CONST EXITQUIT      = 600
  171. CONST EXITSUCCESS   = 700
  172. CONST OPTIONS       = 800
  173. CONST APPHELP       = 900
  174. CONST REBOOT        = 1000
  175. CONST RESTART       = 1001
  176. CONST BADPATH       = 6400
  177. CONST EXISTING      = 160
  178. CONST BILLBOARD1    = 320
  179. CONST BILLBOARD2    = 340
  180. CONST BILLBOARD3    = 360
  181. CONST CUSTINST      = 6200
  182. CONST INSTALLTYPE   = 6500
  183. CONST TOOBIG        = 6300
  184.  
  185. ''Bitmap ID
  186. CONST LOGO = 1
  187.  
  188. ''File Types
  189. CONST APPFILES     = 1
  190. CONST STACKFILES   = 2
  191. CONST EUDORAFILES  = 3
  192.  
  193. GLOBAL DEST$        ''Default destination directory.
  194. GLOBAL SRC$         ''Default source directory
  195. GLOBAL WINDRIVE$    ''Windows drive letter.
  196.  
  197. ''CustInst list symbol names
  198. GLOBAL APPNEEDS$    ''Option list costs per drive
  199. GLOBAL STACKNEEDS$
  200. GLOBAL EUDORANEEDS$
  201. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  202. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  203.  
  204. ''Dialog list symbol names
  205. GLOBAL CHECKSTATES$
  206. GLOBAL STATUSTEXT$
  207. GLOBAL DRIVETEXT$
  208.  
  209. ' Constants used internaly to indicate which install
  210. ' configuration we are dealing with
  211. CONST NO_NET    = 0      ''No NDIS network currently installed
  212. CONST SOME_NET  = 1      ''Non-WFW NDIS network installed
  213. CONST WFW_NET   = 2      ''WFW network installed (not necessarily MultiNet, but uses "net start")
  214.  
  215. GLOBAL wNetType%         ''One of the constants above
  216. GLOBAL bReinstall%       ''User is reinstalling
  217. GLOBAL bRebootMachine%   ''Reboot machine or just restart Windows
  218. GLOBAL bISPMode%         ''Are we doing an ISP configuration?
  219. GLOBAL bRegOnlyMode%     ''Are we reg server only install?
  220. GLOBAL szISPName$        ''The name of the ISP if in ISP mode
  221.  
  222. ' Miscellaneous Windows constants not defined in existing .INC files
  223. CONST SW_MINIMIZE = 6
  224. CONST SW_RESTORE  = 9
  225.  
  226. CONST SW_SHOWNOACTIVATE = 4
  227. CONST SW_SHOW     = 5
  228.  
  229. CONST IDYES = 6
  230. CONST IDNO  = 7
  231.  
  232. CONST WNNC_NET_MultiNet         = &H8000
  233. CONST WNNC_SUBNET_WinWorkgroups = 4
  234. CONST WNNC_NET_TYPE             = 2
  235. CONST WNNC_NET_NONE             = 0
  236.  
  237. DECLARE FUNCTION FindWindow LIB "user" (szClassName$, szWindow$) AS INTEGER
  238. DECLARE FUNCTION ExitWindows LIB "user" (dwReturnCode&, nReserved%) AS INTEGER
  239. DECLARE SUB      ShowWindow LIB "user" (hwnd%, nCmdShow%)
  240. DECLARE FUNCTION WNetGetCaps LIB "user" (nIndex%) AS INTEGER
  241. DECLARE SUB      WinExec LIB "kernel" (szCmdLine$, nCmdShow%)
  242. DECLARE SUB      PostMessage LIB "user" (hwnd%, msg%, wParam%, lParam&)
  243. DECLARE FUNCTION RegisterWindowMessage LIB "user" (szMessage$) AS INTEGER
  244.  
  245. DECLARE FUNCTION IsWindows30 LIB "mscuistf.dll" () AS INTEGER
  246. DECLARE FUNCTION IsISPMode LIB "mscuistf.dll" (szPath$) AS INTEGER
  247. DECLARE FUNCTION IsRegOnlyMode LIB "mscuistf.dll" (szPath$) AS INTEGER
  248. DECLARE SUB      HandleMultipleConfigurations LIB "mscuistf.dll" ()
  249. DECLARE FUNCTION CommaListContains LIB "mscuistf.dll" (szStr1$, szStr2$) AS INTEGER
  250. DECLARE SUB      GetProtmanPath LIB "mscuistf.dll" (szBuf$)
  251. DECLARE FUNCTION InstallOemsetup LIB "mscuistf.dll" (szPath$) AS INTEGER
  252. DECLARE FUNCTION IsNTSWinsock LIB "mscuistf.dll" (szPath$) AS INTEGER
  253. DECLARE FUNCTION IsBadWin32s LIB "mscuistf.dll" () AS INTEGER
  254. DECLARE SUB      RemoveDirRecurse LIB "mscuistf.dll" (szPath$)
  255. DECLARE SUB      DeleteProgmanGroup LIB "mscuistf.dll" (szGroup$)
  256.  
  257. ' Helper routine to update NETSCAPE.INI if Netscape is installed in a
  258. ' directory other than C:\NETSCAPE
  259. DECLARE SUB      UpdateNetscapeIni LIB "mscuistf.dll" (szIniPath$)
  260.  
  261. ' Routines to modify a section of an .INI file
  262. DECLARE SUB      AddProfileString LIB "mscuistf.dll" (szFileName$, szSection$, szKey$, szValue$, szRef$)
  263. DECLARE SUB      RemoveProfileString LIB "mscuistf.dll" (szFileName$, szSection$, szKey$, szRef$)
  264.  
  265. ' Routines to modify batch files
  266. DECLARE FUNCTION BatchFileLoad LIB "mscuistf.dll" (szPath$) AS INTEGER
  267. DECLARE FUNCTION BatchFileSave LIB "mscuistf.dll" () AS INTEGER
  268. DECLARE SUB      BatchFileQuit LIB "mscuistf.dll" ()
  269. DECLARE FUNCTION BatchAddVariable LIB "mscuistf.dll" (szVar$, szValue$, szRefKey$, bInsertBefore%) AS INTEGER
  270. DECLARE FUNCTION BatchFindVariable LIB "mscuistf.dll" (szVar$, szBuf$, nBufLen%, bRestart%) AS INTEGER
  271. DECLARE FUNCTION BatchReplaceVariable LIB "mscuistf.dll" (szValue$) AS INTEGER
  272. DECLARE FUNCTION BatchRemoveVariable LIB "mscuistf.dll" AS INTEGER
  273. DECLARE FUNCTION BatchAddCmd LIB "mscuistf.dll" (szCmd$, szRefKey$, bInsertBefore%) AS INTEGER
  274. DECLARE FUNCTION BatchFindCmdReference LIB "mscuistf.dll" (szRefKey$, szBuf$, nBufLen%, bRestart%) AS INTEGER
  275. DECLARE FUNCTION BatchReplaceCmd LIB "mscuistf.dll" (szCmd$) AS INTEGER
  276. DECLARE FUNCTION BatchRemoveCmd LIB "mscuistf.dll" AS INTEGER
  277.  
  278. ' Local routines
  279. DECLARE SUB      Install
  280. DECLARE SUB      Deinstall
  281. DECLARE SUB      Deinstall12
  282. DECLARE SUB      CreateNewsDir (szNetscapeIni$, szNewsDir$)
  283. DECLARE SUB      CheckForOldVersion
  284. DECLARE SUB      AddProgramItems
  285. DECLARE SUB      UpdateSystemIni
  286. DECLARE SUB      UpdateAutoexec
  287. DECLARE SUB      UpdateConfigSys
  288. DECLARE SUB      UpdateProtocolIni
  289. DECLARE SUB      UpdateRegistry
  290. DECLARE SUB      AppendToKeynameValue (szExisting$, szAdd$)
  291. DECLARE FUNCTION BuildOemFileName (x%) AS STRING
  292. DECLARE SUB      AddOptFilesToCopyList (ftype%)
  293. DECLARE SUB      RecalcOptFiles (ftype%)
  294. DECLARE SUB      RecalcPath
  295. DECLARE SUB      SetDriveStatus
  296. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  297. DECLARE FUNCTION OfferToDeinstall () AS INTEGER
  298.  
  299. INIT:
  300.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  301.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  302.  
  303.     bReinstall% = 0
  304.     bRebootMachine% = 0
  305.  
  306.     SRC$ = GetSymbolValue("STF_SRCDIR")
  307.         
  308.     bISPMode = IsISPMode(SRC$)
  309.     bRegOnlyMode = IsRegOnlyMode(SRC$)
  310.     
  311.     IF bISPMode THEN
  312.         szInstallINI$ = SRC$ + "install.ini"
  313.         szISPName$ = GetIniKeyString(szInstallINI$, "Install Options", "ISPName")
  314.     END IF
  315.  
  316.     SetBitmap CUIDLL$, LOGO
  317.     szTitle$ = "AT&T WorldNet Services"
  318.     
  319.     IF bISPMode THEN
  320.         szTitle$ = szTitle$ + " for " + szISPName$
  321.     END IF
  322.  
  323.     SetTitle szTitle$
  324.  
  325.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  326.     IF szInf$ = "" THEN
  327.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  328.     END IF
  329.     ReadInfFile szInf$
  330.  
  331.     ' Check to make sure we are not running Windows 3.0
  332.     IF IsWindows30 THEN
  333.         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)
  334.         END
  335.     END IF
  336.  
  337.     ' See if the user is running a version of Win32s less than 1.2
  338.     IF IsBadWin32s() THEN
  339.         szErrText$ = "Version 1.2 of the AT&T WorldNet Services uses OLE 2.02, which is not compatible with this version of Win32s."
  340.         szErrText$ = szErrText + " You must upgrade to Win32s version 1.2 before installing the AT&T WorldNet Services."
  341.         szErrText$ = szErrText + Chr$(10) + "For more information, please read the AT&T WorldNet Services Troubleshooting Guide."
  342.         i% = DoMsgBox(szErrText$, "AT&T WorldNet Services", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  343.         END
  344.     END IF
  345.  
  346.     ' Launch our companion app to watch for us to terminate
  347.     WinExec MakePath(GetSymbolValue("STF_SRCDIR"), "watcher.exe"), SW_SHOWNOACTIVE
  348.  
  349.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  350.  
  351.     ' If there is an existing Netscape installation then use the current
  352.     ' directory as the default location; otherwise use \NETSCAPE
  353.     DEST$ = GetIniKeyString("WIN.INI", "Netscape", "ini")
  354.  
  355.     IF OfferToDeinstall  THEN
  356.         IF DEST$ = "" THEN
  357.             DEST$ = MID$(GetWindowsDir, 1, 1) + ":\WORLDNET"
  358.            ELSE
  359.             SPLITPATH DEST$, drv$, dir$, filename$, ext$
  360.             DEST$ = drv$ + MID$(dir$, 1, LEN(dir$) - 1)
  361.             END IF
  362. ELSE
  363.         IF DEST$ <> "" THEN
  364.             SPLITPATH DEST$, drv$, dir$, filename$, ext$
  365.             DEST$ = drv$ + MID$(dir$, 1, LEN(dir$) - 1)
  366.             szText$ = "AT&T WorldNet Services has detected a version of Netscape installed in the " 
  367.             szText$= szText$+DEST$+" directory.  This may be a LAN version, or a "
  368.             szText$= szText$+"Netscape browser that you use with your own stack and dialer."
  369.             szText$= szText$+"   AT&T WorldNet Services will be installed in the "
  370.             szText$=szText$+MID$(GetWindowsDir, 1, 1)+":\WORLDNET directory, "
  371.             szText$= szText$+"unless you specify a different directory using the Custom option later during this setup process.  " 
  372.             szText$=szText$+"After Setup and Registration are complete, it is strongly recommended that "
  373.             szText$=szText$+" you read the section of the Troubleshooting Guide titled 'If You Already Have Netscape Installed'." 
  374.             i% = DoMsgBox(szText$, "AT&T WorldNet Services", MB_OK+TASKMODAL+MB_ICONINFORMATION)
  375.         END IF
  376.         DEST$ = MID$(GetWindowsDir, 1, 1) + ":\WORLDNET"
  377.     END IF
  378.  
  379.     ' Check for an old version
  380.     CheckForOldVersion
  381.  
  382. WELCOME:
  383.     ' If there is an existing 1.2 configuration, then offer to let the user
  384.     ' deinstall the product
  385.     IF OfferToDeinstall THEN
  386.         sz$ = UIStartDlg(CUIDLL$, EXISTING, "FExistingDlgProc", APPHELP, HELPPROC$)
  387.         IF sz$ = "DEINSTALL" THEN
  388.             ' Get user to confirm
  389.             IF DoMsgBox("Are you sure you want to deinstall the software in the "+DEST$+" directory?", "AT&T WorldNet Services", MB_YESNO) = IDNO THEN
  390.             GOTO WELCOME
  391.             END IF
  392.  
  393.             ' Ask the user if they are sure they want to blow away the whole directory
  394.             szText$="Warning! Deinstalling this software will remove ALL files in the "+DEST$+" directory"
  395.             szText$ =szText$+", including ALL non-Netscape files that are in this directory.  Are you sure you want to deinstall?" 
  396.                 IF DoMsgBox(szText$, "AT&T WorldNet Services", MB_YESNO+MB_ICONHAND) = IDNO THEN
  397.             GOTO WELCOME
  398.             ENDIF
  399.     
  400.             UIPop 1
  401.             Deinstall
  402.             END
  403.         ELSEIF sz$ <> "CONTINUE" THEN
  404.             GOSUB ASKQUIT
  405.             GOTO WELCOME
  406.         ELSE
  407.             bReinstall% = 1
  408.             ' Change the network type to NO_NET. This way if either the user wants to
  409.             ' reinstall in a different directory or the existing installation is incomplete
  410.             ' (e.g. no NDIS directory) we do the correct thing
  411.             wNetType% = NO_NET
  412.         END IF
  413.     ELSE
  414.         sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  415.         IF sz$ <> "CONTINUE" THEN
  416.             GOSUB ASKQUIT
  417.             GOTO WELCOME
  418.         END IF
  419.     END IF
  420.     UIPop 1
  421.  
  422.     CHECKSTATES$ = "CheckItemsState"
  423.     FOR i% = 1 TO 3 STEP 1
  424.         AddListItem CHECKSTATES$, "ON"
  425.     NEXT i%
  426.  
  427. ASKINSTALL:
  428.     SetSymbolValue "RadioDefault", "1"
  429.     SetSymbolValue "InstallDir", DEST$
  430.  
  431. ASK1:
  432.     ''Find out whether the user wants a simple or custom install
  433.     sz$ = UIStartDlg(CUIDLL$, INSTALLTYPE, "FRadioDlgProc", APPHELP, HELPPROC$)
  434.     IF sz$ = "CONTINUE" THEN
  435.         UIPOP 1
  436.         IF GetSymbolValue("ButtonChecked") = "1" THEN
  437.             GOTO CHOOSEGROUP
  438.         END IF
  439.     ELSEIF sz$ = "REACTIVATE" THEN
  440.         GOTO ASK1
  441.     ELSE
  442.         GOSUB ASKQUIT
  443.         GOTO ASKINSTALL
  444.     END IF
  445.  
  446. SETUPCUSTINST:
  447.     ''CustInst list symbols
  448.     STATUSTEXT$  = "StatusItemsText"
  449.     DRIVETEXT$   = "DriveStatusText"
  450.     FOR i% = 1 TO 3 STEP 1
  451.         AddListItem STATUSTEXT$, ""
  452.     NEXT i%
  453.     FOR i% = 1 TO 3 STEP 1
  454.         AddListItem DRIVETEXT$, ""
  455.     NEXT i%
  456.     ReplaceListItem DRIVETEXT$, 3, DEST$
  457.  
  458.     ''Disk cost list symbols
  459.     APPNEEDS$    = "AppNeeds"
  460.     STACKNEEDS$  = "StackNeeds"
  461.     EUDORANEEDS$ = "EudoraNeeds"
  462.     EXTRACOSTS$  = "ExtraCosts"
  463.     BIGLIST$     = "BigList"
  464.     FOR i% = 1 TO 3 STEP 1
  465.         AddListItem BIGLIST$, ""
  466.     NEXT i%
  467.     FOR i% = 1 TO 26 STEP 1
  468.         AddListItem EXTRACOSTS$, "0"
  469.     NEXT i%
  470.  
  471.     RecalcPath
  472.     SetDriveStatus
  473.  
  474. CUSTINST:
  475.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  476.  
  477.     ' Note that there is no CHK1 returned as a notification. That is because
  478.     ' we treat the APPFILES as CHK1
  479.     IF sz$ = "CONTINUE" THEN
  480.         ''Install only if it will fit.
  481.         FOR i% = 1 TO 3 STEP 1
  482.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  483.             GOSUB TOOBIG
  484.             GOTO CUSTINST
  485.             END IF
  486.         NEXT i%
  487.         UIPop 1
  488.         GOTO CHOOSEGROUP
  489.     ELSEIF sz$ = "NEWPATH" THEN
  490.         DEST$ = GetListItem(DRIVETEXT$, 3)
  491.  
  492.         ''Truncate display if too long.
  493.         IF LEN(DEST$) > 23 THEN
  494.             ReplaceListItem DRIVETEXT$, 3, MID$(DEST$, 1, 23)+"..."
  495.         END IF
  496.  
  497.         RecalcPath
  498.         SetDriveStatus
  499.         GOTO CUSTINST
  500.     ELSEIF sz$ = "CHK2" THEN
  501.         CursorSave% = ShowWaitCursor()
  502.         RecalcOptFiles STACKFILES
  503.         SetDriveStatus
  504.         RestoreCursor CursorSave%
  505.         GOTO CUSTINST
  506.     ELSEIF sz$ = "CHK3" THEN
  507.         CursorSave% = ShowWaitCursor()
  508.         RecalcOptFiles EUDORAFILES
  509.         SetDriveStatus
  510.         RestoreCursor CursorSave%
  511.         GOTO CUSTINST
  512.     ELSEIF sz$ = "REACTIVATE" THEN
  513.         RecalcPath
  514.         SetDriveStatus
  515.         GOTO CUSTINST
  516.     ELSE
  517.         UIPop 1
  518.         GOTO ASKINSTALL
  519.     END IF
  520.  
  521. CHOOSEGROUP:
  522.     SetSymbolValue "ProgramGroup", "AT&T WorldNet Services"
  523.     Install
  524.  
  525. QUIT:
  526.     ON ERROR GOTO ERRQUIT
  527.  
  528.     IF ERR = 0 THEN
  529.         ' We need to check whether we need to reboot the machine or just
  530.         ' restart Windows
  531.         IF bRebootMachine% THEN
  532.             sz$ = UIStartDlg(CUIDLL$, REBOOT, "FRebootDlgProc", APPHELP, HELPPROC$)
  533.             IF sz$ = "REBOOT" THEN
  534.                 ' Signify that we want to reboot the machine
  535.                 PostMessage FindWindow("NWatcher:WndClass", NULL), RegisterWindowMessage("NWatcher"), 0, 0
  536.             END IF
  537.             UIPop 1
  538.         ELSE
  539.             sz$ = UIStartDlg(CUIDLL$, RESTART, "FRebootDlgProc", APPHELP, HELPPROC$)
  540.             IF sz$ = "REBOOT" THEN
  541.                 ' Signify that we want to restart Windows
  542.                 PostMessage FindWindow("NWatcher:WndClass", NULL), RegisterWindowMessage("NWatcher"), 1, 0
  543.             END IF
  544.             UIPop 1
  545.         END IF
  546.         END
  547.     ELSEIF ERR = STFQUIT THEN
  548.         dlg% = EXITQUIT
  549.     ELSE
  550.         dlg% = EXITFAILURE
  551.     END IF
  552. QUITL1:
  553.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  554.     IF sz$ = "REACTIVATE" THEN
  555.         GOTO QUITL1
  556.     END IF
  557.     UIPop 1
  558.     END
  559.  
  560. ERRQUIT:
  561.     i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  562.     END
  563.  
  564. TOOBIG:
  565.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  566.     IF sz$ = "REACTIVATE" THEN
  567.         RecalcPath
  568.         SetDriveStatus
  569.         GOTO TOOBIG
  570.     END IF
  571.     UIPop 1
  572.     RETURN
  573.  
  574. BADPATH:
  575.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  576.     IF sz$ = "REACTIVATE" THEN
  577.         GOTO BADPATH
  578.     END IF
  579.     UIPop 1
  580.     RETURN
  581.  
  582. ASKQUIT:
  583.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  584.  
  585.     IF sz$ = "EXIT" THEN
  586.         UIPopAll
  587.         ERROR STFQUIT
  588.     ELSEIF sz$ = "REACTIVATE" THEN
  589.         GOTO ASKQUIT
  590.     ELSE
  591.         UIPop 1
  592.     END IF
  593.     RETURN
  594.  
  595. '**
  596. '** Purpose:
  597. '**     Returns 1 if it is possible to deinstall an existing implementation
  598. '** Arguments:
  599. '**     none.
  600. '** Returns:
  601. '**     0 or 1.
  602. '*************************************************************************
  603. FUNCTION OfferToDeinstall STATIC AS INTEGER
  604.     cb% = 256
  605.     szBuf$ = STRING$(cb%, 32)
  606.  
  607.     OfferToDeinstall = 0
  608.  
  609.     ' Check for VTCPRAC.386 in the SYSTEM.INI file
  610.     IF BatchFileLoad(MakePath(GetWindowsDir, "SYSTEM.INI")) THEN
  611.         IF BatchFindCmdReference("VTCPRAC.386", szBuf$, cb%, 1) THEN
  612.             OfferToDeinstall = 1
  613.         END IF
  614.         BatchFileQuit
  615.     END IF
  616. END FUNCTION
  617.  
  618. '**
  619. '** Purpose:
  620. '**     Creates Netscape program group and associated program items
  621. '** Arguments:
  622. '**     none.
  623. '** Returns:
  624. '**     none.
  625. '*************************************************************************
  626. SUB AddProgramItems STATIC
  627.     'Show the Program Manager
  628.     ShowWindow FindWindow("PROGMAN", NULL), SW_RESTORE
  629.  
  630.     '' Update program group and program items
  631.     'Group$ = GetSymbolValue("ProgramGroup")
  632.     'CreateProgmanGroup Group$, "", cmoNone
  633.     'ShowProgmanGroup  Group$, 1, cmoNone
  634.     'SLEEP 1
  635.  
  636.     '' Program item for README file
  637.     'CreateProgmanItem Group$, "Trouble Shooting Guide", MakePath(GetWindowsDir, "NOTEPAD.EXE") +" "+ MakePath(DEST$, "ATT\WNREADME.TXT"), "", cmoOverwrite
  638.     'CreateProgmanItem Group$, "Customer Care Tools", MakePath(DEST$, "ATT\CUSTCARE.EXE"), "", cmoOverwrite
  639.  
  640.     'IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN
  641.         '' Program item for signup.exe
  642.         'IF bISPMode THEN
  643.             'szLabel$ = "Setup " + szISPName + " Account"
  644.             ''CreateProgmanItem Group$, szLabel$, MakePath(DEST$, "DIALER\SIGNUP.EXE ISP.SR"), "", cmoOverwrite
  645.             'CreateProgmanItem Group$, szLabel$, MakePath(DEST$, "ATT\GROUPRST.EXE ADVISOR.EXE SIGNUP2"), MakePath(DEST$, "DIALER\SIGNUP.EXE"), cmoOverwrite
  646.         'ELSEIF bRegOnlyMode THEN
  647.             ''CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "DIALER\SIGNUP.EXE -r"), "", cmoOverwrite
  648.             'CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "ATT\ GROUPRST.EXE ADVISOR.EXE SIGNUP3"), MakePath(DEST$, "DIALER\SIGNUP.EXE"), cmoOverwrite
  649.         'ELSE
  650.             ''CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "DIALER\SIGNUP.EXE"), "", cmoOverwrite
  651.              'CreateProgmanItem Group$, "Registration Wizard", MakePath(DEST$, "ATT\ GROUPRST.EXE ADVISOR.EXE SIGNUP"), MakePath(DEST$, "DIALER\SIGNUP.EXE"), cmoOverwrite
  652.             'END IF
  653.     'ELSE
  654.         '' Program item for netscape.exe
  655.         'CreateProgmanItem Group$, "Netscape", MakePath(DEST$, "NETSCAPE.EXE"), "", cmoOverwrite
  656.  
  657.         'IF GetListItem(CHECKSTATES$, EUDORAFILES) = "ON" THEN
  658.             'CreateProgmanItem Group$, "Eudora Light email", MakePath(DEST$, "EUDORA.EXE"), "", cmoOverwrite
  659.         'END IF
  660.     'END IF
  661.  
  662.     ' QwikFix is now responsible for creating the program group
  663.     ' instead of the commented code above
  664.  
  665.     WinExec MakePath(DEST$, "ATT\GROUPRST.EXE"), SW_SHOWNOACTIVE
  666.     SLEEP 2 
  667.  
  668.     ' 24323 is the decimal representation of hex 5F03 which represents
  669.     ' version 3.95 (i.e., Windows 95)
  670.  
  671.     IF GetVersion() >= 24323 THEN
  672.  
  673. QWIKFIXDONEYET:
  674.     ' Loop until the QwikFix window class is removed, indicating
  675.     ' that QwikFix is exiting and has created the program group.
  676.     ' This delays setup from proceeding so the program group does
  677.     ' not cover up the upcoming message box from setup, allowing 
  678.     ' the user to finish setup properly.  This only occurs in Win 95.
  679.  
  680.         IF FindWindow("GroupRstMainWndClassMRA", NULL) THEN
  681.         SLEEP 1
  682.         GOTO QWIKFIXDONEYET
  683.         END IF
  684.  
  685.     END IF
  686.  
  687. END SUB
  688.  
  689. '**
  690. '** Purpose:
  691. '**     Adds a registry association for the dialer application
  692. '** Arguments:
  693. '**     none.
  694. '** Returns:
  695. '**     none.
  696. '*************************************************************************
  697. SUB UpdateRegistry STATIC
  698.     ' Create a root entry called .SR associated with "NetscapePersonalEdition"
  699.     CreateRegKeyValue ".sr", "NetscapePersonalEdition"
  700.  
  701.     ' Create a Root entry called "NetscapePersonalEdition"
  702.     CreateRegKeyValue "NetscapePersonalEdition", "Netscape Connection File"
  703.  
  704.     ' Set the command line for "NetscapePersonalEdition"
  705.     CreateRegKeyValue "NetscapePersonalEdition\shell\open\command", MakePath(DEST$, "DIALER\DIALER.EXE")+" %1"
  706. END SUB
  707.  
  708. '**
  709. '** Purpose:
  710. '**     Adds a new value to the keyname value if it isn't already present
  711. '** Arguments:
  712. '**     none.
  713. '** Returns:
  714. '**     none.
  715. '*************************************************************************
  716. SUB AppendToKeynameValue (szExisting$, szAdd$) STATIC
  717.     IF szExisting$ = "" THEN
  718.         szExisting$ = szAdd$
  719.     ELSEIF CommaListContains(szExisting$, szAdd$) = 0 THEN
  720.         szExisting$ = szExisting$+","+szAdd$
  721.     END IF
  722. END SUB
  723.  
  724. '**
  725. '** Purpose:
  726. '**     Makes the necessary changes to the Windows SYSTEM.INI file
  727. '** Arguments:
  728. '**     none.
  729. '** Returns:
  730. '**     none.
  731. '*************************************************************************
  732. SUB UpdateSystemIni STATIC
  733.     szSysIni$ = MakePath(GetWindowsDir, "SYSTEM.INI")
  734.  
  735.     IF IsFileWritable(szSysIni$) = 0 THEN
  736.         i% = DoMsgBox("Setup is unable to modify "+szSysIni$+". File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  737.         END
  738.     END IF
  739.  
  740.     ' Shiva specific changes
  741.     AddProfileString szSysIni$, "386Enh", "device", MakePath(DEST$, "system\dial.386"), "dial.386"
  742.     CreateIniKeyValue szSysIni$, "Network", "SessTimeout", "240", cmoOverwrite
  743.     CreateIniKeyValue szSysIni$, "ShivaPPP", "ClaimPort", "1", cmoNone
  744.  
  745.     ' NTS specific changes
  746.     CreateIniKeyValue szSysIni$, "VNTSTIMD", "NumTCBs", "255", cmoOverwrite
  747.     AddProfileString szSysIni$, "386Enh", "device", MakePath(DEST$, "system\vtcprac.386"), "vtcprac.386"
  748.     AddProfileString szSysIni$, "386Enh", "device", MakePath(DEST$, "system\vntstimd.exe"), "vntstimd.exe"
  749. END SUB
  750.  
  751. '**
  752. '** Purpose:
  753. '**     Checks for an old version of Personal Edition
  754. '** Arguments:
  755. '**     none.
  756. '** Side Effects:
  757. '**     sets wNetType%
  758. '** Returns:
  759. '**     none.
  760. '*************************************************************************
  761. SUB CheckForOldVersion STATIC
  762.     cb% = 256
  763.     szBuf$ = STRING$(cb%, 32)
  764.  
  765.     ' We cannot tell conclusively by using WNetGetCaps what the
  766.     ' configuration is, so we must look for some other things instead
  767.     ret% = BatchFileLoad("C:\AUTOEXEC.BAT")
  768.     bNetStart% = BatchFindCmdReference("NET START", szBuf$, cb%, 1)
  769.     bNetbind% = BatchFindCmdReference("NETBIND", szBuf$, cb%, 1)
  770.     BatchFileQuit
  771.  
  772.     IF bNetStart% THEN
  773.         wNetType% = WFW_NET
  774.     ELSEIF bNetbind% THEN
  775.         wNetType% = SOME_NET
  776.     ELSE
  777.         wNetType% = NO_NET
  778.     END IF
  779.  
  780.     ' See if an old version of 1.2 PE is installed on the machine
  781.     ' Check for DIALNDIS.EXE in the CONFIG.SYS file
  782.     IF BatchFileLoad("c:\config.sys") THEN
  783.         IF BatchFindCmdReference("DIALNDIS.EXE", szBuf$, cb%, 1) THEN
  784.             ' Prompt the user before doing this
  785.             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
  786.                 BatchFileQuit
  787.                 END
  788.             ELSE
  789.                 BatchFileQuit
  790.                 Deinstall12
  791.             END IF
  792.         ELSE
  793.             BatchFileQuit
  794.         END IF
  795.  
  796.     ELSE
  797.         ' Check for DIALNDIS.EXE in SYSTEM.INI
  798.         IF BatchFileLoad(MakePath(GetWindowsDir, "SYSTEM.INI")) THEN
  799.             IF BatchFindCmdReference("DIALNDIS.EXE", szBuf$, cb%, 1) THEN
  800.                 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)
  801.                 BatchFileQuit
  802.                 END
  803.             END IF
  804.             BatchFileQuit
  805.         END IF
  806.     END IF
  807. END SUB
  808.  
  809. '**
  810. '** Purpose:
  811. '**     Creates specified news directory
  812. '** Arguments:
  813. '**     Path to Netscape INI file and directory to create.
  814. '** Returns:
  815. '**     none.
  816. '*************************************************************************
  817. SUB CreateNewsDir (szNetscapeIni$, szNewsDir$) STATIC
  818.     ' Check for a file with the same name as the directory we are trying to create
  819.     IF DoesFileExist(szNewsDir$, femExists) THEN
  820.         ' Try using MOZNEWS as the directory name
  821.         IF DoesFileExist(MakePath(DEST$, "MOZNEWS"), fmExists) = 0 THEN
  822.             CreateDir MakePath(DEST$, "MOZNEWS"), cmoNone
  823.  
  824.             ' Add a line to the Netscape INI file pointing to the news directory
  825.             CreateIniKeyValue szNetscapeIni$, "News", "News Directory", MakePath(DEST$, "MOZNEWS"), cmoOverwrite
  826.         END IF
  827.     ELSE
  828.         CreateDir szNewsDir$, cmoNone
  829.  
  830.         ' Add a line to the Netscape INI file pointing to the news directory
  831.         CreateIniKeyValue szNetscapeIni$, "News", "News Directory", szNewsDir$, cmoOverwrite
  832.     END IF
  833. END SUB
  834.  
  835. '**
  836. '** Purpose:
  837. '**     Deinstalls the product
  838. '** Arguments:
  839. '**     none.
  840. '** Returns:
  841. '**     none.
  842. '*************************************************************************
  843. SUB Deinstall STATIC
  844.     cb% = 256
  845.     szBuf$ = STRING$(cb%, 32)
  846.  
  847.     ' Clean up WIN.INI entries except for the Navigator itself
  848.     RemoveIniKey "WIN.INI", "Netscape", "dialer", cmoNone
  849.     RemoveIniKey "WIN.INI", "Netscape", "eudora", cmoNone
  850.  
  851.     ' Next remove device drivers from SYSTEM.INI
  852.     szSysIni$ = MakePath(GetWindowsDir, "SYSTEM.INI")
  853.     IF IsFileWritable(szSysIni$) = 0 THEN
  854.         i% = DoMsgBox("Setup is unable to modify "+szSysIni$+". File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  855.         END
  856.     END IF
  857.  
  858.     RemoveProfileString szSysIni$, "386Enh", "device", "dial.386"
  859.     RemoveProfileString szSysIni$, "386Enh", "device", "vtcprac.386"
  860.     RemoveProfileString szSysIni$, "386Enh", "device", "vntstimd.exe"
  861.     RemoveIniSection szSysIni$, "VNTSTIMD", cmoNone
  862.     RemoveIniSection szSysIni$, "ShivaPPP", cmoNone
  863.  
  864.     IF DoesFileExist(MakePath(GetWindowsDir, "NTS.INI"), femExists) THEN
  865.         RemoveFile MakePath(GetWindowsDir, "NTS.INI"), cmoNone
  866.     END IF
  867.  
  868.     ' Remove the WINSOCK.DLL from the Netscape directory
  869.     IF DoesFileExist(MakePath(DEST$, "WINSOCK.DLL"), femExists) THEN
  870.         RemoveFile MakePath(DEST$, "WINSOCK.DLL"), cmoNone
  871.     END IF
  872.  
  873.     ' Remove the program manager group
  874.     DeleteProgmanGroup "AT&T WorldNet Services"
  875.  
  876.     ' Ask the user if they want to blow away the whole NETSCAPE directory
  877.  '   IF DoMsgBox("Would you like Setup to delete the "+DEST$+" directory?", "AT&T WorldNet 'Services", MB_YESNO) = IDYES THEN
  878.         RemoveIniSection "WIN.INI", "Netscape", cmoNone
  879.         IF DoesDirExist( MakePath(DEST$, "att") ) THEN
  880.             RemoveFile MakePath(DEST$, "att\comport.dll"), cmoForce
  881.             RemoveFile MakePath(DEST$, "att\ctl3d.dll"), cmoForce
  882.             RemoveFile MakePath(DEST$, "att\advisor.exe"), cmoForce
  883.             RemoveFile MakePath(DEST$, "att\wnsysrpt.exe"), cmoForce
  884.             RemoveFile MakePath(DEST$, "att\grouprst.exe"), cmoForce
  885.             RemoveFile MakePath(DEST$, "att\getaccnt.exe"), cmoForce
  886.             RemoveFile MakePath(DEST$, "att\qwikfix.exe"), cmoForce
  887.             RemoveFile MakePath(DEST$, "att\launch16.exe"), cmoForce
  888.             RemoveFile MakePath(DEST$, "att\qwiklook.exe"), cmoForce
  889.             RemoveFile MakePath(DEST$, "att\custcare.exe"), cmoForce
  890.             RemoveFile MakePath(DEST$, "att\custcare.bmp"), cmoForce
  891.             RemoveFile MakePath(DEST$, "att\advisor.hlp"), cmoForce
  892.             RemoveFile MakePath(DEST$, "att\wnsysrpt.hlp"), cmoForce
  893.             RemoveFile MakePath(DEST$, "att\launch16.hlp"), cmoForce
  894.             RemoveFile MakePath(DEST$, "att\qwiklook.hlp"), cmoForce
  895.             RemoveFile MakePath(DEST$, "att\worldnet.ico"), cmoForce
  896.             RemoveFile MakePath(DEST$, "att\regwiz.ico"), cmoForce
  897.             RemoveFile MakePath(DEST$, "att\dialer.ico"), cmoForce
  898.             RemoveFile MakePath(DEST$, "att\modems.inf"), cmoForce
  899.             RemoveFile MakePath(DEST$, "att\advisor.ini"), cmoForce
  900.             RemoveFile MakePath(DEST$, "att\wnsysrpt.ini"), cmoForce
  901.             RemoveFile MakePath(DEST$, "att\grouprst.ini"), cmoForce
  902.             RemoveFile MakePath(DEST$, "att\launcher.ini"), cmoForce
  903.             RemoveFile MakePath(DEST$, "att\modems.ini"), cmoForce
  904.             RemoveFile MakePath(DEST$, "att\qwiklook.ini"), cmoForce
  905.             RemoveFile MakePath(DEST$, "att\qwikfix.ini"), cmoForce
  906.             RemoveFile MakePath(DEST$, "att\wnreadme.txt"), cmoForce
  907.             RemoveFile MakePath(DEST$, "att"), cmoForce
  908.         END IF
  909.         IF DoesDirExist(DEST$) THEN
  910.             RemoveDirRecurse DEST$
  911.         END IF
  912.   '  END IF
  913.     i% = DoMsgBox("The software has been succesfully deinstalled.  Run Setup again to reinstall.", "AT&T WorldNet Services", MB_OK)
  914. END SUB
  915.  
  916. '**
  917. '** Purpose:
  918. '**     Deinstalls the 1.2 product
  919. '** Arguments:
  920. '**     none.
  921. '** Returns:
  922. '**     none.
  923. '*************************************************************************
  924. SUB Deinstall12 STATIC
  925.     cb% = 256
  926.     szBuf$ = STRING$(cb%, 32)
  927.  
  928.     ' First handle CONFIG.SYS
  929.     IF IsFileWritable("c:\config.sys") = 0 THEN
  930.         i% = DoMsgBox("Setup is unable to modify CONFIG.SYS. File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  931.         END
  932.     END IF
  933.  
  934.     IF BatchFileLoad("c:\config.sys") THEN
  935.         IF BatchFindCmdReference(MakePath(DEST$, "NDIS\PROTMAN.DOS"), szBuf$, cb%, 1) THEN
  936.             ret% = BatchRemoveCmd
  937.         END IF
  938.  
  939.         IF BatchFindCmdReference("DIALNDIS.EXE", szBuf$, cb%, 1) THEN
  940.             ret% = BatchRemoveCmd
  941.         END IF
  942.  
  943.         IF BatchFindCmdReference("VTCPRMT.EXE", szBuf$, cb%, 1) THEN
  944.             ret% = BatchRemoveCmd
  945.         END IF
  946.  
  947.         IF BatchFileSave = 0 THEN
  948.             i% = DoMsgBox("Setup was unable to modify CONFIG.SYS.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  949.             END
  950.         END IF
  951.     END IF
  952.  
  953.     ' Next handle AUTOEXEC.BAT
  954.     IF IsFileWritable("c:\autoexec.bat") = 0 THEN
  955.         i% = DoMsgBox("Setup is unable to modify AUTOEXEC.BAT. File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  956.         END
  957.     END IF
  958.  
  959.     IF BatchFileLoad("c:\autoexec.bat") THEN
  960.         IF BatchFindVariable("SHIVA", szBuf$, cb%, 1) THEN
  961.             ret% = BatchRemoveVariable
  962.         END IF
  963.  
  964.         IF BatchFindCmdReference(MakePath(DEST$, "NDIS\NETBIND"), szBuf$, cb%, 1) THEN
  965.             ret% = BatchRemoveCmd
  966.         END IF
  967.     
  968.         IF BatchFileSave = 0 THEN
  969.             i% = DoMsgBox("Setup was unable to modify AUTOEXEC.BAT.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  970.             END
  971.         END IF
  972.     END IF
  973.  
  974.     ' Clean up WIN.INI entries except for the Navigator itself
  975.     RemoveIniKey "WIN.INI", "Netscape", "dialer", cmoNone
  976.     RemoveIniKey "WIN.INI", "Netscape", "eudora", cmoNone
  977.  
  978.     ' Next remove device drivers from SYSTEM.INI
  979.     szSysIni$ = MakePath(GetWindowsDir, "SYSTEM.INI")
  980.     IF IsFileWritable(szSysIni$) = 0 THEN
  981.         i% = DoMsgBox("Setup is unable to modify "+szSysIni$+". File is read only.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  982.         END
  983.     END IF
  984.  
  985.     RemoveProfileString szSysIni$, "386Enh", "device", "dial.386"
  986.     RemoveProfileString szSysIni$, "386Enh", "device", "vntstimd.exe"
  987.     RemoveIniSection szSysIni$, "VNTSTIMD", cmoNone
  988.  
  989.     ' Now remove all files that we added to the Windows and the System directories
  990.     IF DoesFileExist(MakePath(GetWindowsDir, "DIALNDIS.EXE"), femExists) THEN
  991.         RemoveFile MakePath(GetWindowsDir, "DIALNDIS.EXE"), cmoNone
  992.     END IF
  993.  
  994.     IF DoesFileExist(MakePath(GetWindowsDir, "VTCPRMT.EXE"), femExists) THEN
  995.         RemoveFile MakePath(GetWindowsDir, "VTCPRMT.EXE"), cmoNone
  996.     END IF
  997.  
  998.     IF DoesFileExist(MakePath(GetWindowsSysDir, "VNTSTIMD.EXE"), femExists) THEN
  999.         RemoveFile MakePath(GetWindowsSysDir, "VNTSTIMD.EXE"), cmoNone
  1000.     END IF
  1001.  
  1002.     IF DoesFileExist(MakePath(GetWindowsSysDir, "DIAL.386"), femExists) THEN
  1003.         RemoveFile MakePath(GetWindowsSysDir, "DIAL.386"), cmoNone
  1004.     END IF
  1005.  
  1006.     IF DoesFileExist(MakePath(GetWindowsDir, "NTS.INI"), femExists) THEN
  1007.         RemoveFile MakePath(GetWindowsDir, "NTS.INI"), cmoNone
  1008.     END IF
  1009.  
  1010.     ' Remove the WINSOCK.DLL from the Netscape directory
  1011.     IF DoesFileExist(MakePath(DEST$, "WINSOCK.DLL"), femExists) THEN
  1012.         RemoveFile MakePath(DEST$, "WINSOCK.DLL"), cmoNone
  1013.     END IF
  1014.  
  1015.     ' We need to reboot the machine when we're done
  1016.     bRebootMachine% = 1
  1017. END SUB
  1018.  
  1019. '**
  1020. '** Purpose:
  1021. '**     Builds the copy list and performs all installation operations.
  1022. '** Arguments:
  1023. '**     none.
  1024. '** Returns:
  1025. '**     none.
  1026. '*************************************************************************
  1027. SUB Install STATIC
  1028.     cb% = 256
  1029.     szBuf$ = STRING$(cb%, 32)
  1030.  
  1031.     szSrcDir$ = GetSymbolValue("STF_SRCDIR")
  1032.  
  1033.     ' Create user specified directory and CACHE sub-directory
  1034.     CreateDir DEST$, cmoNone
  1035.     CreateDir MakePath(DEST$, "CACHE"), cmoNone
  1036.  
  1037.     ' Add files to copy
  1038.     ClearCopyList
  1039.     AddOptFilesToCopyList APPFILES
  1040.     AddOptFilesToCopyList STACKFILES
  1041.     AddOptFilesToCopyList EUDORAFILES
  1042.     
  1043.     IF bISPMode THEN
  1044.         AddSectionFilesToCopyList "ISP", SRC$, DEST$
  1045.     END IF
  1046.  
  1047.     ' Add some billboards
  1048.     IF bISPMode THEN
  1049.         AddToBillboardList "mscuistf.dll", BILLBOARD1, "FModelessDlgProc", 1
  1050.         AddToBillboardList "mscuistf.dll", BILLBOARD2, "FModelessDlgProc", 1
  1051.     ELSE
  1052.         AddToBillboardList "mscuistf.dll", BILLBOARD1, "FModelessDlgProc", 1
  1053.         AddToBillboardList "mscuistf.dll", BILLBOARD2, "FModelessDlgProc", 1
  1054.         'AddToBillboardList "mscuistf.dll", BILLBOARD3, "FModelessDlgProc", 1
  1055.     END IF
  1056.  
  1057.     ' Do the actual copy
  1058.     SetCopyGaugePosition 85, 130
  1059.     CopyFilesInCopyList
  1060.  
  1061.     ' Merge OLE2 registration into system registry
  1062.     WinExec "REGEDIT /S OLE2.REG", SW_SHOW
  1063.     
  1064.     ' Modify launcher.ini to reflect the correct path names
  1065.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Netscape", "app1", DEST$+",netscape.exe", cmoOverwrite 
  1066.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Netscape", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite 
  1067.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "AttDial", "app1", MakePath(DEST$, "dialer")+",dialer.exe att.sr", cmoOverwrite 
  1068.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "AttDial", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite 
  1069.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Eudora", "app1", DEST$+",eudora.exe "+DEST$+"\eudora", cmoOverwrite 
  1070.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Eudora", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite 
  1071.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup", "app1", MakePath(Dest$, "dialer")+",signup.exe", cmoOverwrite 
  1072.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite 
  1073.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup2", "app1", MakePath(Dest$, "dialer")+",signup.exe isp.sr", cmoOverwrite 
  1074.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup2", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite 
  1075.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup3", "app1", MakePath(Dest$, "dialer")+",signup.exe -r", cmoOverwrite 
  1076.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Signup3", "ignore1", "winsock,"+MakePath(DEST$, "winsock.dll"), cmoOverwrite 
  1077.     CreateIniKeyValue MakePath(DEST$, "att\advisor.ini"), "Advisor", "Dialer", MakePath(DEST$, "dialer\dialer.exe"), cmoOverwrite 
  1078.  
  1079.     ' Modify the win.ini file to have a [Netscape] section with a keyname-value
  1080.     ' pair for the Netscape INI file location and for the dialer
  1081.     CreateIniKeyValue "WIN.INI", "Netscape", "ini", MakePath(DEST$, "NETSCAPE.INI"), cmoOverwrite
  1082.  
  1083.     IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN
  1084.         CreateIniKeyValue "WIN.INI", "Netscape", "dialer", MakePath(DEST$, "DIALER"), cmoOverwrite
  1085.     END IF
  1086.  
  1087.     IF GetListItem(CHECKSTATES$, EUDORAFILES) = "ON" THEN
  1088.         CreateIniKeyValue "WIN.INI", "Netscape", "eudora", MakePath(DEST$, "EUDORA"), cmoOverwrite
  1089.     END IF
  1090.  
  1091.     szNetscapeIni$ = MakePath(DEST$, "NETSCAPE.INI")
  1092.  
  1093.     ' If the user specified an installation location other than the default
  1094.     ' location, then update the netscape.ini file accordingly
  1095.     IF DEST$ <> "C:\NETSCAPE" THEN
  1096.         UpdateNetscapeIni szNetscapeIni$
  1097.     END IF
  1098.  
  1099.     ' See if there is a news directory specified in the INI file
  1100.     szNewsDir$ = GetIniKeyString(szNetscapeIni$, "News", "News Directory")
  1101.     IF szNewsDir$ = "" THEN
  1102.         CreateNewsDir szNetscapeIni$, MakePath(DEST$, "NEWS")
  1103.     ELSEIF DoesDirExist(szNewsDir$) = 0 THEN
  1104.         CreateNewsDir szNetscapeIni$, szNewsDir$
  1105.     END IF
  1106.  
  1107.     ' Check to see if the NEWSRC file specified in the NETSCAPE.INI actually exists
  1108.     szNewsRC$ = GetIniKeyString(szNetscapeIni$, "Main", "News RC")
  1109.     IF szNewsRC$ <> "" THEN
  1110.         IF DoesFileExist(szNewsRC$, femExists) = 0 THEN
  1111.             ' Make the default NEWSRC file be in the NEWS sub-directory
  1112.             CreateIniKeyValue szNetscapeIni$, "Main", "News RC", MakePath(DEST$, "NEWS\NEWSRC"), cmoOverwrite
  1113.         END IF
  1114.     END IF
  1115.  
  1116.     ' Setup Netscape to use the audio player as an external viewer
  1117.     CreateIniKeyValue szNetscapeIni$, "Viewers", "audio/basic", MakePath(DEST$, "NAPLAYER.EXE"), cmoOverwrite
  1118.     CreateIniKeyValue szNetscapeIni$, "Viewers", "audio/x-aiff", MakePath(DEST$, "NAPLAYER.EXE"), cmoOverwrite
  1119.     CreateIniKeyValue szNetscapeIni$, "Suffixes", "audio/basic", "au,snd", cmoOverwrite
  1120.     CreateIniKeyValue szNetscapeIni$, "Suffixes", "audio/x-aiff", "aif,aiff,aifc", cmoOverwrite
  1121.  
  1122.     IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN
  1123.         ' Create NTS.INI file with WINSOCK section
  1124.         CreateIniKeyValue MakePath(GetWindowsDir, "NTS.INI"), "WINSOCK", "ETCDIR", MakePath(DEST$, "DIALER"), cmoOverwrite
  1125.  
  1126.         CreateIniKeyValue MakePath(GetWindowsDir, "NTS.INI"), "Installation", "PATH", MakePath(DEST$, "DIALER"), cmoOverwrite
  1127.  
  1128.         ' Backup the files we are going to change (only do this once)
  1129.         IF DoesFileExist(MakePath(DEST$, "system.ini"), femExists) = 0 THEN
  1130.             CopyFile MakePath(GetWindowsDir, "system.ini"), MakePath(DEST$, "system.ini"), cmoNone, 0
  1131.         END IF
  1132.  
  1133.         ' Update the system.ini file
  1134.         UpdateSystemIni
  1135.  
  1136.         ' Make sure the SHIVA environment variable isn't set. If it is then make sure it is correct
  1137.         IF BatchFileLoad("c:\autoexec.bat") THEN
  1138.             IF BatchFindVariable("SHIVA", szBuf$, cb%, 1) THEN
  1139.                 ret% = BatchReplaceVariable(MakePath(DEST$, "DIALER"))
  1140.                 IF BatchFileSave = 0 THEN
  1141.                     i% = DoMsgBox("Setup was unable to modify AUTOEXEC.BAT.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  1142.                     END
  1143.                 END IF
  1144.                 bRebootMachine% = 1
  1145.             ELSE
  1146.                 BatchFileQuit
  1147.             END IF
  1148.         END IF
  1149.  
  1150.         ' Add a registry association for the dialer
  1151.         UpdateRegistry
  1152.     END IF
  1153.  
  1154.     ' Add a program group and associated program items
  1155.     AddProgramItems
  1156.  
  1157.     IF GetListItem(CHECKSTATES$, STACKFILES) = "ON" THEN
  1158.         IF bReinstall% = 0 THEN
  1159.             ' Inform the user that we have modified their files
  1160.             szText$ = "Setup has modified your SYSTEM.INI file"
  1161.             szText$ = szText$ + ". A copy of the old file has been placed in directory " + DEST$
  1162.             i% = DoMsgBox(szText$, "AT&T WorldNet Services", MB_OK)
  1163.             szText$ = ""
  1164.         END IF
  1165.     END IF
  1166. END SUB
  1167.  
  1168. '**
  1169. '** Purpose:
  1170. '**     Adds the specified option files to the copy list.
  1171. '** Arguments:
  1172. '**     ftype%  - type of files to add, one of the following:
  1173. '**             APPFILES, STACKFILES, EUDORAFILES
  1174. '** Returns:
  1175. '**     none.
  1176. '*************************************************************************
  1177. SUB AddOptFilesToCopyList (ftype%) STATIC
  1178.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  1179.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  1180.  
  1181.     IF ftype% = APPFILES THEN
  1182.         AddSectionFilesToCopyList "Files", SrcDir$, DEST$
  1183.         AddSectionFilesToCopyList "OLE2", SrcDir$, GetWindowsSysDir
  1184.  
  1185.     ELSEIF ftype% = STACKFILES THEN
  1186.         AddSectionFilesToCopyList "DIALER", SrcDir$, DEST$
  1187.         AddSectionFilesToCopyList "CTL3D", SrcDir$, GetWindowsSysDir
  1188.         AddSectionFilesToCopyList "SYSTEM", SrcDir$, DEST$
  1189.  
  1190.     ELSEIF ftype% = EUDORAFILES THEN
  1191.         AddSectionFilesToCopyList "EUDORA", SrcDir$, DEST$
  1192.     END IF
  1193.     SrcDir$ = ""
  1194.     END IF
  1195. END SUB
  1196.  
  1197. '**
  1198. '** Purpose:
  1199. '**     Recalculates disk space for the given option files and sets
  1200. '**     the status info symbol "StatusItemsText".
  1201. '** Arguments:
  1202. '**     ftype% - type of files to add, one of the following:
  1203. '**             APPFILES, STACKFILES, EUDORAFILES
  1204. '** Returns:
  1205. '**     none.
  1206. '*************************************************************************
  1207. SUB RecalcOptFiles (ftype%) STATIC
  1208.     ClearCopyList
  1209.     AddOptFilesToCopyList ftype%
  1210.  
  1211.     fExtra% = 0
  1212.     IF ftype% = APPFILES THEN
  1213.         ListSym$ = APPNEEDS$
  1214.         ''Add extra cost to Windows drive for ini/progman, etc.
  1215.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1216.         ' ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  1217.         fExtra% = 1
  1218.     ELSEIF ftype% = STACKFILES THEN
  1219.         ListSym$ = STACKNEEDS$
  1220.     ELSEIF ftype% = EUDORAFILES THEN
  1221.         ListSym$ = EUDORANEEDS$
  1222.     END IF
  1223.  
  1224.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  1225.  
  1226.     cost& = 0
  1227.     FOR i% = 1 TO 26 STEP 1
  1228.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  1229.     NEXT i%
  1230.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  1231.  
  1232.     IF StillNeed& > 0 THEN
  1233.         ReplaceListItem BIGLIST$, ftype%, "YES"
  1234.     ELSE
  1235.         ReplaceListItem BIGLIST$, ftype%, ""
  1236.     END IF
  1237.  
  1238.     IF fExtra% THEN
  1239.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  1240.     END IF
  1241.     ListSym$ = ""
  1242. END SUB
  1243.  
  1244. '**
  1245. '** Purpose:
  1246. '**     Recalculates disk space and sets option status info according
  1247. '**     to the current destination path.
  1248. '** Arguments:
  1249. '**     none.
  1250. '** Returns:
  1251. '**     none.
  1252. '*************************************************************************
  1253. SUB RecalcPath STATIC
  1254.     CursorSave% = ShowWaitCursor()
  1255.  
  1256.     RecalcOptFiles APPFILES
  1257.     RecalcOptFiles STACKFILES
  1258.     RecalcOptFiles EUDORAFILES
  1259.  
  1260.     RestoreCursor CursorSave%
  1261. END SUB
  1262.  
  1263. '**
  1264. '** Purpose:
  1265. '**     Sets drive status info according to latest disk space calcs.
  1266. '** Arguments:
  1267. '**     none.
  1268. '** Returns:
  1269. '**     none.
  1270. '*************************************************************************
  1271. SUB SetDriveStatus STATIC
  1272.     drive$ = MID$(DEST$, 1, 1)
  1273.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  1274.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(STACKNEEDS$, ndrive%)) + VAL(GetListItem(EUDORANEEDS$, ndrive%))
  1275.     free& = GetFreeSpaceForDrive(drive$)
  1276.     ReplaceListItem DRIVETEXT$, 1, STR$(cost& / 1024) + " K"
  1277.     ReplaceListItem DRIVETEXT$, 2, STR$(free& / 1024) + " K"
  1278. END SUB
  1279.  
  1280. '**
  1281. '** Purpose:
  1282. '**     Appends a file name to the end of a directory path,
  1283. '**     inserting a backslash character as needed.
  1284. '** Arguments:
  1285. '**     szDir$  - full directory path (with optional ending "\")
  1286. '**     szFile$ - filename to append to directory
  1287. '** Returns:
  1288. '**     Resulting fully qualified path name.
  1289. '*************************************************************************
  1290. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1291.     IF szDir$ = "" THEN
  1292.         MakePath = szFile$
  1293.     ELSEIF szFile$ = "" THEN
  1294.         MakePath = szDir$
  1295.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1296.         MakePath = szDir$ + szFile$
  1297.     ELSE
  1298.         MakePath = szDir$ + "\" + szFile$
  1299.     END IF
  1300. END FUNCTION
  1301.