cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ajaykrdas
Level 3

How can i load dll in customcodeaction java file during preinstall

  1. How can i  load dll in customcodeaction java file during preinstall.
  2. How to bundle and execute shell script file during preinstall.

Can i anyone help with sample code.

0 Kudos
(6) Replies
ajaykrdas
Level 3

How to migrate below ISMP code?
support.putResource(file, "/" + f.getName());
support.putClass("com.test.Test");
support.putRequiredService(FileService.NAME);
0 Kudos

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

0 Kudos

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.

0 Kudos

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.

 

i already followed similar ways to solve this problem.

I thought install anywhere may have some api to put resources.
0 Kudos
Revenera_Ian
Revenera Moderator Revenera Moderator
Revenera Moderator

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

0 Kudos