home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 September / Chip_2004-09_cd1.bin / software / pp / setup.exe / ppsee.vbs < prev    next >
Text File  |  2004-05-04  |  3KB  |  68 lines

  1. ' ===================================================================
  2. ' runJ4Win.vbs version 0.91 - general starting script 
  3. ' for a Java application on MS Windows 98, ME, 2000, XP, 95+WSH, NT+WSH.
  4. ' Copyright (C) 1993 Pavel Ponec, e-mail:ppsee@centrum.cz
  5. ' Home Page: http://ppsee.wz.cz/runj4/index.htm
  6. ' This program is free software; you can redistribute it and/or modify
  7. ' it under the terms of the GNU General Public License as published by
  8. ' the Free Software Foundation version 2 of the License.
  9. ' This program is distributed in the hope that it will be useful,
  10. ' but WITHOUT ANY WARRANTY.
  11. ' Please read bin/license-gpl.txt for the full details. A copy of the GPL may 
  12. ' be found at http://www.gnu.org/licenses/gpl.txt .
  13. '
  14. ' A History:
  15. ' rel. 0.92  - 2003/11/30 - The first public version
  16. ' rel. 0.92b - 2004/02/18 - Modified for PPSee java program
  17. '
  18. ' Usage: wscript ppsee.vbs 
  19. ' ===================================================================
  20.  
  21. ' Modify path to file "javaw.exe" in case you can't run the application.
  22. java = "C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe" 
  23.  
  24. ' Maximal Memory Alocation:
  25. parameter = "-Xmx128m"
  26.  
  27. ' Java Archive:
  28. jarName = "bin\PPSee.jar"
  29.  
  30. ' Default Image Editor Path:
  31. imageEdit = ""
  32.  
  33. ' === CORE: ===
  34. set shell = WScript.CreateObject("Wscript.Shell")
  35. set fso   = WScript.CreateObject("Scripting.FileSystemObject")
  36. javax = java
  37. if not fso.FileExists(javax) then
  38.   jreg  = "HKLM\Software\JavaSoft\Java Runtime Environment\"
  39.   javax = shell.RegRead(jreg & "CurrentVersion")
  40.   javax = shell.RegRead(jreg & javax & "\JavaHome") & "\bin\javaw.exe"
  41.   if not fso.FileExists(javax) then
  42.     Wscript.Echo "ERROR in runJ4Win script:" & vbCrLf &  "File """ & java & """ was not found!" & vbCrLf &  "Try to modify a ""java"" variable in the current script."
  43.     WScript.Quit(1)
  44.   end if
  45. end if
  46. ' HTML Viewer
  47. htmlView = "HKLM\SOFTWARE\Classes\HTTP\shell\open\command\"
  48. htmlView = shell.RegRead(htmlView)
  49. htmlView = Replace (htmlView , """", "'")
  50. ' htmlView = Left(htmlView, InstrRev(htmlView, " "))
  51. imageEdit = Replace (imageEdit, """", "'")
  52. parameter = parameter & " " & "-DhtmlView=""" & htmlView & """ -DimageEdit=""" & imageEdit & """"
  53. ' User Parameters:
  54. paru = ""
  55. Set args = Wscript.Arguments
  56. For i = 0 to args.Count-1
  57.    paru = paru & " " & args(i) 
  58. Next
  59. path = WScript.ScriptFullName
  60. path = Left(path, InstrRev(path, "\"))
  61. param = """" & javax & """ " & parameter & " -jar """ & path & jarName & """" & paru
  62. shell.Run(param) 
  63. ' === EOF ===
  64.  
  65.  
  66.