h353655
Posts: 31
Joined: Wed Jun 21, 2017 2:51 pm

Set attribute value conditionally

I would like to set the value of an attribute in an xml file conditionally depending on the value of a Property.

Sort of:
[MyProp]="somevalue" ? "truevalue" : "falsevalue"

Picture added.
Attachments
conditionalattrib.png
conditionalattrib.png (24.17 KiB) Viewed 2562 times
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Set attribute value conditionally

Hi,

In order to achieve this you can use another property in the "Value" field that will be set based conditionally through a "Set installer property" custom action.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
h353655
Posts: 31
Joined: Wed Jun 21, 2017 2:51 pm

Re: Set attribute value conditionally

Damn...I'd hoped to skip that extra step
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Set attribute value conditionally

Hi,

Another workaround is to duplicate the element that contains that attribute, but set different values for the attribute in each element, then use your property as a conditions for the installation of the two elements in the "Element Settings" tab.

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

Return to “Building Installers”