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

generateOptionsEntries question

So I'm trying to write this method for some of my custom classes and I'm looking at some of the methods that are already in place in other files and I'm a little confused at one part where it goes



if(context.getValueType() == WizardBean.TEMPLATE_VALUE){
acceptValue = rejectValue = LocalizedStringResolver.resolve("com.installshield.wizard.i18n.WizardResources", "WizardBean.valueStr");
}else{
acceptValue = context.getWizard().getServices().getISDatabase().getVariableValue(ACCEPT_BUTTON_VARIABLE);
rejectValue = context.getWizard().getServices().getISDatabase().getVariableValue(REJECT_BUTTON_VARIABLE);
}


I'm really not sure what either part of this block is doing. The top seems to be setting it by resolving a certain string and the bottom half I'm completely lost on and the API has turned out to be pretty useless. What is going on here and more importantly where are they getting the

"com.installshield.wizard.i18n.WizardResources", "WizardBean.valueStr"

and ACCEPT_BUTTON_VARIABLE/REJECT_BUTTON_VARIABLE (set to "LICENSE_ACCEPT_BUTTON" and "LICENSE_REJECT_BUTTON" respectively) information? I have a feeling these strings mean something and I can't just keep the copy paste or make up my own stuff to put in there but looking through all the program information I can't find where these variables are set or have any idea what to use for other or custom classes.

Any input is greatly appreciated.

-DBH
Labels (1)
0 Kudos
(6) Replies
RobertDickau
Flexera Alumni

As you know, your end users can deploy your installer silently with non-default property settings using a text options file. The big idea is that that block of code populates an options file when the user runs your installer with the -options-template switch (that's the valueType==WizardBean.TEMPLATE_VALUE part) or -options-template (the else clause, also known as WizardBean.CURRENT_VALUE).

The former populates the options file with default settings, the latter populates the options file with values based on the user's recorded input.

The end of the help topic "Creating and Using a Response/Options File" and KB article Q106680 say a bit about it...
0 Kudos
DBH1985
Level 4

Alright that makes sense, but what about the .resolve(string, string) and getVariableValue(string) methods? How do I know what strings to feed into these methods to get the correct output?
0 Kudos
RobertDickau
Flexera Alumni

For the resolve business, please see for example the topics "Working With the String Table" and "Locating Localized Strings", which describe how ISMP is getting the localized values of predefined strings. If your installer supports only one language, you could just use hard-coded strings, but for localization you'll want to place your strings in the string table and refer to the language-independent string-table identifier.

The getVariableValue function is being used to get the value of an ISMP variable associated with a dialog-box control, about which see for example "Getting and Setting a Variable in a Custom Dialog Event".
0 Kudos
DBH1985
Level 4

Alright cool I get it now. Is there a table or something somewhere to view all the variables that have been set? Because what I'm doing now is going through somebody else's code midway through a project trying to create an options file and I have no idea what they named the variables in order to use them with getVariableValue(string) (and they are on vacation so I can't ask them). So the variables have already been set somewhere, I just don't know where but I need to know what they are named.
0 Kudos
RobertDickau
Flexera Alumni

If you haven't yet, perhaps look in Additional Tools > Property Manager...
0 Kudos
DBH1985
Level 4

ah that helps! Thanks!
0 Kudos