'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:BindEvents:1:129
Private Sub BindEvents(Byval Objectname_ As String)
Static Source As BUTTON
Set Source = Bind(Objectname_)
On Event Click From Source Call Click
End Sub
'++LotusScript Development Environment:2:2:Click:1:12
Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
Dim rval As Integer 'Return value
Dim strCDDrive As String 'CD drive letter
Dim strCDDir As String 'CD directory
Dim strAPCDDir As String 'Approach 96 CD directory
Dim strSTCDDir As String 'SmartSuite 96 CD directory
Dim strCurDrive As String 'Current drive letter
Dim strCurDir As String 'Current directory
'Initializations
rval = 1
strCDDrive = ""
strAPCDDir = "\EXTRA\APPROACH\WEBTREK\"
strSTCDDir = "\EXTRA\APPROACH\WEBTREK\"
strCurDrive = ""
strCurDir = ""
strCDDir = strAPCDDir 'Start by assuming an Approach CD Installation.
On Error 68 Goto WrongDrive 'Error # for changing to invalid drive.
On Error 76 Goto WrongDir 'Error # for changing to invalid directory.
rval = Messagebox(|The WebTrek browser ships with the CD-ROM versions of Approach 97 and SmartSuite 97.
Please verify the CD-ROM is in the drive or the Approach home network install path is available before proceeding.|, 1, "WebTrek Install")
If (rval = 1) Then 'User hit OK.
strCurDrive = Curdrive 'Get the current drive letter.
strCurDir = Curdir 'Get the current directory.
GetInfo:
strInput = ""
strCDDrive = Inputbox("Enter CD-ROM drive letter or Approach home install path.", "WebTrek Install", "D", 150, 150)
strCDDrive = Trim$(strCDDrive)
strInput = strCDDrive
If(strCDDrive <> "") Then
' If user entered entire network path, process the path string
If(Len(strCDDrive))>2 Then
strCDDir = Right$(strCDDrive, Len(strCDDrive)-2)
strCDDrive = Left$(strCDDrive,2)
If Right$(strCDDir,1)<>"\" Then
strCDDir = strCDDir + "\"
End If
strCDDir = strCDDir + "extra\approach\webtrek"
End If
ChangeDir:
Chdrive strCDDrive
Chdir strCDDir
rval = Shell("WEBTREK.EXE", 1)
Chdrive strCurDrive 'Change back to the original drive.
Chdir strCurDir 'Change back to the original directory.
rval = 1
rval = Messagebox("Click OK when you're done installing the WebTrek browser.", 0, "WebTrek Install")
If (rval = 1) Then 'User hit OK.
'Now we need to close the .APR and open it again.
rval = 1
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")
If (rval = 1) Then
CurrentDocument.Window.Close
End If
End If
Goto EndInstall
End If
Goto EndInstall
Else
Goto EndInstall
End If
'If the user entered an invalid drive letter.
WrongDrive:
rval = 1
rval = Messagebox("Drive or network path specification " & strInput & " is invalid. Please enter a valid drive letter or network path specification.", 1, "WebTrek Install")
If (rval = 1) Then 'User hit ok.
Resume GetInfo
Else
Resume EndInstall
End If
'If the user entered a drive letter, but not the CDdrive letter.
WrongDir:
rval = 1
If(strCDDir = strSTCDDir) Then 'check to see if we've been here before
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")
If (rval = 1) Then 'User hit ok.
strCDDir = strAPCDDir 'if the user wants another try, set the CD Directory back to Approach CD
Resume GetInfo
Else
Resume EndInstall
End If
Else
strCDDir = strSTCDDir 'if we couldn't find the Approach CD directory, try the SmartSuite CD directory