home *** CD-ROM | disk | FTP | other *** search
/ U.S. Robotics Connections 2 / US Robotics Connections.iso / pc / sourcepc / aol / disk1 / aol.ms_ / aol.ms
Encoding:
Text File  |  1994-08-23  |  21.6 KB  |  738 lines

  1. '-----------------------------------------------------------------------------
  2. ' AOL.MST
  3. '
  4. '
  5. '-----------------------------------------------------------------------------
  6. '
  7. ' Copyright (c) 1987-1994 America Online, Inc.  All rights reserved.
  8. '
  9. ' This software contains valuable confidential and proprietary information
  10. ' of America Online and is subject to applicable licensing agreements.
  11. '
  12. ' Unauthorized reproduction, transmission or distribution of this 
  13. ' software is a violation of applicable laws.
  14. '
  15. '-----------------------------------------------------------------------------
  16.  
  17. '
  18. ' Include files
  19. '
  20. '$INCLUDE 'setupapi.inc'
  21. '$INCLUDE 'msdetect.inc'
  22.  
  23. '
  24. ' Dialog box Id's
  25. '
  26. CONST CHOOSE        = 1500
  27. CONST EXAMINING     = 1000
  28. CONST LOSTMODEM     = 1200
  29. CONST LOWDISKSPACE  = 1800
  30. CONST LOWDISKSPACE1 = 1100
  31. CONST EXITCLEAN     = 1700
  32. CONST EXITHELP      = 2000
  33. CONST EXITFAILURE   = 400
  34. CONST EXITSUCCESS   = 700
  35. CONST EXITUPDATED   = 2100
  36. CONST EXITABORT     = 1300
  37. CONST PATHOLD       = 8004
  38. CONST PATHNEW       = 8005
  39. CONST PATHONLY      = 1600
  40. CONST PATHOLD1      = 1400
  41. CONST BADPATH1      = 200
  42. CONST BADPATH2      = 600
  43.  
  44.  
  45. '
  46. ' Miscellaneous constants
  47. '
  48. CONST BITMAP_TITLE   = 1
  49. CONST DEFAULTDIR     = "AOL20"
  50. CONST REVISION       = "2.0"
  51.  
  52. '
  53. ' External function declarations
  54. '
  55. DECLARE FUNCTION IsAppRunning        LIB "mscuistf.dll" ( AppName$ )  AS INTEGER
  56. DECLARE FUNCTION IsNDWRunning        LIB "mscuistf.dll"               AS INTEGER
  57. DECLARE FUNCTION MaximizeWindow      LIB "mscuistf.dll" ( hWnd% )     AS INTEGER
  58. DECLARE FUNCTION MemInit             LIB "mscuistf.dll"               AS INTEGER
  59. DECLARE FUNCTION MemRelease          LIB "mscuistf.dll"               AS INTEGER
  60. DECLARE FUNCTION FindWaolOnDrive     LIB "mscuistf.dll" ( Drive$ )    AS INTEGER
  61. DECLARE FUNCTION FindModem           LIB "mscuistf.dll"               AS INTEGER
  62. DECLARE FUNCTION SaveOldEnvironment  LIB "mscuistf.dll" ( fReplace% ) AS INTEGER
  63. DECLARE FUNCTION SetupNewEnvironment LIB "mscuistf.dll" ( fReplace% ) AS INTEGER
  64. DECLARE SUB      WildcardCopy        LIB "mscuistf.dll" ( Source$, Dest$, Ext$ )
  65.  
  66. '
  67. ' Local function declarations
  68. '
  69. DECLARE FUNCTION GetOldPath                      AS STRING
  70. DECLARE FUNCTION FindDriveWithSpace ( OldPath$ ) AS STRING
  71. DECLARE FUNCTION BuildNewPath       ( OldPath$ ) AS STRING
  72. DECLARE FUNCTION GetModemSetup                   AS INTEGER
  73.  
  74. DECLARE SUB      AskExit            ( Dialog% )            
  75. DECLARE SUB      BadPath            ( Dialog% ) 
  76. DECLARE FUNCTION MakePath           ( Path$, Addition$ )                   AS STRING
  77. DECLARE SUB      CopyOldFile        ( FromPath$, ToPath$, cmo%, fAppend% )
  78. DECLARE FUNCTION RemoveLastDir      ( Path$ )                              AS STRING
  79. DECLARE FUNCTION CheckSpace         ( Path$ )                              AS LONG
  80. DECLARE SUB      Install            ( OldPath$, NewPath$ )
  81. DECLARE FUNCTION Review             ( OldPath$, NewPath$ )                 AS INTEGER
  82.  
  83. '
  84. ' Global variables
  85. '
  86. GLOBAL SourcePath$
  87. GLOBAL AbortPath$
  88.  
  89. '-----------------------------------------------------------------------------
  90. ' Entry point
  91. '
  92. '-----------------------------------------------------------------------------
  93. INIT:
  94.    SetBitmap "mscuistf.dll", BITMAP_TITLE
  95.    SetTitle "America Online "+REVISION+" - Setup"
  96.    n% = MaximizeWindow( HwndFrame )
  97.  
  98.    Abort$ = ""
  99. '
  100. '
  101. '
  102.     IF IsAppRunning( "WAOL" ) = 1 THEN
  103.         n% = DoMsgBox( "Please exit America Online for Windows before running the setup program.", "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  104.         END
  105.     END IF
  106. '
  107. '
  108. '
  109.    SourcePath$ = GetSymbolValue("STF_SRCDIR")
  110.  
  111.    InfPath$ = GetSymbolValue("STF_SRCINFPATH")
  112.    IF InfPath$ = "" THEN
  113.        InfPath$ = GetSymbolValue("STF_CWDDIR") + "AOL.INF"
  114.    END IF
  115.    ReadInfFile InfPath$
  116. '
  117. '
  118. '
  119.    Result% = MemInit
  120.  
  121.    sz$ = UIStartDlg("mscuistf.dll", EXAMINING, "FModelessDlgProc", 0, "")
  122.  
  123.    GetLocalHardDrivesList "DriveList"
  124.    OldPath$ = GetOldPath
  125.  
  126.    NewPath$ = BuildNewPath( OldPath$ )
  127.    RemoveSymbol "DriveList"
  128.  
  129.    n% = GetModemSetup
  130.  
  131.    UIPop 1
  132. '
  133. '
  134. '
  135. AGAIN:
  136.    Response$ = UIStartDlg( "mscuistf.dll", CHOOSE, "FInfoDlgProc", 0, "" )
  137.    UIPop 1
  138.  
  139.    IF Response$ = "EXIT" OR Response$ = "CANCEL" THEN
  140.       AskExit( EXITCLEAN )
  141.       GOTO AGAIN
  142.    END IF
  143.  
  144.    IF Response$ = "REVIEW" THEN   
  145.  
  146. '$IFDEF DEBUG
  147. '      n%  = DoMsgBox( "Debug -> Old Installation: "+OldPath$, "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  148. '      n%  = DoMsgBox( "Debug -> New installation: "+NewPath$, "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  149. '      sz$ = GetSymbolValue( "ComPort" )
  150. '      n%  = DoMsgBox( "Debug -> COM:"+sz$, "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  151. '      sz$ = GetSymbolValue( "BaudRate" )
  152. '      n%  = DoMsgBox( "Debug -> Baud rate: "+sz$, "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  153. '      sz$ = GetSymbolValue( "DriverName" )
  154. '      n%  = DoMsgBox( "Debug -> Modem Profile: "+sz$, "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  155. '$ENDIF
  156.  
  157.       n% = Review( OldPath$, NewPath$ )
  158.       OldPath$ = GetSymbolValue( "OldPath" )
  159.       NewPath$ = GetSymbolValue( "NewPath" )
  160.  
  161.       IF n% = 0 THEN
  162.          GOTO AGAIN
  163.       END IF
  164.  
  165.    END IF
  166. '
  167. '
  168. '
  169.    Install OldPath$, NewPath$
  170.  
  171. '-----------------------------------------------------------------------------
  172. ' Exit
  173. '
  174. '-----------------------------------------------------------------------------
  175. QUIT:
  176.    ON ERROR GOTO QUIT2
  177.  
  178.    IF AbortPath$ <> "" THEN
  179.        RemoveFile MakePath( AbortPath$, "WAOL.EXE"), cmoNone
  180.        RemoveFile MakePath( AbortPath$, "IDB\MAIN.IDX"), cmoNone
  181.        AbortPath$ = ""
  182.    END IF
  183.  
  184.    UIPopAll
  185.  
  186.    IF ERR = 0 THEN
  187.       IF OldPath$ = "" THEN
  188.          dlg% = EXITSUCCESS
  189.       ELSE
  190.          dlg% = EXITUPDATED
  191.       END IF   
  192.    ELSEIF ERR = STFQUIT THEN
  193.        dlg% = EXITABORT
  194.    ELSE
  195.        dlg% = EXITFAILURE
  196.    END IF
  197.  
  198. QUIT1:
  199.    sz$ = UIStartDlg("mscuistf.dll", dlg%, "FInfo0DlgProc", 0, "")
  200.    IF sz$ = "REACTIVATE" THEN
  201.        GOTO QUIT1
  202.    END IF
  203.    UIPop 1
  204.  
  205.  
  206.    Result% = MemRelease
  207.    END
  208. '
  209. '
  210. '
  211. QUIT2:
  212.    n% = DoMsgBox( "Setup error!  Please call AOL Customer Relations at 1-800-827-3338", "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  213.    Result% = MemRelease
  214.    END
  215.  
  216. '--------------------------------------------------------------------------
  217. ' AskExit
  218. '
  219. '--------------------------------------------------------------------------
  220. SUB AskExit( Dialog% ) STATIC
  221.  
  222. AGAIN:
  223.  
  224.    Response$ = UIStartDlg("mscuistf.dll", Dialog%, "FQuitDlgProc", 0, "")
  225.    IF Response$ = "EXIT" THEN
  226.       UIPopAll
  227.       Result% = MemRelease
  228.       END
  229.    ELSEIF Response$ = "REACTIVATE" OR Response$ = "CANCEL" THEN
  230.       GOTO AGAIN
  231.    ELSE
  232.       UIPop 1
  233.    END IF
  234.  
  235. END SUB
  236.  
  237.  
  238. '--------------------------------------------------------------------------
  239. ' BadPath
  240. '
  241. '--------------------------------------------------------------------------
  242. SUB BadPath( Dialog% ) STATIC
  243.  
  244. AGAIN:
  245.  
  246.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FInfo0DlgProc", 0, "")
  247.     IF sz$ = "REACTIVATE" THEN
  248.         GOTO AGAIN
  249.     END IF
  250.     UIPop 1
  251.  
  252. END SUB
  253.  
  254. '--------------------------------------------------------------------------
  255. ' GetOldPath
  256. '
  257. '--------------------------------------------------------------------------
  258. FUNCTION GetOldPath STATIC AS STRING
  259.  
  260.    OldPath$ = ""
  261.    SetSymbolValue "OldPath", OldPath$
  262.  
  263.    IF IsNDWRunning = 0 THEN
  264.  
  265.       DriveListLength% = GetListLength( "DriveList" )
  266.  
  267.       IF DriveListLength% = 0 THEN
  268.          Result% = MemRelease
  269.          Result% = DoMsgBox( "You must have at least one hard disk to install America Online for Windows", "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  270.          END
  271.       END IF
  272.  
  273.       ListEntry% = 1
  274.       WHILE ( ListEntry% <= DriveListLength% )
  275.          Drive$ = GetListItem( "DriveList", ListEntry% )
  276.          Result% = FindWaolOnDrive( Drive$ )
  277.          ListEntry% = ListEntry% + 1
  278.       WEND
  279.  
  280.    ELSE
  281.  
  282. OLDPATH:
  283.       UIPop 1
  284.       SetSymbolValue "EditTextIn", OldPath$
  285.       SetSymbolValue "EditFocus", "END"
  286. OLDPATH1:
  287.       Response$ = UIStartDlg( "mscuistf.dll", PATHOLD1, "FEditDlgProc", 0, "" )
  288.  
  289.       IF Response$ = "REACTIVATE" THEN
  290.          GOTO OLDPATH1
  291.       ELSEIF Response$ = "EXIT" OR Response$ = "CANCEL" THEN
  292.          UIPop 1
  293.          AskExit( EXITCLEAN )
  294.          GOTO OLDPATH
  295.       END IF
  296.  
  297.       OldPath$ = GetSymbolValue( "EditTextOut" )
  298.  
  299.       IF OldPath$ <> "" THEN
  300.          IF MID$( OldPath$, 2, 1 ) <> ":" OR MID$( OldPath$, 3, 1 ) <> "\" THEN
  301.             UIPop 1
  302.             BadPath( BADPATH1 )
  303.             GOTO OLDPATH1
  304.          ELSEIF DoesDirExist( OldPath$ ) = 0 THEN
  305.             UIPop 1
  306.             BadPath( BADPATH1 )
  307.             GOTO OLDPATH1
  308.          ELSEIF FindFileInTree( "WAOL.EXE", OldPath$ ) = "" OR FindFileInTree( "MAIN.IDX", MAKEPATH( OldPath$, "IDB" ) ) = "" THEN
  309.             UIPop 1
  310.             BadPath( BADPATH1 )
  311.             GOTO OLDPATH1
  312.          END IF
  313.       END IF
  314.  
  315.       SetSymbolValue "OldPath", OldPath$
  316.       UIPop 1
  317.  
  318.       sz$ = UIStartDlg("mscuistf.dll", EXAMINING, "FModelessDlgProc", 0, "")
  319.  
  320.    END IF
  321.  
  322.    GetOldPath = GetSymbolValue( "OldPath" )
  323.  
  324. END FUNCTION
  325.  
  326. '--------------------------------------------------------------------------
  327. ' FindDriveWithSpace
  328. '
  329. '--------------------------------------------------------------------------
  330. FUNCTION FindDriveWithSpace( OldPath$ ) STATIC AS STRING
  331.  
  332. TRYAGAIN:
  333.  
  334.    NewPath$ = ""
  335.    OldDrive$ = ""
  336.    SpaceNeeded = 1
  337.  
  338.    IF OldPath$ <> "" THEN
  339.       SpaceNeeded& = CheckSpace( MID$( OldPath$, 1, 3 ) )
  340.       IF SpaceNeeded& = 0 THEN
  341.          NewPath$ = RemoveLastDir( OldPath$ )+DEFAULTDIR
  342.       ELSE
  343.          OldDrive$ = MID$( OldPath$, 1, 1 )
  344.       END IF
  345.    END IF
  346.  
  347.    DriveListLength% = GetListLength( "DriveList" )
  348.  
  349.    IF NewPath$ = "" THEN
  350.       ListEntry% = 1
  351.       WHILE ( SpaceNeeded& > 0 AND ListEntry% <= DriveListLength% )
  352.          Drive$ = GetListItem( "DriveList", ListEntry% )
  353.          IF Drive$ <> OldDrive$ THEN
  354.             SpaceNeeded& = CheckSpace( Drive$+":\"+DEFAULTDIR )
  355.          END IF
  356.          ListEntry% = ListEntry% + 1
  357.       WEND
  358.       IF SpaceNeeded& = 0 THEN
  359.          NewPath$ = Drive$+":\"+DEFAULTDIR
  360.       END IF
  361.    END IF
  362.  
  363.    IF NewPath$ = "" THEN
  364.       UIPop 1
  365.  
  366. RESUMED:
  367.  
  368.       Response$ = UIStartDlg( "mscuistf.dll", LOWDISKSPACE, "FInfoDlgProc", 0, "" )
  369.       UIPop 1
  370.       IF Response$ = "EXIT" OR Response$ = "CANCEL" THEN
  371.          AskExit( EXITHELP )
  372.          GOTO RESUMED
  373.       END IF
  374.       sz$ = UIStartDlg("mscuistf.dll", EXAMINING, "FModelessDlgProc", 0, "")
  375.       GOTO TRYAGAIN
  376.    END IF
  377.  
  378.    FindDriveWithSpace = NewPath$
  379.  
  380. END FUNCTION
  381.  
  382. '--------------------------------------------------------------------------
  383. ' BuildNewPath
  384. '
  385. '--------------------------------------------------------------------------
  386. FUNCTION BuildNewPath( OldPath$ ) STATIC AS STRING
  387.  
  388.    NewPath$ = FindDriveWithSpace( OldPath$ )
  389.  
  390.    IF NewPath$ <> "" THEN
  391.  
  392.       IF DoesDirExist( NewPath$ ) = 1 THEN
  393.  
  394.          Letter$ = "A"
  395.          Result% = 1
  396.  
  397.          WHILE( ASC( Letter$ ) <= ASC( "Z" ) AND Result% = 1 )
  398.             Result% = DoesDirExist( NewPath$+Letter$ )
  399.             IF Result% = 1 THEN
  400.                Letter$ = CHR$( ASC( Letter$ ) + 1 )
  401.             END IF
  402.          WEND
  403.  
  404.          IF Result% = 0 THEN
  405.             NewPath$ = NewPath$+Letter$
  406.          ELSE
  407.             Result% = DoMsgBox( "Could not create new directory for America Online for Windows.", "America Online for Windows - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  408.             NewPath$ = ""
  409.             ERROR STFERR
  410.          END IF
  411.  
  412.       END IF
  413.  
  414.    END IF
  415.  
  416.    SetSymbolValue "NewPath", NewPath$ 
  417.  
  418.    BuildNewPath = NewPath$
  419.  
  420. END FUNCTION
  421.  
  422. '--------------------------------------------------------------------------
  423. ' GetModemSetup
  424. '
  425. '--------------------------------------------------------------------------
  426. FUNCTION GetModemSetup STATIC AS INTEGER
  427.  
  428. TRYAGAIN:
  429.  
  430.    Result% = FindModem
  431.  
  432.    IF Result% = 0 THEN
  433.       UIPop 1
  434.  
  435. RESUMED:
  436.  
  437.       Response$ = UIStartDlg( "mscuistf.dll", LOSTMODEM, "FInfoDlgProc", 0, "" )
  438.       UIPop 1
  439.       IF Response$ = "EXIT" OR Response$ = "CANCEL" THEN
  440.          AskExit( EXITHELP )
  441.          GOTO RESUMED
  442.       END IF
  443.       IF Response$ = "BACK" THEN
  444.          sz$ = UIStartDlg("mscuistf.dll", EXAMINING, "FModelessDlgProc", 0, "")
  445.          GOTO TRYAGAIN
  446.       END IF
  447.    END IF
  448.  
  449.    GetModemSetup = Result%
  450.  
  451. END FUNCTION
  452.  
  453. '--------------------------------------------------------------------------
  454. ' MakePath
  455. '
  456. '--------------------------------------------------------------------------
  457. FUNCTION MakePath( Path$, Addition$ ) STATIC AS STRING
  458.  
  459.     IF Path$ = "" THEN
  460.         MakePath = Addition$
  461.     ELSEIF Addition$ = "" THEN
  462.         MakePath = Path$
  463.     ELSEIF MID$( Path$, LEN( Path$ ), 1 ) = "\" THEN
  464.         MakePath = Path$ + Addition$
  465.     ELSE
  466.         MakePath = Path$ + "\" + Addition$
  467.     END IF
  468.  
  469. END FUNCTION
  470.  
  471. '--------------------------------------------------------------------------
  472. ' CopyOldFile
  473. '
  474. '--------------------------------------------------------------------------
  475. SUB CopyOldFile( FromPath$, ToPath$, cmo%, fAppend% ) STATIC
  476.  
  477.     IF DoesFileExist( FromPath$, femExists ) = 1 THEN
  478.         CopyFile FromPath$, ToPath$,  cmo%, fAppend%
  479.     END IF
  480.  
  481.  
  482. END SUB
  483.  
  484. '--------------------------------------------------------------------------
  485. ' RemoveLastDir
  486. '
  487. '--------------------------------------------------------------------------
  488. FUNCTION RemoveLastDir( Path$ ) STATIC AS STRING
  489.  
  490.    n% = LEN( Path$ )
  491.    WHILE ( n% > 0 AND MID$( Path$, n%, 1 ) <> "\" )
  492.       n% = n% - 1
  493.    WEND
  494.  
  495.    RemoveLastDir = MID$( Path$, 1, n% )
  496.  
  497. END FUNCTION
  498.  
  499. '--------------------------------------------------------------------------
  500. ' CheckSpace
  501. '
  502. '--------------------------------------------------------------------------
  503. FUNCTION CheckSpace( Path$ ) STATIC AS LONG
  504.  
  505.    Drive% = ASC(Path$) - ASC("A") + 1
  506.  
  507.    FOR n% = 1 TO 26 STEP 1
  508.       AddListItem "ExtraCost", "0"
  509.    NEXT n%
  510.                                   
  511.    ReplaceListItem "ExtraCost", Drive%, "510240"
  512.  
  513.    ClearCopyList
  514.    AddSectionFilesToCopyList "WAOL", SourcePath$, Path$
  515.    DestinationPath$ = MakePath(Path$, "IDB")
  516.    AddSectionFilesToCopyList "IDB",  SourcePath$, DestinationPath$
  517.    DestinationPath$ = MakePath(Path$, "TOOL")
  518.    AddSectionFilesToCopyList "TOOL", SourcePath$, DestinationPath$
  519.    DestinationPath$ = MakePath(Path$, "CCL")
  520.    AddSectionFilesToCopyList "CCL",  SourcePath$, DestinationPath$
  521.    DestinationPath$ = MakePath(Path$, "MPM")
  522.    AddSectionFilesToCopyList "MPM",  SourcePath$, DestinationPath$
  523.  
  524.    SpaceNeeded& = GetCopyListCost( "ExtraCost", "Cost", "" )
  525.    ClearCopyList
  526.  
  527.    Cost$ = GetListItem( "Cost", Drive% )
  528.  
  529.    RemoveSymbol "ExtraCost"
  530.    RemoveSymbol "Cost"
  531.  
  532.    IF SpaceNeeded& = 0 THEN
  533.       CheckSpace = 0
  534.    ELSE
  535.       CheckSpace = VAL( Cost$ )
  536.    END IF
  537.  
  538. END FUNCTION
  539.  
  540. '--------------------------------------------------------------------------
  541. ' Install
  542. '
  543. '--------------------------------------------------------------------------
  544. SUB Install( OldPath$, NewPath$ ) STATIC
  545.  
  546.    CreateDir NewPath$, cmoNone
  547.  
  548.    IF OldPath$ = NewPath$ THEN
  549.       Replace% = 1
  550.    ELSE
  551.       Replace% = 0
  552.    END IF
  553.     
  554.    IF OldPath$ <> "" THEN
  555.       i% = SaveOldEnvironment( Replace% )
  556.    END IF
  557.  
  558.    SetCopyGaugePosition 10, 75
  559.  
  560.    AbortPath$ = NewPath$
  561.  
  562.    AddSectionFilesToCopyList "WAOL", SourcePath$, NewPath$
  563.    DestinationPath$ = MakePath(NewPath$, "IDB")
  564.    CreateDir DestinationPath$, cmoNone
  565.    AddSectionFilesToCopyList "IDB",  SourcePath$, DestinationPath$
  566.    DestinationPath$ = MakePath(NewPath$, "TOOL")
  567.    CreateDir DestinationPath$, cmoNone
  568.    AddSectionFilesToCopyList "TOOL", SourcePath$, DestinationPath$
  569.    DestinationPath$ = MakePath(NewPath$, "CCL")
  570.    CreateDir DestinationPath$, cmoNone
  571.    AddSectionFilesToCopyList "CCL",  SourcePath$, DestinationPath$
  572.    DestinationPath$ = MakePath(NewPath$, "MPM")
  573.    CreateDir DestinationPath$, cmoNone
  574.    AddSectionFilesToCopyList "MPM",  SourcePath$, DestinationPath$
  575.    CopyFilesInCopyList
  576.  
  577.    DestinationPath$ = MakePath(NewPath$,"DOWNLOAD")
  578.    CreateDir DestinationPath$, cmoNone
  579.    DestinationPath$ = MakePath(NewPath$,"SPOOL")
  580.    CreateDir DestinationPath$, cmoNone
  581.  
  582.    IF OldPath$ <> "" AND OldPath$ <> NewPath$ THEN
  583.       WildcardCopy MakePath( OldPath$, "IDB"), MakePath( NewPath$, "IDB"), "*.MAL"
  584.       WildcardCopy MakePath( OldPath$, "IDB"), MakePath( NewPath$, "IDB"), "*.ARH"
  585.       WildcardCopy MakePath( OldPath$, "IDB"), MakePath( NewPath$, "IDB"), "*.PND"
  586.  
  587.       CopyOldFile MakePath( OldPath$, "IDB\PENDING.LST"),  MakePath( NewPath$, "IDB\PENDING.LST"),  cmoNone, 0
  588.       CopyOldFile MakePath( OldPath$, "IDB\STYLE.LST"),    MakePath( NewPath$, "IDB\STYLE.LST"),    cmoNone, 0
  589.       CopyOldFile MakePath( OldPath$, "IDB\ARCHIVE.LST"),  MakePath( NewPath$, "IDB\ARCHIVE.LST"),  cmoNone, 0
  590.       CopyOldFile MakePath( OldPath$, "IDB\LOCALITY.LST"), MakePath( NewPath$, "IDB\LOCALITY.LST"), cmoNone, 0
  591.       CopyOldFile MakePath( OldPath$, "IDB\ADDRBK.LST"),   MakePath( NewPath$, "IDB\ADDRBK.LST"),   cmoNone, 0
  592.  
  593.       CopyOldFile MakePath( OldPath$, "GOTO.INI"),         MakePath( NewPath$, "GOTO.INI"),         cmoOverwrite, 0
  594.  
  595.       CopyOldFile MakePath( OldPath$, "CCL\SPRINT.CCL"),   MakePath( NewPath$, "CCL\SPRINT.OLD"),   cmoNone, 0
  596.       CopyOldFile MakePath( OldPath$, "CCL\TYMNET.CCL"),   MakePath( NewPath$, "CCL\TYMNET.OLD"),   cmoNone, 0
  597.       CopyOldFile MakePath( OldPath$, "CCL\TCP.CCL"),      MakePath( NewPath$, "CCL\TCP.OLD"),      cmoNone, 0
  598.       CopyOldFile MakePath( OldPath$, "CCL\DPAC.CCL"),     MakePath( NewPath$, "CCL\DPAC.OLD"),     cmoNone, 0
  599.  
  600.       OldDriverName$ = GetSymbolValue( "OldDriverName" )
  601.       IF OldDriverName$ <> "" THEN
  602.          CopyOldFile MakePath( OldPath$, "MPM\"+OldDriverName$ ), MakePath( NewPath$, "MPM\PREVIOUS.MDM"), cmoNone, 0
  603.       END IF
  604.    END IF
  605.  
  606.    i% = SetupNewEnvironment( Replace% )
  607.  
  608.    CreateIniKeyValue "WIN.INI", "sounds", "Welcome",         MakePath(NewPath$, "welcome.wav"),  cmoOverwrite
  609.    CreateIniKeyValue "WIN.INI", "sounds", "Goodbye",         MakePath(NewPath$, "goodbye.wav"),  cmoOverwrite
  610.    CreateIniKeyValue "WIN.INI", "sounds", "IM",              MakePath(NewPath$, "im.wav"),       cmoOverwrite
  611.    CreateIniKeyValue "WIN.INI", "sounds", "File's Done",     MakePath(NewPath$, "filedone.wav"), cmoOverwrite
  612.    CreateIniKeyValue "WIN.INI", "sounds", "You've Got Mail", MakePath(NewPath$, "gotmail.wav"),  cmoOverwrite
  613.  
  614.    CreateProgmanGroup "America Online", "", cmoNone
  615.    ShowProgmanGroup   "America Online",  1, cmoNone
  616.    CreateProgmanItem  "America Online", "America Online Double-Click to start", MakePath(NewPath$,"WAOL.EXE"), "", cmoOverwrite
  617.  
  618.    AbortPath$ = ""
  619.  
  620. END SUB
  621.  
  622. '--------------------------------------------------------------------------
  623. ' Review
  624. '
  625. '--------------------------------------------------------------------------
  626. FUNCTION Review( OldPath$, NewPath$ ) STATIC AS INTEGER
  627.  
  628. '
  629. '
  630. '
  631.    Review = 0
  632. '
  633. '
  634. '
  635. OLDPATH:
  636.    OldTemp$ = OldPath$
  637.    SetSymbolValue "EditTextIn", OldPath$
  638.    SetSymbolValue "EditFocus", "END"
  639. OLDPATH1:
  640.    IF OldPath$ = "" THEN
  641.       Response$ = UIStartDlg( "mscuistf.dll", PATHOLD1, "FEditDlgProc", 0, "" )
  642.    ELSE
  643.       Response$ = UIStartDlg( "mscuistf.dll", PATHOLD,  "FEditDlgProc", 0, "" )
  644.    END IF
  645.  
  646.    IF Response$ = "REACTIVATE" THEN
  647.       GOTO OLDPATH1
  648.    ELSEIF Response$ = "CANCEL" OR Response$ = "EXIT" THEN
  649.       UIPop 1
  650.       GOTO CANCEL
  651.    ELSEIF Response$ <> "CONTINUE" THEN
  652.       UIPop 1
  653.       GOTO OLDPATH
  654.    END IF
  655.  
  656.    OldTemp$ = GetSymbolValue( "EditTextOut" )
  657.  
  658.    IF OldTemp$ <> "" THEN
  659.       IF MID$( OldTemp$, 2, 1 ) <> ":" OR MID$( OldTemp$, 3, 1 ) <> "\" THEN
  660.          UIPop 1
  661.          BadPath( BADPATH1 )
  662.          GOTO OLDPATH1
  663.       ELSEIF DoesDirExist( OldTemp$ ) = 0 THEN
  664.          UIPop 1
  665.          BadPath( BADPATH1 )
  666.          GOTO OLDPATH1
  667.       ELSEIF FindFileInTree( "WAOL.EXE", OldTemp$ ) = "" OR FindFileInTree( "MAIN.IDX", MAKEPATH( OldTemp$, "IDB" ) ) = "" THEN
  668.          UIPop 1
  669.          BadPath( BADPATH1 )
  670.          GOTO OLDPATH1
  671.       END IF
  672.    END IF
  673.  
  674.    UIPop 1
  675. '
  676. '
  677. '
  678. NEWPATH:
  679.    NewTemp$ = NewPath$
  680.    SetSymbolValue "EditTextIn", NewPath$
  681.    SetSymbolValue "EditFocus", "END"
  682. NEWPATH1:
  683.    IF OldTemp$ = "" THEN
  684.       Response$ = UIStartDlg( "mscuistf.dll", PATHONLY, "FEditDlgProc", 0, "" )
  685.    ELSE
  686.       Response$ = UIStartDlg( "mscuistf.dll", PATHNEW,  "FEditDlgProc", 0, "" )
  687.    END IF
  688.  
  689.    IF Response$ = "REACTIVATE" THEN
  690.       GOTO NEWPATH1
  691.    ELSEIF Response$ = "CANCEL" THEN
  692.       UIPop 1
  693.       GOTO CANCEL
  694.    ELSEIF Response$ <> "CONTINUE" THEN
  695.       UIPop 1
  696.       GOTO NEWPATH
  697.    END IF
  698.  
  699.    NewTemp$ = GetSymbolValue("EditTextOut")
  700.  
  701.    IF IsDirWritable( NewTemp$ ) = 0 OR INSTR( NewTemp$, "." ) <> 0 THEN
  702.       UIPop 1
  703.       BadPath( BADPATH1 )
  704.       GOTO NEWPATH1
  705.    END IF
  706.  
  707.    SpaceNeeded& = CheckSpace( NewTemp$ )
  708.  
  709.    IF SpaceNeeded& <> 0 THEN
  710.       UIPop 1
  711. RESUMED:
  712.       Response$ = UIStartDlg( "mscuistf.dll", LOWDISKSPACE1, "FInfoDlgProc", 0, "" )
  713.       UIPop 1
  714.       IF Response$ = "EXIT" THEN
  715.          AskExit( EXITHELP )
  716.          GOTO RESUMED
  717.       END IF
  718.       GOTO NEWPATH1
  719.    END IF
  720.  
  721.    UIPop 1
  722.  
  723.    IF OldTemp$ <> OldPath$ THEN
  724.       SetSymbolValue "OldPath", OldTemp$
  725.    END IF
  726.  
  727.    IF NewTemp$ <> NewPath$ THEN
  728.       SetSymbolValue "NewPath", NewTemp$
  729.    END IF
  730.  
  731.    Review = 1
  732.  
  733. CANCEL:
  734.  
  735.  
  736. END FUNCTION
  737.  
  738.