This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Variables from custom code
Subscribe
- 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
Jan 13, 2015
02:06 AM
Installer response file is not complete to use in Silent Install
Hi,
We are using InstallAnywhere 2012 SP1 Enterprise edition.
We enabled silent install via the checkbox via "Installer UI".
On Linux, we tried to generate the response file by running the installer with the -r option. The variables that were set inside "Console: Custom code" Java code via consoleProxy.setVariable() were missing in the response file.
Q1: What may be the reason?
Q2: We tried to anyway set the values externally, but it didn't seem to work.
Q3: How is custom code handled during silent install
Note: We have Enterprise License for IA 2012.
We are using InstallAnywhere 2012 SP1 Enterprise edition.
We enabled silent install via the checkbox via "Installer UI".
On Linux, we tried to generate the response file by running the installer with the -r option. The variables that were set inside "Console: Custom code" Java code via consoleProxy.setVariable() were missing in the response file.
Q1: What may be the reason?
Q2: We tried to anyway set the values externally, but it didn't seem to work.
Q3: How is custom code handled during silent install
Note: We have Enterprise License for IA 2012.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 16, 2016
06:00 PM
The variables set in custom code are not registered with the "ReplayVariableService".
You need to implement a CustomCodeAction, where the install(InstallerProxy) method calls the ReplayVariableService.
Read the Custom Code reference for other info...
I suggest you keep a map or list of your variable values, to be updated by all your custom code, that way, you call the update variables code just one time, before existing the installer, for example.
A map would allow you to use a different "title" for each variable in the response file
Example: "Port number" is the title:
#Port number
#--------------------
PORT=1234
Sample code:
@Override
public void install(
final InstallerProxy installerProxy) throws InstallException {
final ReplayVariableService replayService =
(ReplayVariableService) installerProxy.getService(ReplayVariableService.class);
if (null != replayService) {
for (final Entry entry : InstallerUtils.getVariables()) {
replayService.register(entry.getKey(), entry.getValue());
}
}
}
where replayService.register(entry.getKey(), entry.getValue()) = replayService.register("variable value", "variable title");
You need to implement a CustomCodeAction, where the install(InstallerProxy) method calls the ReplayVariableService.
Read the Custom Code reference for other info...
I suggest you keep a map or list of your variable values, to be updated by all your custom code, that way, you call the update variables code just one time, before existing the installer, for example.
A map would allow you to use a different "title" for each variable in the response file
Example: "Port number" is the title:
#Port number
#--------------------
PORT=1234
Sample code:
@Override
public void install(
final InstallerProxy installerProxy) throws InstallException {
final ReplayVariableService replayService =
(ReplayVariableService) installerProxy.getService(ReplayVariableService.class);
if (null != replayService) {
for (final Entry
replayService.register(entry.getKey(), entry.getValue());
}
}
}
where replayService.register(entry.getKey(), entry.getValue()) = replayService.register("variable value", "variable title");