This seems like it should be intuitive, but so far its been anything but. How do I simply set a property I have defined in my product.wxs when my custom dialog first opens?
My Property is called "Port" which is initialized as blank. I have another called "df_Port", which I set to "8080". (These are set in my Product.wxs) When my Custom Dialog opens I want to set "Port" to "df_Port". I also have an Edit control on the dialog whose "Property" setting is set to "Port". So obviously the User should be able to update Port, but if they hit the "Back" button, but eventually come back to this dialog, the default value of the Edit Control should go back to "8080"
I have tried SetProperty, but it requires a Before or After property, and I have no clue on this. I have also tried to create a CustomAction, but this hasn't worked either:
<CustomAction Id="caPort" Property="Port" Value="[df_Port]"/>
The control shows as blank, instead of "8080"
I am using Wix 3.9 R2
Windows Installer XML Toolset (WiX, pronounced "wicks"), is a free software toolset that builds Windows Installer packages from XML.
The Visual Studio WiX toolset allows you to easily create WiX projects, edit WiX files using IntelliSense, and compile/link your project within the Visual Studio IDE. For WiX project types, see WiX Project Types.
Nobody answered or commented on my question. However, after much trial and error I figured out a solution. I figured I'd put it up here in case somebody else had the same problem.
1) First, I have to name properties as all Uppercase. So in my product.wxs I declare:
<Property Id="DF_PORT" Value="8080" Secure="yes"/>
<Property Id="PORT" Secure="yes"/>
2) I then add a publish tag and attach to Next button of dialog preceding my custom configuration dialog:
<Publish Dialog="PrecedingDialogName" Control="Next" Property="PORT" Value="[DF_PORT]">1</Publish>
3) In my custom dialog, I just bind an Edit control to the PORT property:
<Control Id="Port" Type="Edit" X="130" Y="88" Width="60" Height="16" Property="PORT" Text="{\WixUI_Font_Normal}" Integer="yes" RightAligned="yes" />
The control will display the default value. If I edit the value, but then hit the "Back" button, Step 2 will reload the default value, instead of remembering what the User had typed.
After working with WIX Toolset for a couple of weeks now, I can honestly say that this is one of the worst and most unintuitive development pieces I have ever seen!
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