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

Posted on 2006-05-22
Last Modified: 2013-12-04
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
Question by:cwitr329
    LVL 23

    Accepted 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?

    Author Comment

    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?

    Author Comment

    Also, it doesnt have to be an exe, just something they can download from our site, and run...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: CSS Specialist

    We don’t have to sell you on the idea of becoming a developer. If you’re you here, you already know it’s one of the most lucrative (and fastest growing) career tracks out there. It’s CSS that allows you to set yourself apart from other web and mobile developers.

    After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
    Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now