source: php/trunk/doxygen/doclaunch.vbs@ 3

Last change on this file since 3 was 3, checked in by cla, 14 years ago

rdfint

  • fixed library name in license comments
  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1Option Explicit
2
3' RDFInt.php - RDF Interfaces for PHP
4' Copyright 2011 netlabs.org
5' Author: Christian Langanke, Adrian Gschwend
6'
7' Licensed under the Apache License, Version 2.0 (the "License");
8' you may not use this file except in compliance with the License.
9' You may obtain a copy of the License at
10'
11' http://www.apache.org/licenses/LICENSE-2.0
12'
13' Unless required by applicable law or agreed to in writing, software
14' distributed under the License is distributed on an "AS IS" BASIS,
15' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16' See the License for the specific language governing permissions and
17' limitations under the License.
18
19Const CONST_REGVAL_PREFBROWSER_FILETYPE = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice\Progid"
20Const CONST_REGSUBVALL_FILETYPE_COMMAND = "shell\open\command\"
21
22Dim rc : rc = Main
23WScript.Quit rc
24
25'===============================================================
26Function Main( )
27 Main = 0
28
29 Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
30 Dim oWshShell : Set oWshShell = Wscript.CreateObject("Wscript.Shell")
31
32 ' get name of configfile from 1st parm
33 If (WScript.Arguments.Count = 0) Then
34 WScript.Echo "Error: no config file specified!"
35 Main = 87
36 Exit Function
37 End If
38 Dim strIndexFile : strIndexFile = oFSO.GetAbsolutePathName( WScript.Arguments(0))
39 If (Not oFSO.FileExists( strIndexFile)) Then
40 WScript.Echo "Error: file not found: " & strCfgFile
41 Main = 2
42 Exit Function
43 End If
44
45 ' get command for default browser
46 Dim strUrl : strUrl = "file:///" & Replace( strIndexFile, "\", "/")
47 Dim strFileType : strFileType = oWshShell.RegRead( CONST_REGVAL_PREFBROWSER_FILETYPE)
48 Dim strExec : strExec = oWshShell.RegRead( "HKEY_CLASSES_ROOT\" & strFileType & "\" & CONST_REGSUBVALL_FILETYPE_COMMAND)
49 If (InStr( strExec, "%1") > 0) Then
50 strExec = Replace( strExec, "%1", strUrl)
51 Else
52 strExec = strExec & " """ & strUrl & """"
53 End If
54
55 ' launch browser with file
56 oWshShell.Run strExec
57
58End Function
59'===============================================================
Note: See TracBrowser for help on using the repository browser.