This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Calling custom java code
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2006
03:52 AM
Calling custom java code
I am having serious issues calling custom java code external to ISMP. Here is what I am doing :
package com.xxx.installshield;
public class driver {
public static void main(String args[]){
System.out.println("driver");
}
}
From within a custom event handler we are calling :
public void onExecutingcheckProcs(com.installshield.event.wizard.WizardActionContext arg0)
{
System.out.println("before checkProcs");
driver test = new driver();
System.out.println("before checkProcs");
}
Only the first system.out prints and nothing else. They system.out from the external does not get called nor does the one after the call to the external. I have tryed a try/catch block but nothing is displayed, the install just continues fine. Please help!!!
package com.xxx.installshield;
public class driver {
public static void main(String args[]){
System.out.println("driver");
}
}
From within a custom event handler we are calling :
public void onExecutingcheckProcs(com.installshield.event.wizard.WizardActionContext arg0)
{
System.out.println("before checkProcs");
driver test = new driver();
System.out.println("before checkProcs");
}
Only the first system.out prints and nothing else. They system.out from the external does not get called nor does the one after the call to the external. I have tryed a try/catch block but nothing is displayed, the install just continues fine. Please help!!!
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2006
06:52 AM
I found how to do this if you use the method
support.putClass(xxx)
However this is crazy if you want to use a large 3rd party package. The only way I have found to be able to use 3rdparty code is to load each and every class file from a .jar file using the support.putClass(xxx) method. This can not be the right way to do this, please help!!!
support.putClass(xxx)
However this is crazy if you want to use a large 3rd party package. The only way I have found to be able to use 3rdparty code is to load each and every class file from a .jar file using the support.putClass(xxx) method. This can not be the right way to do this, please help!!!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2006
09:33 AM
If the external classes are in a JAR file, perhaps you can use putArchive instead of putClass. Searching these forums and the API docs should return a few examples.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2006
10:20 AM
It only worked 1/2. If I put the following line in :
support.putArchive("GetProcessList.jar",new AllArchiveFilter());
Then it fails at build time not being able to find a specific .class file from within this .jar file. I have to extract the .class file from the JAR file or the build will not work. The runtime seems to work, however It may be using the single class its asking for at build time. Build time says it cant find the .class file but I have not mentioned the .class file anymore... Strange.
Here is the build error :
java.io.FileNotFoundException: could not find resource com/sap/installshield/GetProcessList.class Resource Builder (bean2)
However inside of bean2 I am referencing teh .jar NOT the .class
support.putArchive("GetProcessList.jar",new AllArchiveFilter());
Then it fails at build time not being able to find a specific .class file from within this .jar file. I have to extract the .class file from the JAR file or the build will not work. The runtime seems to work, however It may be using the single class its asking for at build time. Build time says it cant find the .class file but I have not mentioned the .class file anymore... Strange.
Here is the build error :
java.io.FileNotFoundException: could not find resource com/sap/installshield/GetProcessList.class Resource Builder (bean2)
However inside of bean2 I am referencing teh .jar NOT the .class
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2006
11:56 AM
As a test, does it make any difference if you pass a full path to the JAR file on your build system?