Setting Environment variable in Target System - Advanced Installer Community
kumarkvs09
Posts: 6
Joined: Tue Apr 14, 2015 7:52 am

Setting Environment variable in Target System

Hi

I have created a property TOMCAT_DIR= TOMCAT_6.0_DIR in Install parameters and added Tomcat 6.0 in Files and folders page. I have set the Environment variable as CATALINA_HOME=[TOMCAT_DIR]

When i run the exe file in the target system (Win 7), environment variable shown as CATALINA_HOME= TOMCAT_6.0_DIR. Here i want Tomcat path in Target system as C:\Program Files (x86)\SampleApp\Tomcat 6.0.

Iam using Advance installer 8.8.2 version, please suggest me how to achieve this.



Regards
KVS Kumar
kumarkvs09
Posts: 6
Joined: Tue Apr 14, 2015 7:52 am

Re: Setting Environment variable in Target System

Hi

Please let us know how to fix the above issue.


Regards
KVS Kumar
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Setting Environment variable in Target System

Hello Kumar,

Please keep in mind that the "Value" field of the "Edit Property" dialog is not of formatted type. So, instead of resolving to the path contained (at install time) by the "TOMCAT_6.0_DIR" property, your "TOMCAT_DIR" property will be set to "TOMCAT_6.0_DIR" string. This is the normal behavior.

To achieve what you want, you should use our "Environment" page to add the "CATALINA_HOME" environment variable and in the "Value" field of the "Edit Environment Variable" dialog add a formatted reference of your "TOMCAT_6.0_DIR" property, like this:

Code: Select all

[TOMCAT_6.0_DIR]
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kumarkvs09
Posts: 6
Joined: Tue Apr 14, 2015 7:52 am

Re: Setting Environment variable in Target System

Hi Daniel


I have created TOMCAT_DIR= Tomcat_6.0_DIR in Install parameters page and as you said, given CATALINA_HOME= [Tomcat_6.0_DIR] in environment page but in the Target system environment variable is looks like this,

CATALINA_HOME=[Tomcat_6.0_DIR]


Please share a sample aip file for the above scenario.


Regards
KVS Kumar
kumarkvs09
Posts: 6
Joined: Tue Apr 14, 2015 7:52 am

Re: Setting Environment variable in Target System

Hi Daniel


In order to achieve the environment variable path in the Target system, instead of property if the required folder is selected then the path ends with backslash. But i want path without backslash using Property. Is it possible or custom action is compulsory for removing backslash.
I have attached the Sample aip file, please check and do the needful.


Regards
KVS Kumar
Attachments
Sample App.aip
(413.63 KiB) Downloaded 250 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Setting Environment variable in Target System

Hello Kumar,

To remove the trailing backslash from your folder property value you should use a custom action (this is the only way). Please take a look on our "How do I remove a trailing backslash from the value of a property?" article which should be useful for you.

Also, please note that the property associated with your "Tomcat6.0" folder is "Tomcat6.0_Dir" and not "TOMCAT_6.0_DIR". You can check this by going to "Files and Folders" page, right click on your "Tomcat6.0" folder, choose "Properties..." and then check the "Identifier" field. So, you should update your "CATALINA_HOME" environment variable to use the following value:

Code: Select all

[Tomcat6.0_Dir]
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”