PDA

View Full Version : using jar file at runtime



mholland
07-21-2004, 08:06 PM
I would like to use the oracle thin client driver during my installation... The oracle thin client classes (there are a lot of them) are packaged in a jar file.

How can I package my setup so that the jar file is included into setup.jar and is available at runtime? I don't think just using the add in manager will do what I want as it only allows me to specify one class at a time... I believe I will need the whole jar available at runtime.

thanks for the help,
mike.

Steff74
07-22-2004, 04:24 AM
Wizard Action:
oracle.jar is best defined in InstasllShieldUniversal.cp
/**
* @see com.installshield.wizard.WizardBuilder#build(com.installshield.wizard.WizardBuilderSupport)
*/
public void build(WizardBuilderSupport support) {
try {
support.putArchive(
jarDirectory + "oracle.jar",
new AllArchiveFilter());
} catch (IOException ioe) {
support.logEvent(
this,
Log.ERROR,
"Could not build required archives into setup: "
+ ioe.getMessage());
}
}

mholland
07-22-2004, 11:28 AM
This doesn't seem to be working for me, although I am successfully using a similar technique to pull in external class files. Do I need to specifically put oracle.jar into installshieldUniversal.cp as well?

thanks,
mike.


Originally posted by Steff74
Wizard Action:
oracle.jar is best defined in InstasllShieldUniversal.cp
/**
* @see com.installshield.wizard.WizardBuilder#build(com.installshield.wizard.WizardBuilderSupport)
*/
public void build(WizardBuilderSupport support) {
try {
support.putArchive(
jarDirectory + "oracle.jar",
new AllArchiveFilter());
} catch (IOException ioe) {
support.logEvent(
this,
Log.ERROR,
"Could not build required archives into setup: "
+ ioe.getMessage());
}
}

mholland
07-22-2004, 12:08 PM
Okay - so I figured out a way to do this, but I'm not super happy with it. I can go to releases->distributions-><distribution> and then I can add files to the embedded jars. This works if I launch from one of the platform specific launchers, however it doesn't add the jar file to the setup.jar file that you can also launch from (and is more useful sometimes).

mike.

brianl
07-22-2004, 02:04 PM
If you are adding this jar to the archive from a custom wizard action or a product action, then the method given by Steff74 will work, and oracle.jar will be available regardless if the setup is launched from a launcher or not. If you specify the full path to oracle.jar in putArchive(), then it does not need to be added to the .cp file.

One gotcha to keep in mind about this is that whenever you make modifications to the build() of a custom bean, you have to restart the IDE in order for the changes to be incorporated.