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

Modifying installvariable in customcode with ProxyInstaller.SetVariable

I have a InstallAnywhere named $answer$

I need to modify this value in my java custom code.

My understanding is that i need to do something like:

ProxyInstaller.SetVariable("answer","yes");

But this won't compile as ProxyInstaller.SetVariable complains about a non-static method being called.

My java skills are not that strong, but my understanding is that I need to instantiate a InstallerProxy object.

Is this correct? As 5 objects are needed to instantiate an InstallerProxy object that I know nothing about I am hoping that I am missing something.

Ideas?

Bill
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

What type of custom code? The install method of a class that extends CustomCodeAction is automatically passed an InstallerProxy object that you can use. In this method, for example:
public void install(InstallerProxy ip) { ... }
you can use ip. There are also static installerProxy (note the capitalization) and uninstallerProxy class variables included in CustomCodeAction and other classes that you can use.
0 Kudos
bnorton916
Level 3

RobertDickau wrote:
What type of custom code? The install method of a class that extends CustomCodeAction is automatically passed an InstallerProxy object that you can use. In this method, for example:
public void install(InstallerProxy ip) { ... }
you can use ip. There are also static installerProxy (note the capitalization) and uninstallerProxy class variables included in CustomCodeAction and other classes that you can use.


The Custom Code is a custom panel. (Sorry for not stating before).
So it is extending CustomCodePanel not CustomCodeAction.

Does this make difference?

Thanks for your time,

Bill
0 Kudos
RobertDickau
Flexera Alumni

Please see the javadoc documentation for the InstallAnywhere API (available in the javadoc directory of your IA installation); CustomCodePanel has a similar customCodePanelProxy class variable you should be able to use, and the setupUI method automatically gets an object of the same type.
0 Kudos
bnorton916
Level 3

will start reading

Bill
0 Kudos
bnorton916
Level 3

so something like

customCodePanelProxy.setVariable(....
0 Kudos