home *** CD-ROM | disk | FTP | other *** search
- Dim Fso
-
- Function SetRavenLiteLocation()
- On Error Resume Next
-
- Set fso = CreateObject ("Scripting.FileSystemObject")
- If Err.Number <> 0 Then
- MsgBox "Could not create Scripting.FileSystemObject."
- Exit Function
- End If
-
- Set drives = fso.Drives
- If Err.Number <> 0 Then
- MsgBox "Could not a list of drives on system."
- Exit Function
- End If
-
- For Each drive In drives
- If drive.DriveType = 2 Then
- location = "C:\Program Files\Raven Lite 1.0"
- If IsRavenLiteAtLocation(location) Then
- Set folder = fso.GetFolder(location)
- Session.Property("RAVENLITELOCATION") = folder.Path
- End If
- End If
- Next
- End Function
-
- Function IsRavenLiteAtLocation(parent)
- IsRavenLiteAtLocation = False
-
- Set folder = fso.GetFolder(parent)
- If Not(folder Is Nothing) Then
- path = fso.BuildPath(parent, "RavenLiteLauncher.exe")
- Set file = fso.GetFile(path)
- If Not (file Is Nothing) Then
- IsRavenLiteAtLocation = True
- Else
- Set sf = f.SubFolders
- For Each directory in sf
- If IsRavenLiteAtLocation(directory) Then
- IsRavenLiteAtLocation = True
- End If
- Next
- End If
- End If
- End Function
-
- Function SetMediaPath()
- On Error Resume Next
-
- data = Split(Session.Property("CustomActionData"), "|")
-
- Set Conn = CreateObject("ADODB.Connection")
- If Err.Number <> 0 Then
- MsgBox "Could not create ADODB.Connection."
- Exit Function
- End If
-
- Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & data(0) & "Database\Database.mdb"
- If Err.Number <> 0 Then
- MsgBox "Could not open connection to database."
- Exit Function
- End If
-
- Conn.Execute "UPDATE MediaDirectory SET PrimaryPath='" & data(1) & "'"
- If Err.Number <> 0 Then
- MsgBox "Could not update the media path."
- Exit Function
- End If
-
- Conn.Close
- If Err.Number <> 0 Then
- MsgBox "Could not close the database connection."
- Exit Function
- End If
- End Function
-