We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

dani_deepak
Posts: 13
Joined: Tue Oct 24, 2006 5:04 pm

Help in Detecting a JRE and then launching a custom action.

Hi Team,
I am trying to detect a JRe on the system and if the system does not have one it should launch a custom action (Launch a exe file bundled with the package , this exe file is the bootstrap of online download of java. ).

Basically i want to know how i can launch a file when the system detects JRE is not installed on the system.



I will be waiting for your reply.

Thanks a lot
Deepak dani
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

If your application needs JRE to be installed prior then add "Java Runtime Environment" as prerequisite. To do that go to "Prerequisites" page, "Software" tab and choose "Add->Java Runtime Environment".

For more details about how to use prerequisite please see:
http://www.advancedinstaller.com/user-g ... tware.html

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
dani_deepak
Posts: 13
Joined: Tue Oct 24, 2006 5:04 pm

Hi Team,
I would like to thank you for your quick reply, I have gone through the material you provided me, my major concern is about the search types.

1 File Version
The installed prerequisite's version is taken from a file.
2 Registry Subkeys Enumeration
The installed prerequisite's versions are enumerated as subkeys of a given registry key.
3 Registry Value
The installed prerequisite's version is taken from a registry value.

There is not much in help about the types of search, which should be used and when it should be used, like in my case i am using Registry subkey enumeration for JRE detection of 1.5. I want to know more about them.

If you can provide me with some material, it would me great help.

Thanks a lot
Deepak dani
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

When "Registry SubKeys Enumeration" is used as search criteria for a prerequisite Advanced Installer enumerates all SubKeys of the value specified in the "Registry Key" field and compared with the value entered in the "Minimum" and "Maximum" fields to see if the prerequisite is already installed or not.

For example JRE keeps its versions as SubKeys in the "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" registry key like this: 1.5, 1.5.0_06, etc.

Hope this helps. If you encounter any problems please let me know.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
dani_deepak
Posts: 13
Joined: Tue Oct 24, 2006 5:04 pm

Hi Team,
I must say that was fast, your answer solved my problem temporarily, i would like to request you to please send me some more material on search types.

One more thing i would like to ask, i am adding a prerquisite of JRE 1.5 and if in the host system it finds 2 versions above 1.5 say 1.5.6 or 1.5.9, i want to know which would it select for exequting the application.


The other thing i want to know is if it finds a jre 1.5 on the system, then would it always use 1.5 for application or chances are that it use other versions also like for Eg. if a system has 1.5 and 1.4 version, the AI installer detects 1.5 jre then will the custom launcher of AI will luanch 1.5 or 1.4.

I would like to know where in registry subkeys for window installer are stored.


thanks a lot for ur quick reply, i would be waiting for your reply.

Deepak dani
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

To detect if a prerequisite is already installed or not you need to search for a file or for a registry value or registry key (to check only for the existence of that file or registry value leave the "Minimum" and "Maximum" fields empty). Note that the file or registry value (used for search) is created when the prerequisite is installed.

If your application requires for a specific version you can compare the version resulted from that search with a version typed in the "Minimum" or "Maximum" fields.

The search criteria are:

1 File Version
The version is taken from a file.
2 Registry Subkeys Enumeration
The versions are enumerated as subkeys of a given registry key.
3 Registry Value
The version is taken from a registry value.

If it's something that you don't understand please let me know.
One more thing i would like to ask, i am adding a prerquisite of JRE 1.5 and if in the host system it finds 2 versions above 1.5 say 1.5.6 or 1.5.9, i want to know which would it select for exequting the application.
To indicate what version of JRE to be used by your application go to "Java Products" page and set JRE Version, minimum and maximum fields.
The other thing i want to know is if it finds a jre 1.5 on the system, then would it always use 1.5 for application or chances are that it use other versions also like for Eg. if a system has 1.5 and 1.4 version, the AI installer detects 1.5 jre then will the custom launcher of AI will luanch 1.5 or 1.4.
Also you ca specify a list of preferred versions of JRE to be used by your application, see [Preferred...] button. For more details please see:
http://www.advancedinstaller.com/user-g ... tings.html

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”