You chosen the most complicated UI model MSI native UI :)
Because of this you are loosing any opportunity to use imperative expressions (e.g. C# code) and you will need to resort to declarative (XML) expressions that are less compatible with algorithmic tasks but more suitable for expressing relationships. That is why your task would be extremely simple is done with ManagedUI (C#) with simple code as this
With WiX you will need to have something like this:
In Wix# you will achieve this with something like this:
But the you will also need to implement your ActivatedForm/NotActivatedForm dialogs. Not an easy task...
I stopped and Wix# evolution towards native MSI UI as it can deliver very little benefit comparing to WiX. Still messy, non-intuitive and hard to maintain. Wix# ManagedUI (interface for MSI/WiX EnbeddedUI model) seems to fit much better for the task. But... if you have to use MSI UI... then prepare yourself for some fight :)
Because of this you are loosing any opportunity to use imperative expressions (e.g. C# code) and you will need to resort to declarative (XML) expressions that are less compatible with algorithmic tasks but more suitable for expressing relationships. That is why your task would be extremely simple is done with ManagedUI (C#) with simple code as this
void next_Click(object sender, EventArgs e) { int index = Shell.Dialogs.IndexOf(ActivatedForm); if (activation == 0) index = Shell.Dialogs.IndexOf(NoActivatedForm); Shell.GoTo(index); }
... <PublishDialog="ProductActivationForm"Control="Next"Event="NewDialog"Value="ActivatedForm"Order="1">activation = "1"</Publish><PublishDialog="ProductActivationForm"Control="Next"Event="NewDialog"Value="NotActivatedForm"Order="2">activation = "2"</Publish><PublishDialog="ProductActivationForm"Control="Cancel"Event="EndDialog"Value="Exit">1</Publish>
customUI.On(activationDialog, Buttons.Next, new ShowDialog(NativeDialogs.ActivatedForm, "activated = \"1\""), new ShowDialog(NativeDialogs.NotActivatedForm, "activated = \"0\""));
I stopped and Wix# evolution towards native MSI UI as it can deliver very little benefit comparing to WiX. Still messy, non-intuitive and hard to maintain. Wix# ManagedUI (interface for MSI/WiX EnbeddedUI model) seems to fit much better for the task. But... if you have to use MSI UI... then prepare yourself for some fight :)