johnny
johnny

Reputation: 1251

wix getting user input

Dialog.wxs

<UI>
<Dialog Id="UserRegistrationDlg" ... >
<Control Id="NameEdit" Type="Edit" X="45" Y="85" Width="220" Height="18" Property="NameValue" Text="{80}" />
</Dialog>
<UI>

In Product.wxs I created a property

<Property Id="NameValueProperty" Value="NameValue" />

Then, as I understood, I have to use [NameValueProperty] for getting value but id doesn't work ... What's wrong?

Upvotes: 9

Views: 6244

Answers (2)

Rob Mensching
Rob Mensching

Reputation: 35976

A verbose log file should show you the changes to the properties. Very useful when tracking down these sort of things. In this case, your example code is actually setting a Property called NameValue to the value in the edit box. If you want to default the value in the edit box then you would do something like:

<Property Id="NameValue" Value="Show this in the edit box" />

And to reference the value you'd use [NameValue]. Alternatively, you could change your code to be:

<UI>
  <Dialog Id="UserRegistrationDlg" ... >
    <Control Id="NameEdit" Type="Edit" X="45" Y="85" Width="220"
             Height="18" Property="NameValueProperty" Text="{80}" />
  <Dialog>
<UI>

Upvotes: 5

Christopher Painter
Christopher Painter

Reputation: 55601

You generally want to use a Secure Custom Property in this situation. This is a property that is both Public (i.e. CAPS ) and marked as Secure A value is only required if you want there to be a default value.

<Property Id="MYPROPERTY" Secure="yes" />

Upvotes: 4

Related Questions