- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- How can i load dll in customcodeaction java file during preinstall
- 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
How can i load dll in customcodeaction java file during preinstall
- How can i load dll in customcodeaction java file during preinstall.
- How to bundle and execute shell script file during preinstall.
Can i anyone help with sample code.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ajaykrdas,
Thank you for your follow-up post.
For more information about migrating ISMP code, I suggest looking at the files in your <IA_HOME>\CustomCode folder, where <IA_HOME> is where your copy of InstallAnywhere 2018 SP1 is installed. There should be samples and templates.
Here is a link to the InstallAnywhere Custom Code API documentation:
https://helpnet.flexerasoftware.com/InstallAnywhereAPI/IA2015/javadoc/index.html?com/zerog/ia/api/pu... happy wheels
Thanks,
Ian
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thanks @Revenera_Ian
My question was bit different.
I know how to load dll. In order to load dll it should be stored somewhere. In ISMP we were using support.putResources() method to store dll somewhere in installer.
My question was is what is alternative of support.putResource() method in installanywhere.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
We've gotten around this by packaging what we need into external .jars, then loading it as a dependency.
see https://helpnet.flexerasoftware.com/installanywhere2015/Default_CSH.htm#helplibrary/ia_signedjars.htm for an overview but basically:
-Package whatever resources(binaries,scripts) you need into a separate jar
-In the Properties customizer for a custom code action/panel/whatever, add the jar as a dependency
-At run time, IA puts your jar on the classpath, and you can access the resource using getResource(), etc. just like you would expect.
That's what I do and it works, but you do lose the ability to have this packaged automatically at buildtime. You have to do the packaging yourself before building the installer.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I thought install anywhere may have some api to put resources.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ajaykrdas,
Thank you for your post.
1. Here are links to posts about loading a DLL in Java:
https://www.chilkatsoft.com/java-loadLibrary-Windows.asp
https://stackoverflow.com/questions/2535700/loading-dll-in-java-eclipse-jni
Perhaps you could try that as a possible starting point for getting that working in a custom code action.
2. You could try using an Execute Script/Batch file Action to execute a shell script during pre-install.
Thanks,
Ian
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)