cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
james_decosta
Level 9

hi i want to write a custom code rule before the installer starts

hi,
i want to write a custom code rule and i want to search the system for jdk1.5.0_08 using custom code ,how shall i do it????????????????

Of course we have installanywhere built in feature of :
choose panel :jvm

But i want to search the engine before the installer starts and i will abort the installation using ip.abort(0); if the system does not have jdk1.5.0_08 installed on the machine.
The choose panel :jvm does not come in the pre install task before the installer starts rule.
james
Labels (1)
0 Kudos
(8) Replies
pv7721
Level 20

Why don't you bundle the VM with your installer, this might simplify things A LOT for you (no need to search, the good VM is bundled, installer and especially the application are guaranteed to work).
0 Kudos
james_decosta
Level 9

hi,
it is not possible on my part to bundle up the 1.5.0_08 jvm with the installer and i dont want to adopt that strategy.
Hi i have a process wherein i will be using JNI technology for writing custom code rule through which i can check if jdk 1.5.0_08 is there on the machine through registry entries.
Am i right in this approach.
----------------------------------------
Or i have another approach in which i will write a program for scanning the system and search for java.exe 's and compare them with jdk 1.5.0_08 and if it exists return true.
Which approach is right.
Any sort of enlightenment is highly appreciated.
james.
0 Kudos
james_decosta
Level 9

hi,
i want to know if i can scan the system for java.exe 's in the system through any means jni or anything or else i will rethink my strategy for checking the jdk1.5.0_08 version as i am unable to check the version of the jvm.
james.
0 Kudos
james_decosta
Level 9

hi,
i would like to know if my approach in trying this is right?????????????

I want to use the JNI for looking into the win32 registry for looking to see the java.exe 's in the system?
Am i right???????????????/
Regards,
james.
0 Kudos
RobertDickau
Flexera Alumni

Perhaps see if the getJavaVMList method of the InstallerResources class will help? The javadoc help for InstallerResources has information about getting a handle to the InstallerResources class.
0 Kudos
james_decosta
Level 9

hi,
i cannot do like this:

public boolean evaluateRule()
{
installerProxy.substitute("$CHOSEN_INSTALL_SET$");
}
can i access the installer resources using installerProxy in the custom code rule.
As far as i know i tried but failed in doing it .
This is not possible.
It is not possible to access the resources in the custom code rule.
james
0 Kudos
RobertDickau
Flexera Alumni

Correct, the CustomCodeRuleProxy class does not provide a getResource method; it might be necessary, for example, for a separate CustomCodeAction class to manage accessing the resource and then passing the resource location to the custom code rule...
0 Kudos
james_decosta
Level 9

hi robert,
i want to know how i need to achieve this.
First of all i will write a custom code action class in which i will access the resources ok fine.
I want to know how to pass the resource location in the custom code action to the custom code rule.

OK do you mean that i need to access the resource location in the custom code action class in the custom code action class and then i set the an install anywhere variable which i will substitute in the custom code rule class.

But again i have a problem because before the installer self extracts i did not find a custom code action feature to execute then how can i go for a custom code action class for getting the java vm list.????????????????????????
0 Kudos