Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

Creating setup wizard to check for java installation, and run a executable jar file

Hello, We are wanting to make an exe file, a setup wizard that will be downloaded by users of our website. (A plugin of sorts). What we want this plugin to do is look to see if java is installed first, and if not install it, then run an executable jar file which will set a registration key. Is there a program, or any website that will help us out with doing this? Thank-you
  • 2
1 Solution
What about something like this:
(copy the code below, paste it into an empty text file, save as jhome.vbs and run it)

'Start code
Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set shell = WScript.CreateObject( "WScript.Shell" )
jhome = shell.ExpandEnvironmentStrings("%JAVA_HOME%")
If jhome = "%JAVA_HOME%" OR jhome = "" Then
      'Run your installer by adding the path to it in place of "notepad"
      'eg "C:\whatever\yourinstallername.exe"
      shell.Run "notepad"
      MsgBox "Java is installed.  Java home is: " + jhome      
End If
'end code

BTW - can you run a jar file if Java is not installed?
cwitr329Author Commented:
Hello, Thanks for the help. A jar file cannont be installed if java isnt there, that is why we are trying to make a plugin that first checks if java is installed, if its not then it installs it. Then runs the jar file. If need be, not sure, the user might have to restart then the jar file will run on startup? Not sure, trying to find a solution. Anyone?
cwitr329Author Commented:
Also, it doesnt have to be an exe, just something they can download from our site, and run...

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now