Silent JRE Installation (Win32)

Hi all,

Whenever I install a Java application for someone who doesnt have current version of the JRE, I explicitly call the JRE installation program from my installation program (InstallShield).  This creates an installation inside of an installation.  This confuses some customers (usually not the smart ones ;)).  I would like to have an installation program that silently installs the JRE (along with XML and JMF) along with my own files.
Unfortunately, I can't just plop the files out there since I need the "Executable Jar" and Plugin capabilities.
I can't seem to find what all is done during the installation and I can't find anything on the web stating the registry entries that are made.
Im only concerned with the Windows side of things (UNIX people seem to know what they are doing... go figure :))

I found the following registry entries.  However, I don't know which ones I need (and if there are more).  
HKEY_CURRENT_USER\Software\JavaSoft\Java Plug-in  *
HKEY_LOCAL_MACHINE\Software\JavaSoft *
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\javaw.Exe
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\JRE 1.3
HKEY_USERS\.DEFAULT\Software\JavaSoft\Java Plug-in

I'd prefer not to blow up anything locally by playing around with it. (Ive done it before).  I know enough about the Win32 registry to be dangerous.
An extra 200 points if you can give me info about the installation of JMF (I believe thats just a jar file installation, but not sure) and XML (Id prefer the IBM implementation (until xerces comes out)).  This may also be a simple jar file implementation (although the Sun implementation does registry entries).

Thanks.  Any comments are welcome.
Who is Participating?
heyhey_Connect With a Mentor Commented:
well, you can always get RegistryMonitor  & FileMonitor ( and find what's happening yourself :)

re executable .jar files: I suppose that instalation routine has mapped the .jar file extension to java.exe (with some parameters)

re JMF: I suppose that you'll have to modify the PATH (or copy the JMF native .dlls to Windows/system/ directory)

just my 0.02 $ :)
So u need Executable jar... rt?
Here it is....

How to Create an Executable JAR File

                   In JDK 1.2, you can run a JAR-packaged application by simply double clicking a JAR file in
                   Windows Explorer or running it in the command line without specifying the class with the main
                   method.  In order to do this, simply follow the following steps

                   1. Create a manifest file, which is an ordinary text file that contains meta-information about the
                   archive stored in the JAR file and indicate which class is the application’s entry point.  You can do
                   this by adding the line:  

                   Main-Class: classname

                   into the manifest file.  The value, classname, is the name of the class that contains the main
                   method (e.g., com.cyberj.MyProgram).

                   2. Create the JAR files with the manifest file that contains the appropriate Main-Class:
                   header.  You could merge the manifest file you created in step 1 into the jar file’s manifest with
                   a command such as this:

                   jar cmf manifestfile myapp.jar com/cyberj/*.class

                   Let's look at the options and arguments used in this command:
                   · The c option indicates that you want to create a JAR file.
                   · The m option indicates that you want to merge information from an existing manifest file into
                   the manifest file of the JAR file you're creating.
                   · The f option indicates that you want the output to go to a file (the JAR file you're creating).
                   · manifestfile is the name of the existing text file whose contents you want included in the JAR
                   file's manifest.
                   · myapp.jar is the name that you want the resulting JAR file to have.
                   · The com/cyberj/*.class are the files you want to be placed in your JAR file.  This argument can
                   be a space-separated list of one or more files that you want to included in the JAR file.

                   You have to make sure that all necessary class files are included in the JAR file.  

                   3. With your JAR file prepared in this way, you can run the application com.cyberj.MyProgram
                   application from the command line in this way:

                   java -jar myapp.jar

                   Or simply double click the myapp.jar in windows explorer.

                   Note: The -jar option is not available for interpreters prior to version 1.2 of the Java
                   Development Kit.

I hope This will help u...

conickAuthor Commented:
I have that.
What I need is the registry entries that the JRE installation program makes in order for the Java Executable functionality work in Win32. I need that along with other functionality (the Plugin for browsers etc).

My question borders on off-topic. Since it has only to do with Win32 Registry entries and not Java code (or packaging).  However no other group would I find people who know specifics about the JRE installation program (or where to find them).
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

conickAuthor Commented:
Thanks heyhey_, I'll check it out.
(I don't know how you find this stuff :))

Points are still available if someone has done this type of thing and would like to share.
how's the huntin'??  
conickAuthor Commented:
be wery wery quiet.. im hunting wabbits.

I've been unavoidably detained until Monday on a different project.  I unfortunately haven't been able try out the sysinternal products to figure out whats being installed.
conickAuthor Commented:
too much #$^%&#% stuff to do.
(its not like its a bad problem)

Anyway...  A week and a half later.....

I havent had a whole lot of time to delve into this problem.  Although the time is fast approaching where I NEED to get this out. (Im suppose to ship the moment 1.3 comes out).

I've played with the tools heyhey mentioned a bit and was amazed by all the @&#^$( Windows was accessing.  I think the logs created for the installation of JMF is a few thousand lines long.  I just havent had time to parse it out.

Anyway I think the tools will work.  I'll try to post what I find when I actually get a chance to figure it all out.

I'll give heyhey the points for pointing out some good tools (I can use these for tons of things).


Why in the world wouldn't someone post what registry entries and files are placed during an install?  With all the standardizaation going on, cant we make that a standard?  
Whats with leaving entries hanging around after an uninstall? Wheres the uninstall police when you need them?
If I see CLASSPATH being set one more time without my permission, Im gonna scream.  (JMF installed it, and then the uninstall program doesnt get rid of it (its not set in autoexec either))

Thanks for letting me vent
I feel much better :)
thanks for the points :)

in fact good unistallation program should remember all the files and registry entries and remove them, but I'm not so familiar with Windows internals ...
conickAuthor Commented:
In case anyone is interested (or still listening in):

I found a couple of links on the Sun site.
This one I remember reading a long time ago.  Basically tells you what is ABSOLUTELY necessary.  This will not install the plugin OR the executable JAR. (This is not an option in my case since I need both the plugin and exe jar file working)

This is the method I will end up using.  I just tried it and it works very slick. (I use InstallShield and I didnt know this functionality existed).

Unfortunately, Silent InstallShield doesnt seem to work for JMF :(.
I may be able to get around it by simply placing the Windows specific DLLs in the %JAVA_HOME%\bin directory. There doesnt seem to be any "noticeably necessary" (huh?:)) registry entries installed during the process.
The JMF install also places the DLLs in %WinDir%\system (system32 for NT) but I believe that is for the M$ Java VM.

If anyone cares I'll post the final installation procedure for JRE, JMF, etc.
Drop a comment if you want me to post the final installation, I can also post the relevent entries in the logs from regmon.exe and/or filemon.exe. If not I wont clutter anyone's inbox anymore :)
i'm interested in the procedure for installing jmf
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.