- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
Mar 11, 2013
07:01 AM
proxy.getService(ConsoleUtils.class) returns null
Hi,
I m trying to get ConsoleUtils instance in CustomCodeAction sub class, like below code:
Quoting from the javadocs, http://helpnet.flexerasoftware.com/InstallAnywhereAPI/IA2011/javadoc/com/zerog/ia/api/pub/ConsoleUtils.html,
How to get ConsoleUtils instance into CustomCodeAction sub class?
Mani
I m trying to get ConsoleUtils instance in CustomCodeAction sub class, like below code:
public class TestAction extends CustomCodeAction {
public void install(InstallerProxy proxy) throws InstallException {
ConsoleUtils cu = (ConsoleUtils) proxy.getService(ConsoleUtils.class);
System.out.println(cu); // prints 'null'
}
......
}
Quoting from the javadocs, http://helpnet.flexerasoftware.com/InstallAnywhereAPI/IA2011/javadoc/com/zerog/ia/api/pub/ConsoleUtils.html,
The ConsoleUtils object is obtained through the one of the custom code Proxy objects by a request for the ConsoleUtils class, as follows:
Given the InstallerProxy proxy object,
ConsoleUtils cu = (ConsoleUtils)proxy.getService(ConsoleUtils.class);
int userChoice = cu.createChoiceListAndGetValue(myVector);
How to get ConsoleUtils instance into CustomCodeAction sub class?
Mani
2 Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
Mar 14, 2013
02:53 AM
mrcoder wrote:
public class TestAction extends CustomCodeAction {
public void install(InstallerProxy proxy) throws InstallException {
ConsoleUtils cu = (ConsoleUtils) proxy.getService(ConsoleUtils.class);
System.out.println(cu); // prints 'null'
}
......
}
Hi,
ConsoleUtils class provides methods for custom code 'console' actions. So in your code, you'll have to change two things for the right usage of ConsoleUtils class-
1. Your class should extend CustomCodeConsoleAction instead of CustomCodeAction
2. The proxy should be changed to 'consoleproxy'
Then you will have the instance of ConsoleUtils in the object 'cu'. You can then use this object to access methods on ConsoleUtils.
Did this help?
Thanks,
Ramya
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
Sep 05, 2013
04:48 AM
RamyaVenkatesh wrote:
Hi,
ConsoleUtils class provides methods for custom code 'console' actions. So in your code, you'll have to change two things for the right usage of ConsoleUtils class-
1. Your class should extend CustomCodeConsoleAction instead of CustomCodeAction
2. The proxy should be changed to 'consoleproxy'
Then you will have the instance of ConsoleUtils in the object 'cu'. You can then use this object to access methods on ConsoleUtils.
Did this help?
Thanks,
Ramya
Hi Ramya,
Does it mean that we cannot get ConsoleUtils in CustomCodeAction.
Is there any way to get the ConsoleUtils in CustomCodeAction as I am not able to use CustomCodeConsole actions during Install phase of my installer.
Thanks & Regards,
Usha.
