How to create custom VerifyReadyDlg with Wix? - wix

How to create a such dialog in Wix Setup? It was implemented by default in Inno Setup but I am thinking now how to do same in Wix. My main question is how to create disabled text area with describing what should be installed.
It should to be done in this way: User pick on previous page what he would to install extra (desktop icon or Start Menu folder etc) by clicking on checkboxes (checkboxes is set some properties) and then user able to see what will be installed on next page.
Example:
I have started to create dialog but I have no idea how to create a text area
<Dialog Id="CustomVerifyReadyDlg" Width="370" Height="270" Title="[ProductName] - Setup">
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes"
Text="{\DlgTitleFont}Ready to Install"/>
<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes"
Text="Setup is now ready to begin installing [ProductName] on your computer."/>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="SecondDescription" Type="Text" X="25" Y="65" Width="340" Height="30" Transparent="yes" NoPrefix="yes"
Text="Click Install to continue with the installation, or click Back if you want to review or change any settings."/>
</Dialog>

You should use scrollable text control for this puropse.
Should be something like that + you might use properties from previous dialogs or custom action for you dialog.
<Control Id="Title" Type="ScrollableText">
<Text> SOMECUSTOMPROPERTY </Text>
</Control>
Here's a doc about dialogs in general.

Related

Displaying text inside a control element with type edit

Pretty simple: I would like to have a edit-field where there is already text inside (a kind of default value) but which is also editable.
I tried a lot of different version but nothing wanted to work yet.
This is the last version I tried (the checkbox works just fine):
<Property Id="MYPROPERTY" Value="default" />
<UI>
<Dialog Id="ConfigVariablesDlg" Width="370" Height="270">
<Control Type="Edit" Id="InputField" Property="MYPROPERTY" X="125" Y="27" Width="100" Height="15" Indirect="yes" Text="[MYPROPERTY]">
<Condition Action="disable"><![CDATA[EnableBox<>"1"]]></Condition>
<Condition Action="enable">EnableBox="1"</Condition>
</Control>
<Control Type="CheckBox" Id="MyBox" Width="10" Height="10" X="110" Y="30" Property="EnableBox" CheckBoxValue="1"/>
</Dialog>
</UI>
when you define your property you simply have to assigne it a value like this
<Property Id="MYPROPERTY">Text you want to fill in</Property>
So you cut away your Value Field from your Control Element and define your Property beforehand. (Still Inside your UI Element!)
So in the end your code should look something like this
<UI>
<Property Id="MYPROPERTY">Text you want to fill in</property>
<Dialog Id="ConfigVariablesDlg" Width="370" Height="270">
<Control Type="Edit" Id="InputField" Property="MYPROPERTY" X="125" Y="27" Width="100" Height="15" Indirect="yes">
<Condition Action="disable"><![CDATA[EnableBox<>"1"]]></Condition>
<Condition Action="enable">EnableBox="1"</Condition>
</Control>
<Control Type="CheckBox" Id="MyBox" Width="10" Height="10" X="110" Y="30" Property="EnableBox" CheckBoxValue="1"/>
</Dialog>
*edit also I am pretty (but not entirely sure)
![CDATA[EnableBox<>"1"]]
should be
![CDATA[EnableBox<>1]]
atleast thats how it worked for me

WIX Custom Action Condition using Property Value not working

I am trying to run a custom action at the end of my Wix installer but only if certain conditions are met. The user runs through the installer and they will choose one of two modes that set the property 'ServiceType'. The two values for the property are "RegisterNew" and "LinkExisting". You can see by the log below that when the user selects "LinkExisting" in the UI that it changes the property but the custom action still runs.
MSI (c) (D4:44) [11:20:15:686]: PROPERTY CHANGE: Modifying ServiceType property. Its current value is 'RegisterNew'. Its new value: 'LinkExisting'.
Here is my custom action code:
<InstallExecuteSequence>
<Custom Action="RegisterServiceNameCustomAction" Before="InstallFinalize">
<![CDATA[(ServiceType="RegisterNew") AND (NOT Installed)]]>
</Custom>
</InstallExecuteSequence>
<Fragment>
<Binary Id="RegisterServiceCustomActionBinary" SourceFile="$(var.RegisterServiceCustomAction.TargetDir)$(var.RegisterServiceCustomAction.TargetName).CA.dll" />
<CustomAction Id="RegisterServiceNameCustomAction" BinaryKey="RegisterServiceCustomActionBinary" DllEntry="ShowRegisterService" Execute="deferred" Return="check" />
</Fragment>
Here are the different conditions I have tried:
(ServiceType="RegisterNew") AND (NOT Installed)
<![CDATA[(ServiceType="RegisterNew") AND (NOT Installed)]]>
ServiceType="RegisterNew" AND NOT Installed
Here is the code for my custom Dialog where they are selecting making their selection that will change "ServiceType":
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="SelectServiceDlg">
<Property Id="ServiceType" Value="RegisterNew" />
<Dialog Id="SelectServiceDlg" Width="370" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="[DialogBitmap]" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="40" Transparent="yes" NoPrefix="yes" Text="Determine whether you need to register a new service or link an existing service." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Service Type Selection" />
<Control Id="BothScopes" Type="RadioButtonGroup" X="20" Y="55" Width="330" Height="120" Property="ServiceType">
<RadioButtonGroup Property="ServiceType">
<RadioButton Value="RegisterNew" X="0" Y="0" Width="295" Height="16" Text="Register New Service" />
<RadioButton Value="LinkExisting" X="0" Y="60" Width="295" Height="16" Text="Link Existing Service" />
</RadioButtonGroup>
</Control>
<Control Id="RegisterNewServiceDescription" Type="Text" X="33" Y="70" Width="300" Height="36" NoPrefix="yes" Text="Select this option if you are going to register a new service.">
</Control>
<Control Id="LinkExistingDescription" Type="Text" X="33" Y="130" Width="300" Height="36" NoPrefix="yes" Text="Select this option if you are going to link an existing service to this service.">
</Control>
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
Here is an image of the UI:
So my question is why is it executing the custom action even though my condition is specifically checking that property?
After some reading of documentation and looking at all of the "properties" of the tag in WIX I decided to try and set a couple of other values and see what happened. I found that when defining the Property if you mark it as secure it then retains its value throughout the entire install process whereas if it is not secure it does not seem to do that. So now my property definition looks like this:
<Property Id="SERVICE_TYPE" Secure="yes" Value="RegisterNew" />
You'll notice that I had to change the name to call caps because when you mark a property as a secure property then you can not have any lowercase letters in the name.
Here is a snippet from the WIX documentation:
Secure -- YesNoType -- Denotes that the property can be passed to the server-side when doing a managed installation with elevated privileges. See the SecureCustomProperties Property for more information.
WIX Documentation For Property Element

How to fix high contrast setting for text control in wix toolset

Disabled user control in installer GUI is not being highlighted (in green border) in high contrast windows theme, but password controls works correctly. But configuration for both elements is same.
How to fix that or is it even possible to fix that in Wix?
<Control Id="ProxyUserNameEdit" Type="Edit" X="30" Y="150" Width="200" Height="17" Help="|" Sunken="yes" Property="USER">
<Condition Action="disable"><![CDATA["1" = "1"]]></Condition>
<Control Id="ProxyPasswordEdit" Type="Edit" X="30" Y="192" Width="200" Height="17" Help="|" Sunken="yes" Password="yes" Property="PASSWORD">
<Condition Action="disable"><![CDATA["1" = "1"]]></Condition>

Using a condition to make changes to the Windows firewall in WIX

I am trying to make changes to the Windows firewall based on a property that is set in a dialog. I can see in the log that the property is being set correctly but the firewall rules are being created regardless of the value of the property.
My code is...
<Component Id="ChangeFirewall" Guid="*" KeyPath="yes">
<Condition><![CDATA[ChgFirewall = "True"]]></Condition>
<fire:FirewallException Id="FW6501" Name="6501" Port="6501"
Protocol="tcp" Scope="any"/>
<fire:FirewallException Id="FW6502" Name="6502" Port="6502"
Protocol="tcp" Scope="any"/>
<fire:FirewallException Id="FW6505" Name="6505" Port="6505"
Protocol="tcp" Scope="any"/>
</Component>
If ChgFirewall is False why does the firewall get changed?
Update: I have added the code for the dialog that sets the CHGFIREWALL property...
<Dialog Id="FirewallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="Description" Type="Text" X="20" Y="20" Width="280" Height="40" Transparent="yes" NoPrefix="yes">
<Text>This program uses TCP ports 6501, 6501, and 6505 for coordinating information between workstations. These ports must be unblocked for it to work correctly</Text>
</Control>
<Control Id="Instructions" Type="Text" X="20" Y="70" Width="280" Height="30" Transparent="yes" NoPrefix="yes">
<Text>This installer can attempt to automatically modify the Windows Firewall for you, or you may manually modify the firewall settings.</Text>
</Control>
<Control Type="RadioButtonGroup" Property="CHGFIREWALL" Id="CHGFIREWALL" Width="340" Height="44" X="20" Y="120">
<RadioButtonGroup Property="CHGFIREWALL">
<RadioButton Text="Have the installer update the firewwall settings for Guru (Recommended)" Height="13" Value="True" Width="340" X="0" Y="0" />
<RadioButton Text="Manually update the firewall settings" Height="13" Value="False" Width="340" X="0" Y="15" />
</RadioButtonGroup>
</Control>
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next">
<Publish Event="EndDialog" Value="Return"></Publish>
</Control>
<Control Id="CancelButton" Type="PushButton" Text="Cancel" Height="17" Width="56" X="180" Y="243" Cancel="yes">
<Publish Event="EndDialog" Value="Exit" />
</Control>
</Dialog>
Also this is my definition of the property...
<Property Id='CHGFIREWALL' Value='False' Secure='yes'/>
As a first step, UPPERCASE the property and set the attribute 'secure="yes". This ensures that the property is passed properly to the server process as explained in the comments here.
Then the issue is how you set the property? Is is set by a custom action, or do you set it in the Property table or on the command line?

WiX: property value lost between InstallUISequence and InstallExecuteSequence

I'm facing an issue with my WiX installer.
I have a custom dialog that contains an edit control linked to a property. At runtime, if I change the value in the edit control, I see from the log that the property is properly updated with that new value. But it seems that, when the InstallUISequence ends, the property is reset to its default value, which is annoying, because I cannot use the user sumitted value in a custom action part of the InstallExecuteSequence.
Here is an extract of the WXS script I use:
<UI>
<Dialog Id="select_list" Width="370" Height="270" Title="Select license and list files">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="UIBannerBmp" />
<Control Id="BannerLine" Type="Line" X="0" Y="45" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Type="Edit" Id="list" Width="211" Height="15" X="128" Y="128" Property="pListFile" />
<Control Type="Text" Id="static_list" Width="78" Height="17" X="41" Y="154" Text="list file" />
<Control Type="PushButton" Id="next" Width="50" Height="17" X="232" Y="244" Text="Next >">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Type="PushButton" Id="cancel" Width="50" Height="17" X="296" Y="244" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Type="Text" Id="desc" Width="348" Height="16" X="8" Y="90"
Text="Please set the path of the the list file" />
</Dialog>
<InstallUISequence>
<Show Dialog="select_list" After="WelcomeEulaDlg">NOT installed</Show>
</InstallUISequence>
</UI>
<CustomAction Id="InstallService"
ExeCommand="[bin]prog.exe -f install.cl '[pListFile]'"
Execute="immediate"
Return="check"
Directory="bin" />
<InstallExecuteSequence>
<Custom Action="InstallService" After="InstallFinalize">REMOVE=""</Custom>
</InstallExecuteSequence>
<CustomActionRef Id="InstallService" />
<Property Id="pListFile" Value="c:\" />
I must not be on the right track to exchange information between the two sequences.
Is there a way to do that?
You need to mark the Property "Secure" for it to pass from the client-side (InstallUISequence) to server-side (InstallExecuteSequence). To do that you need to make the Property "public" (ALL CAPS) and secure. Something like so:
<Property Id="PLISTFILE" Secure="yes"/>
You don't need to give it a value unless you want something to show up by in your UI by default.