fangjiaguo
Posts: 18
Joined: Sun Nov 09, 2008 4:12 pm

Can JRE be installed conditionally

I don't want user to download JRE in prerequisite when JRE is not available on target machine.
So I bundle JRE in setup file. Here is my question: Can JRE be installed when there is no JRE on target machine? And if target machine has JRE already, then don't install the bundled JRE.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Can JRE be installed conditionally

Hi,

When adding a JRE bundle to your project its files will be automatically added into a new feature. For this feature you can try using conditional install levels based on a search for JRE. The search can use this registry key:

Code: Select all

HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment
If the search founds something then the feature should have the install level "0", otherwise the install level should be "1".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
fangjiaguo
Posts: 18
Joined: Sun Nov 09, 2008 4:12 pm

Re: Can JRE be installed conditionally

Hi,
Thank you for your quick reply. I have followed your instruction and unluckly failed.
When the machine has JRE already, the setup file installed "successfully". But under the "Program Files", I found nothing.
It didn't install anything. It means I can't find "C:\Program Files\MyApp" though it seams successfully installed.

So, could you help me build an aip file?

Here are my requirements:

1. Build a setup file to include HellowWorld.Jar. Following is the source code:
The code takes arg[0] as parameter (I didn't find AI has the ability to support HellowWorld.jar accept input parameters. Mybe you can help me.)

Code: Select all

package hellowworld;
public class SayHellowWorld {
	public static void main(String[] args) {
		System.out.println(args[0] + " says: Hellow world!");		
	}
}
2. Bundle JRE 1.6 to this setup file, and specially install the bundled JRE 1.6 if the JRE version on the target is less than 1.6 or if JRE is not installed at all.
I tried your instructions but finally failed and don't know why.

Wait for good news! :)
Last edited by fangjiaguo on Mon Mar 02, 2009 5:06 pm, edited 1 time in total.
fangjiaguo
Posts: 18
Joined: Sun Nov 09, 2008 4:12 pm

Re: Can JRE be installed conditionally

Another question
Where is 2. Bundle a JRE with your application http://www.advancedinstaller.com/java.html in AI?
I can't find it in AI.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Can JRE be installed conditionally

Hi,
When the machine has JRE already, the setup file installed "successfully". But under the "Program Files", I found nothing.
It didn't install anything.
Did you condition only the feature of the JRE bundle or all the features? Please note that only the JRE Bundle should be conditioned. If the problem persists, please send us the AIP (project) file you are using to support at advancedinstaller dot com so we can investigate it.
I didn't find AI has the ability to support HellowWorld.jar accept input parameters. Mybe you can help me.
Currently Advanced Installer does not support permanent command line parameters for the Java Launcher. However, this improvement will be available in the next version. Until then, you can try using the parameters you need through a command line.
Where is 2. Bundle a JRE with your application http://www.advancedinstaller.com/java.html in AI?
The JRE bundle can be included by using the Java tab of the "Media" page. When included, it will create a feature in the "Organization" page. Only this feature should be conditioned by the result of the search.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”