Solved

Silent JRE Installation (Win32)

Posted on 2000-04-18
10
847 Views
Last Modified: 2013-11-23
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_CLASSES_ROOT\jarfile\shell\open\command
HKEY_CURRENT_USER\Software\JavaSoft\Java Plug-in  *
HKEY_LOCAL_MACHINE\Software\CLASSES\jarfile\shell\open\command
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.
Help.
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.
0
Comment
Question by:conick
10 Comments
 
LVL 3

Expert Comment

by:terajiv
ID: 2729234
So u need Executable jar... rt?
Here it is....

How to Create an Executable JAR File
                   BY JERSON CHUA, CYBERJ RESOURCES

                   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...

Rajiv
0
 
LVL 7

Author Comment

by:conick
ID: 2729271
Ack!
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).
0
 
LVL 16

Accepted Solution

by:
heyhey_ earned 200 total points
ID: 2729435
well, you can always get RegistryMonitor  & FileMonitor (www.sysinternals.com) 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 $ :)
0
 
LVL 7

Author Comment

by:conick
ID: 2730598
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.
0
 

Expert Comment

by:Ash_
ID: 2735966
how's the huntin'??  
:)
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 7

Author Comment

by:conick
ID: 2736274
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.
0
 
LVL 7

Author Comment

by:conick
ID: 2767208
ARRGHHH
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).

WARNING -- VENT ALERT :)

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 :)
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2768226
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 ...
0
 
LVL 7

Author Comment

by:conick
ID: 2793289
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)
http://java.sun.com/j2se/1.3/runtime_win32.html

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).
http://java.sun.com/products/plugin/1.3/docs/silent.html

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 :)
0
 

Expert Comment

by:lucman
ID: 7844210
i'm interested in the procedure for installing jmf
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 2 42
scoresSpecial  challenge 13 42
Understanding websocket example in spring 1 42
Java Jpanels and Jframe 8 20
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

757 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

18 Experts available now in Live!

Get 1:1 Help Now