cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
robsahm
Level 4

How can I with code set a $V variable?

I want to be able to set a $V variable. How can I do this? Maybe Im going about this the hard way but what I have tried is to create a custom event and used the following :

public void onExecutingsetVariable(com.installshield.event.wizard.WizardActionContext arg0)
{
SetVariableAction myVar = new SetVariableAction();

myVar.setName("test");
myVar.setValue("myValue");
myVar.execute(test);


}

The problem is that the execute method of the SetVariable needs a (WizardBeanEvent event ) which for the life of me I cant figure out how to get from my context 😞 Please help its driving me nuts!!
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

Please see the end of this thread: [thread]144598[/thread].
0 Kudos
robsahm
Level 4

How can I specify attributes such as persitant or global,etc?

Thanks.

This should really be documented in the section on working with variable. Having only ways to set it in the UI in the documentation is very limiting 😞
0 Kudos
RobertDickau
Flexera Alumni

I haven't used them myself, but the same class that provides the setVariableValue method provides createGlobalVariable, createGlobalPersistedVariable, and similar methods; which return an ISVariable object, which in turn has setName, setValue, setSecret (and related) methods...
0 Kudos
robsahm
Level 4

Cool I will give it a try 🙂
0 Kudos