Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting property value from another properties

Tags:

wix

wix3.5

I have a custom control (disabled edit) where I want to show current logged in Domain\User.

I set property like this:

<Property Id="PROP_DOMAINUSER" Value="[%USERDOMAIN]\[LogonUser]"></Property>

But what I see in edit box is exact text - [%USERDOMAIN]\[LogonUser] and not actual domain and user.

How do I initialize property value from another property then?

like image 893
eddyuk Avatar asked Jan 03 '13 08:01

eddyuk


1 Answers

You need to create a type 51 custom action to set the property, this can be achieved using the SetProperty element. Remember to schedule this before your custom control gets displayed.

<SetProperty Id="INSTALL_USERNAME" Value="[%USERDOMAIN]\[%USERNAME]" /> 

You should then use the property [INSTALL_USERNAME] in your control.

Edit:

To schedule the custom action use the Before or After attribute, if you are unsure where to schedule it use a tool like orca to see what order things are happening in, here's an example of the custom action running after After="InstallInitialize"

<SetProperty Id="INSTALL_USERNAME" Value="[%USERDOMAIN]\[%USERNAME]" After="InstallInitialize" /> 
like image 166
David Martin Avatar answered Oct 15 '22 09:10

David Martin