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?
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With