Hide a Label if a property is false in WIX - wix

I have a WIX Project consisting of some wxs files.In my one wxs file namely "DBFile" I want to hide one label say "lbl" at runtime depending upon the Properties.
i.e. If my property say "IsDbExists" is true then i want to show label "lbl" otherwise it should be hidden.
How can i achieve this?

Like this:
<Control Id="LoginTextBox" Type="Edit" ...>
<Condition Action="hide" >IsDbExists<>1</Condition>
<Condition Action="show" >IsDbExists=1</Condition>
</Control>

Related

How to check all the items of an CheckboxGroupInput

We want to use the CheckboxGroupInput with many choices.
And we want to add a custom checkbox to check all the items at once.
<CheckboxGroupInput source="targets" label="Cibles" choices={targets}
onChange={this.handleAll} />
We want to add a custom checkbox (with label 'All') and when we check this custom checkbox all the others checkboxes from the same group were checked or not.

How to change checkbox value on deselect?

I`m having trouble finding out how to change the value of a checkbox (=property) on deselect.
What I`ve got this far:
<Property Id="INSTALLEXCEL2007" />
<Control Type="CheckBox" Id="Excel2007_Checkbox" Width="88" Height="17" X="22" Y="120" Text="Excel 2007" Property="INSTALLEXCEL2007" CheckBoxValue="1" />
The code says that the property INSTALLEXCEL2007 will get the value 1, if the user checks it.
Now, if it is unchecked, the value still remains 1. Meaning, each click on the checkbox assigns the value 1 to this property.
Is there any way to have a "unchecked value"?
I have already tried this, but it didn`t work in my case.
If user unselects the Checkbox the property will be deleted or it value goes to null. You can use the uncheck condition like below.
INSTALLEXCEL2007 <> 1
If you test the Checkbox property value(check and uncheck) in dialog using text control, it won’t get updated. You need to publish the property or if you click next or back button, it will be updated.
After hours of trying to get it done with checkboxes, I`ve switched to combo boxes.
It has been really easy to use them, though its not as a pretty as it would have been with checkboxes.
Here`s an example of one of my combo boxes (maybe someone might find it useful):
<Control Type="ComboBox" Id="Excel2007_Combobox" Width="75" Height="14" X="165" Y="114" ComboList="yes" Property="INSTALLEXCEL2007">
<ComboBox Property="INSTALLEXCEL2007">
<ListItem Text="No" Value="0" />
<ListItem Text="Yes" Value="1" />
</ComboBox>
</Control>
After selecting a value, it`s easy to use the value of the property "INSTALLEXCEL2007" as a condition:
<Publish Dialog="ExcelChooserDlg" Control="ExcelChooser_Accept" Event="SpawnDialog" Value="WarningDlg_NoOfficeVersion" Order="1"><![CDATA[INSTALLEXCEL2007<>"1"]]></Publish>

WP8 XAML Binding List<> with another List<> inside

I am trying to bind a list of objects to a list control for a Windows Phone 8 app which also contains another list within it. I have tried to find out how to set this out so that when selecting an item from the parent list the child list is then loaded into a separate list control but cannot find any details. Any help would be most appreciated as I have hit a dead end with this.
I am trying to use lists as below:
List which then contains a List which also contains a List. I need to setup an initial list of stations which the user will select one, which will then populate another list with the platforms, and then selecting a platform will load the list of trains.
You should bind your outermost list to the outermost listbox (or whatever list control you are using).
After that you can bind the selecteditem of the outerlist to the child listviews.
Here's an example:
<ListBox ItemsSource="{Binding OuterList}" x:Name="OuterList" SelectionMode="Single" />
<ListBox ItemsSource="{Binding ElementName=OuterList, Path=SelectedItem}" x:Name="Innerlist1" />
<ListBox ItemsSource="{Binding ElementName=InnerList1, Path=SelectedItem}" />

conditional logic seeming not to work

I have a Wix Control PushButton which has several Publish events
here is the xml
<Control Id="Next" Type="PushButton" X="0" Y="0" Width="50" Height="20" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="SpawnDialog" Value="ErrorDialog">
<![CDATA[PROPERTY1 = "1" AND PROPERTY2 = "1"]]>
</Publish>
</Control>
But the dialog is not appearing even though both properties are equal to 1
I Found the problem pretty much straight after i posted. So am putting it here incase anyone else makes the same mistake i did.
Straight after my publish event i had another event which was getting fired to move onto the next dialog screen
<Publish Event="NewDialog" Value="CustomizeDlg">1</publish>
so even though my error dialog should show, this next event sort of overwrites it and you dont get to see it. to stop this happening i had to write in logic to prevent it from moving on.
<Publish Event="NewDialog" Value="CustomizeDlg">
<![CDATA[PROPERTY1 = "1" AND PROPERTY2 = "0"]]></Publish>
so now if both properties have been set it will show the error dialog, but if only the first one has been set i will move straight onto the CustomizeDlg. As long as the conditions are different and one will fail and the other pass this works a charm.

wix common ui dialog - how to use the same dialog more than once in single MSI

I am using Wix::Extensions::CommonUi from AppSecInc.
I need to deploy two databases in my MSI and need to collect the db connection information from the user for both databases.
I would like to utilize DbCreateCredDlg dialog.
<UI>
....
<DialogRef Id="DbCreateCredDlg" />
<!- use DbCreateCredDlg for database 1 ->
<!- use DbCreateCredDlg for database 2 ->
...
</UI>
Is there any way I can use the this dialog more than once in the same MSI?
I suppose you should pull the sources of that dialog to include in your sources and modify it accordingly. For instance, add a condition when the Next button of this dialog returns it to self for database 2 data. You'll need to preserve the data in the properties tied to dialog controls before prompting the user to enter the data for database 2.
So, the Next button will do the following (just behavior algorithm):
if DB=1, preserve entered data for database1
set DB=2
show this dialog again
if DB=2, preserve entered data for database2
show next dialog in sequence
The similar thing should be done for Back button of that dialog.
Hope you get the idea.