MrLane
MrLane

Reputation: 1728

Wix: Edit Control not setting property

I have an issue with Wix where an Edit control is not setting a property. I am using the property in a XmlFile node to modify an .xml file copied to the install location. The value of the property IS being correctly set in the file (the default value is being used) but I cannot seem to set the property with a value from the Edit control. This is driving me nuts.

<Fragment>
    <Property Id="CUSTOMERNAMEPROPERTY" Value="Some default value" Secure="yes" />

    <UI>
        <Control Id="CustomerNameEdit" Type="Edit" X="120" Y="75" Width="220" Height="18" Property="CUSTOMERNAMEPROPERTY" Text="{80}" Indirect="yes" />
    </UI>
</Fragment>

What is wrong with this? Thanks

Upvotes: 12

Views: 8153

Answers (2)

Andrei U
Andrei U

Reputation: 731

Try to declare your property inside <UI> element:

<Fragment>
    <UI>
        <Property Id="CUSTOMERNAMEPROPERTY" Value="Some default value" Secure="yes" />
        <Control Id="CustomerNameEdit" Type="Edit" X="120" Y="75" Width="220" Height="18" Property="CUSTOMERNAMEPROPERTY" Text="{80}" Indirect="yes" />
    </UI>
</Fragment>

Upvotes: 2

Cosmin
Cosmin

Reputation: 21416

The Indirect attribute should be set to "no". Edit controls should reference their properties directly.

Also, make sure that you use a public property (only uppercase letters in its name). Private properties use their default values during install.

Upvotes: 29

Related Questions