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
- :
- Re: Few IA questions
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
‎Mar 17, 2008
06:57 AM
Few IA questions
I'm new to IA and had a few questions I need help with:
1. Does IA allow you to modify xml files from within by specifying the element you want to change and query for its value using the UI etc (like you can in IS) or will you have to write custom code for this and call the code during the installation?
2. Also is writing code in java the only way to create custom panels in IA or does it allow you to do it internally by giving you a list of pre defined controls you can add and setting variables to accept their values?
Will be grateful if someone would help me with these
1. Does IA allow you to modify xml files from within by specifying the element you want to change and query for its value using the UI etc (like you can in IS) or will you have to write custom code for this and call the code during the installation?
2. Also is writing code in java the only way to create custom panels in IA or does it allow you to do it internally by giving you a list of pre defined controls you can add and setting variables to accept their values?
Will be grateful if someone would help me with these
(13) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 17, 2008
07:33 AM
The answer to your second question is that there is no tool in IA that would allow visual creation of custom panels (I think that this is what you were looking for, right?) So I'm afraid you will need to write custom code for any custom panel that you need to create.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 17, 2008
10:51 AM
For question #2 it does have 2 panels that you can semi-customize. Like during the pre-install you can use the Advanced or Simple Get User Input panels. Then you can plug in what type of controls they should be. The variables to use and the text to display. Then you use a variable that you choose to read in the values set.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2008
12:04 AM
Thanks a lot for the replies. The Get User input advanced seems to be enough for my UI needs. But I want the values entered in the textfields to be added into an xml file which forms part of the installation package.
Is there anyway I can do this from within IA itself or will I have to write custom code for it? Also is it possible to pass the results of the textfields from the UI to the code I will have to write
Is there anyway I can do this from within IA itself or will I have to write custom code for it? Also is it possible to pass the results of the textfields from the UI to the code I will have to write
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2008
03:45 AM
The answers entered in the fields are stored in IA variables which you can access within your code, but I'm not sure that there are built-in actions for writing them in XML files.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2008
03:54 AM
Ok as a prelude to that xml program I was talking about I wrote a simple java prog to take values of variables from IA (from a custom panel) and write them into a text file which forms part of the installation package. But after the installation is done and when I open the text file I get some weird characters before the actual value.
For instance, if I had entered IA during the installation, it gets stored as 'ˆ t IA' in the text file. What could be wrong here??
The code is as below:
For instance, if I had entered IA during the installation, it gets stored as 'ˆ t IA' in the text file. What could be wrong here??
The code is as below:
import java.io.*;
import com.zerog.ia.api.pub.*;
public class writetofile extends CustomCodeAction
{
public void install(InstallerProxy ip) throws InstallException
{
String str=ip.substitute("$USER_INPUT_RESULT_1$");
//String str=(String)ip.getVariable("$USER_INPUT_RESULT_1$");
String str2=ip.substitute("$USER_INSTALL_DIR$");
String fileaddr=str2+"\\Installed Files\\out.txt";
try{
FileOutputStream fos=new FileOutputStream(fileaddr);
ObjectOutputStream out=new ObjectOutputStream(fos);
out.writeObject(str);
out.flush();
fos.close();
}
catch(IOException e)
{}
}
public void uninstall(UninstallerProxy uninstallerproxy)
throws InstallException
{
}
public String getInstallStatusMessage()
{
return "";
}
public String getUninstallStatusMessage()
{
return "";
}
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2008
06:04 AM
I redid the above program to write the IA variables to corresponding xml elements in an xml file and the values seem to be entered just fine. It must be something in the file handling code above. Or if it's cause of something else, always feel free to tell me 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2008
06:33 AM
How do I make the text fields created with 'Get User Input Advanced' action mandatory? Like it should either display a message if I try to go over to the next panel leaving the fields empty or the 'Next' button should be disabled till all the fields have been filled.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2008
07:47 AM
What I do is that right after the panel I add a small custom code that reads the values from all the IA variables that need to be filled. If at least one is null, I set another IA variable, say $RETRY_GET_USER_INPUT$ to true, and I use the Show Message Dialog based on the rule that $RETRY_GET_USER_INPUT$ is true, that would display a message to the user, for instance "Not all the required fields were fileld", with a single Ok button, that would return it to the Previous panel.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 18, 2008
11:27 PM
I did what you advised above but doesn't seem to work in my case. Here's the code i wrote
In pre-install task, just before the custom panel I chose the set variable action and set its value to false. Below the custom panel I put in the custom code and below that the message dialog with a compare variables rule.
import java.io.*;
import com.zerog.ia.api.pub.*;
public class verify extends CustomCodeAction
{
public void install(InstallerProxy ip) throws InstallException
{
//boolean var=true;
String var="true";
String str=ip.substitute("$USER_INPUT_RESULT_1$");
String str2=ip.substitute("$USER_INPUT_RESULT_2$");
if(str=="")
{
ip.setVariable("$VERIFY$", var);
}
if(str2=="")
{
ip.setVariable("$VERIFY$", var);
}
}
public void uninstall(UninstallerProxy uninstallerproxy)
throws InstallException
{
}
public String getInstallStatusMessage()
{
return "";
}
public String getUninstallStatusMessage()
{
return "";
}
}
In pre-install task, just before the custom panel I chose the set variable action and set its value to false. Below the custom panel I put in the custom code and below that the message dialog with a compare variables rule.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 19, 2008
04:28 AM
Can you post your project?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 25, 2008
09:14 AM
Couldn't you also just use the user input result variables and check those in the Rules of your Show Message Dialog. Add 2 "Compare InstallAnywhere Variables" rules and change the AND to OR at the top. The first rule will check $USER_INPUT_RESULT_1$ equals and the second rule will check $USER_INPUT_RESULT_2$ equals . This way you should'nt need the custom code. If either variable is empty it keeps them on that dialog and shows your message.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 26, 2008
12:58 AM
Yep that worked! Thanks a heap