home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 November
/
PCWorld_2005-11_cd.bin
/
software
/
temacd
/
ppsee
/
PPSeeSetup.exe
/
ppsee.vbs
< prev
next >
Wrap
Text File
|
2005-09-25
|
3KB
|
80 lines
' ===================================================================
' runJ4Win.vbs version 0.93 - general starting script
' for a Java application on MS Windows 98, ME, 2000, XP, 95+WSH, NT+WSH.
'
' Copyright (C) 1993-1994 Pavel Ponec, e-mail:ppsee@centrum.cz
' Home Page: http://pponec.net/ppsee/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.93 - 2004/08/09 - 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\jre1.5.0_04\bin\javaw.exe"
' Maximal Memory Alocation:
parameter = "-Xmx128m"
' Java Archive:
jarName = "bin\PPSee.jar"
' Default Image Editor Path:
imageEdit = ""
' === CORE: ===
Sub error(ByVal enable)
If enable Then
Wscript.Echo "WARNING from ""ppsee.vbs"" script:" & vbCrLf & vbCrLf & "File """ & java & """ was not found! " _
& vbCrLf & "Ensure you have installed a Java Runtime" _
& vbCrLf & "or try to modify a ""java"" variable in the script." _
& vbCrLf & "See ""read-me.html"" file for more information." _
& vbCrLf & vbCrLf & "Java Runtime download page: http://java.com/download/"
WScript.Quit(1)
End If
End Sub
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\"
on error resume next
javax = shell.RegRead(jreg & "CurrentVersion")
error(Err.Number<>0)
javax = shell.RegRead(jreg & javax & "\JavaHome") & "\bin\javaw.exe"
error(Err.Number<>0)
On Error Goto 0
error(not fso.FileExists(javax))
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 ===