cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
jaisonsingh
Pilgrim

How to refer external file in USER_INSTALL_FOLDER during installation?

I am using InstallAnywhere to install my java application. As a pre-install step I am taking database details from the user and storing it in an XML which is in install Directory. At the time of installation I want to refer this xml file to make DB connection. How can I configure installanywhere to refer to this external file at the time of installation? I don't want to bundle it with installer exe. Mini Militia App Lock 7Zip
Labels (1)
0 Kudos
1 Reply
Larry578
Pilgrim

Re: How to refer external file in USER_INSTALL_FOLDER during installation?

You can create a file similar to what is shown below, that ships with your application. You could call it, say, connection.xml:


$CONNECTION_USER_NAME$
$CONNECTION_PASSWORD$
$CONNECTION_DATABASE$

Collect the user input into InstallAnywhere variables that match the variables you embed in the template XML file. In this example these would be $CONNECTION_USER_NAME$, $CONNECTION_PASSWORD$ and $CONNECTION_DATABASE$.

Add the "Modify Text File - Single File" Action to your project. Check the "Substitute InstallAnywhere variables in file" checkbox. This will automatically replace your embedded IA variables with the values collected from the user.

After the "Modify Text File - Single File" Action completes, the variables in the file will be replaced with the values the user entered. You can then use connection.xml to create your database connection.

In post-installation you could use the Delete File Action to remove the XML file. Alternately, you could run the "Modify Text File - Single File" Action again to search for and replace the password with a series of asterisk, or some other masking character.

Cheers!
0 Kudos