home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 November / Pcwk1197.iso / LOTUS / Eng-ins / SMASTERS / APPROACH / SURFNET.MPR / SCRIPT / ApproachDoc / Setup / Body / btnInstallWebster.s (.txt) < prev    next >
Null Bytes Alternating  |  1997-01-09  |  8KB  |  117 lines

  1. '++LotusScript Development Environment:2:5:(Options):0:66
  2.  
  3. '++LotusScript Development Environment:2:5:(Forward):0:1
  4. Declare Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
  5.  
  6. '++LotusScript Development Environment:2:5:(Declarations):0:2
  7.  
  8. '++LotusScript Development Environment:2:2:BindEvents:1:129
  9. Private Sub BindEvents(Byval Objectname_ As String)
  10.     Static Source As BUTTON
  11.     Set Source = Bind(Objectname_)
  12.     On Event Click From Source Call Click
  13. End Sub
  14.  
  15. '++LotusScript Development Environment:2:2:Click:1:12
  16. Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
  17.     Dim rval As Integer   'Return value
  18.     Dim strCDDrive As String   'CD drive letter
  19.     Dim strCDDir As String   'CD directory
  20.     Dim strAPCDDir As String   'Approach 96 CD directory
  21.     Dim strSTCDDir As String   'SmartSuite 96 CD directory
  22.     Dim strCurDrive As String   'Current drive letter
  23.     Dim strCurDir As String   'Current directory
  24.     
  25.     'Initializations
  26.     rval = 1
  27.     strCDDrive = ""
  28.     strAPCDDir = "\EXTRA\APPROACH\WEBTREK\"
  29.     strSTCDDir = "\EXTRA\APPROACH\WEBTREK\"
  30.     strCurDrive = ""
  31.     strCurDir = ""
  32.     strCDDir = strAPCDDir 'Start by assuming an Approach CD Installation.
  33.     
  34.     On Error 68 Goto WrongDrive   'Error # for changing to invalid drive.
  35.     On Error 76 Goto WrongDir   'Error # for changing to invalid directory.
  36.     
  37.     rval = Messagebox(|The WebTrek browser ships with the CD-ROM versions of Approach 97 and SmartSuite 97.  
  38. Please verify the CD-ROM is in the drive or the Approach home network install path is available before proceeding.|, 1, "WebTrek Install")
  39.     If (rval = 1) Then   'User hit OK.
  40.         strCurDrive = Curdrive   'Get the current drive letter.
  41.         strCurDir = Curdir   'Get the current directory.
  42. GetInfo:
  43.         strInput = ""
  44.         strCDDrive = Inputbox("Enter CD-ROM drive letter or Approach home install path.", "WebTrek Install", "D", 150, 150)
  45.         strCDDrive = Trim$(strCDDrive)
  46.         strInput = strCDDrive
  47.         
  48.         
  49.         If(strCDDrive <> "") Then
  50. '            If user entered entire network path, process the path string            
  51.             If(Len(strCDDrive))>2 Then
  52.                 strCDDir = Right$(strCDDrive, Len(strCDDrive)-2)
  53.                 strCDDrive = Left$(strCDDrive,2)                
  54.                 
  55.                 If Right$(strCDDir,1)<>"\" Then
  56.                     strCDDir = strCDDir + "\"
  57.                 End If
  58.                 
  59.                 strCDDir = strCDDir + "extra\approach\webtrek"
  60.             End If
  61.             
  62. ChangeDir:            
  63.             Chdrive strCDDrive
  64.             Chdir strCDDir
  65.             rval = Shell("WEBTREK.EXE", 1)
  66.             Chdrive strCurDrive   'Change back to the original drive.
  67.             Chdir strCurDir   'Change back to the original directory.
  68.             
  69.             rval = 1
  70.             rval = Messagebox("Click OK when you're done installing the WebTrek browser.", 0, "WebTrek Install")
  71.             
  72.             If (rval = 1) Then   'User hit OK.
  73.                 'Now we need to close the .APR and open it again.
  74.                 rval = 1
  75.                 rval = Messagebox("Click OK to close the Surfnet application.  When you open it again, you will be able to use the WebTrek browser.  If you choose Cancel, you won't be able to use the browser until you close Surfnet and open it again.", 1, "WebTrek Install")
  76.                 If (rval = 1) Then
  77.                     CurrentDocument.Window.Close
  78.                 End If
  79.             End If
  80.             Goto EndInstall
  81.         End If
  82.         Goto EndInstall
  83.     Else
  84.         Goto EndInstall
  85.     End If
  86.     
  87.     
  88. 'If the user entered an invalid drive letter.
  89. WrongDrive:
  90.     rval = 1
  91.     rval = Messagebox("Drive or network path specification " & strInput & " is invalid.  Please enter a valid drive letter or network path specification.", 1, "WebTrek Install")
  92.     If (rval = 1) Then   'User hit ok.
  93.         Resume GetInfo
  94.     Else
  95.         Resume EndInstall
  96.     End If
  97.     
  98.     
  99. 'If the    user entered a drive letter, but not the CDdrive letter.
  100. WrongDir:
  101.     rval = 1
  102.     If(strCDDir = strSTCDDir) Then 'check to see if we've been here before
  103.         rval = Messagebox("Drive or network path specification " & strInput & " is not an available network path, not a valid CD-ROM drive letter, or the CD is not in the drive. Retry?", 1, "WebTrek Install")
  104.         If (rval = 1) Then   'User hit ok.
  105.             strCDDir = strAPCDDir 'if the user wants another try, set the CD Directory back to Approach CD
  106.             Resume GetInfo
  107.         Else
  108.             Resume EndInstall
  109.         End If
  110.     Else
  111.         strCDDir = strSTCDDir 'if we couldn't find the Approach CD directory, try the SmartSuite CD directory
  112.         Resume ChangeDir
  113.     End If        
  114.     
  115. EndInstall:    
  116.     
  117. End Sub