agis
Posts: 1
Joined: Tue Nov 08, 2016 10:41 am

Add environment variable by condition

Dear Advanced Installer team,

Is it possible to add a environment variable by a condition?
In my case i would like to add the environment variable, when a dialog checkbox is checked.

Kind regards
AGIS
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Add environment variable by condition

Hi AGIS and welcome to our forums.

Yes, to achieve this you can go in the "Environment" page and create a new variable, then use the "Go to component" option and set the appropriate condition for its related component where you have been redirected.

You can take a look on the "Create shortcuts if condition" thread which describes for a shortcut the same approach that should be taken for an environment variable.

Just let me know if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Re: Add environment variable by condition

That's what I did today.
Goto Component (F8) revealed that the new variable was assigned automatically to the component "deployJava1.dll".
This is some component inside the JRE bundle.

1. I wonder why this component was choosen. It seems arbitrary.

2. More important, what happens when the condition is false ?

Can it happen that the whole component is not installed, i.e. deployJava1.dll will be missing along with the variable ?

Many Thanks,
Ruben
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Add environment variable by condition

Hi Ruben,
1. I wonder why this component was choosen. It seems arbitrary.
By default, a random component is chose, but you can choose the desired one, when you create the variable, directly from the "Component" combobox.
2. More important, what happens when the condition is false ?
Can it happen that the whole component is not installed, i.e. deployJava1.dll will be missing along with the variable ?
Yes, when the condition is false, the whole component is not installed. However, you can create a "dummy" component as described in the "Create shortcuts if condition" thread I mentioned above.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”