home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 September
/
Chip_2004-09_cd1.bin
/
software
/
pp
/
setup.exe
/
ppsee.vbs
< prev
next >
Wrap
Text File
|
2004-05-04
|
3KB
|
68 lines
' ===================================================================
' runJ4Win.vbs version 0.91 - general starting script
' for a Java application on MS Windows 98, ME, 2000, XP, 95+WSH, NT+WSH.
'
' Copyright (C) 1993 Pavel Ponec, e-mail:ppsee@centrum.cz
' Home Page: http://ppsee.wz.cz/runj4/index.htm
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation version 2 of the License.
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY.
' Please read bin/license-gpl.txt for the full details. A copy of the GPL may
' be found at http://www.gnu.org/licenses/gpl.txt .
'
' A History:
' rel. 0.92 - 2003/11/30 - The first public version
' rel. 0.92b - 2004/02/18 - Modified for PPSee java program
'
' Usage: wscript ppsee.vbs
' ===================================================================
' Modify path to file "javaw.exe" in case you can't run the application.
java = "C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe"
' Maximal Memory Alocation:
parameter = "-Xmx128m"
' Java Archive:
jarName = "bin\PPSee.jar"
' Default Image Editor Path:
imageEdit = ""
' === CORE: ===
set shell = WScript.CreateObject("Wscript.Shell")
set fso = WScript.CreateObject("Scripting.FileSystemObject")
javax = java
if not fso.FileExists(javax) then
jreg = "HKLM\Software\JavaSoft\Java Runtime Environment\"
javax = shell.RegRead(jreg & "CurrentVersion")
javax = shell.RegRead(jreg & javax & "\JavaHome") & "\bin\javaw.exe"
if not fso.FileExists(javax) then
Wscript.Echo "ERROR in runJ4Win script:" & vbCrLf & "File """ & java & """ was not found!" & vbCrLf & "Try to modify a ""java"" variable in the current script."
WScript.Quit(1)
end if
end if
' HTML Viewer
htmlView = "HKLM\SOFTWARE\Classes\HTTP\shell\open\command\"
htmlView = shell.RegRead(htmlView)
htmlView = Replace (htmlView , """", "'")
' htmlView = Left(htmlView, InstrRev(htmlView, " "))
imageEdit = Replace (imageEdit, """", "'")
parameter = parameter & " " & "-DhtmlView=""" & htmlView & """ -DimageEdit=""" & imageEdit & """"
' User Parameters:
paru = ""
Set args = Wscript.Arguments
For i = 0 to args.Count-1
paru = paru & " " & args(i)
Next
path = WScript.ScriptFullName
path = Left(path, InstrRev(path, "\"))
param = """" & javax & """ " & parameter & " -jar """ & path & jarName & """" & paru
shell.Run(param)
' === EOF ===