We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

h353655
Posts: 47
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 3761 times
Eusebiu
Posts: 4971
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: 47
Joined: Wed Jun 21, 2017 2:51 pm

Re: Set attribute value conditionally

Damn...I'd hoped to skip that extra step
Eusebiu
Posts: 4971
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”