Wix Installer - Add custom dialog to WixUI_Minimal - wix

Please note - I don't want to change anything in WixUI_Minimal(if possible).
I am trying to add a custom dialog(UserTypeDlg) after WelcomeEulaDlg in WixUI_Minimal i.e whenever a user clicks on Install button after accepting license. This part works fine
On custom dialog I have provided back button which works just fine and takes me to WelcomeEulaDlg. However, when I again click on Install button it directly start installation with out showing my custom dialog.
Could someone help me to get around this?
My code is -
Custom dialog
-->
<Dialog Id="UserTypeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<!--<Control Id="InstallButton" Type="PushButton" Text="Install" Height="17" Width="56" X="245" Y="243">
<Publish Event="EndDialog" Value="Return" />
</Control>-->
<Control Id="UserTypeRadioGroup" Type="RadioButtonGroup" Property="UserTypeRadioButtonGroup" Height="100" Width="100" X="50" Y="50">
<RadioButtonGroup Property="UserTypeRadioButtonGroup">
<RadioButton Value="1" Text="Admin" Height="17" Width="50" X="50" Y="0" />
<RadioButton Value="2" Text="Domain User" Height="17" Width="100" X="50" Y="20" />
</RadioButtonGroup>
</Control>
<!--<Control Id="Next" Type="PushButton" X="245" Y="243" Width="100" Height="17" Text="Next">
<Publish Event="EndDialog" Value="Return" />
</Control>-->
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
<Publish Property="WixUI_InstallMode" Value="Update">Installed AND PATCH</Publish>
</Control>
<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>
<!--<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />-->
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
<Publish Event="NewDialog" Value="WelcomeEulaDlg">1</Publish>
</Control>
</Dialog>
<!--<Dialog Id="AdminDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="no">
</Dialog>-->
</UI>
</Fragment>
</Wix>
Product installation file:-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="UserTypeUI">
<Property Id="UserTypeRadioButtonGroup" Value="2" />
<!--<TextStyle Id="Tahoma_Regular" FaceName="Tahoma" Size="8" />
<Property Id="DefaultUIFont" Value="Tahoma_Regular"/>-->
<Dialog Id="UserTypeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<!--<Control Id="InstallButton" Type="PushButton" Text="Install" Height="17" Width="56" X="245" Y="243">
<Publish Event="EndDialog" Value="Return" />
</Control>-->
<Control Id="UserTypeRadioGroup" Type="RadioButtonGroup" Property="UserTypeRadioButtonGroup" Height="100" Width="100" X="50" Y="50">
<RadioButtonGroup Property="UserTypeRadioButtonGroup">
<RadioButton Value="1" Text="Admin" Height="17" Width="50" X="50" Y="0" />
<RadioButton Value="2" Text="Domain User" Height="17" Width="100" X="50" Y="20" />
</RadioButtonGroup>
</Control>
<!--<Control Id="Next" Type="PushButton" X="245" Y="243" Width="100" Height="17" Text="Next">
<Publish Event="EndDialog" Value="Return" />
</Control>-->
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
<Publish Property="WixUI_InstallMode" Value="Update">Installed AND PATCH</Publish>
</Control>
<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>
<!--<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />-->
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
<Publish Event="NewDialog" Value="WelcomeEulaDlg">1</Publish>
</Control>
</Dialog>
<!--<Dialog Id="AdminDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="no">
</Dialog>-->
</UI>
</Fragment>
</Wix>

According to the wix documentation you still need to change the '' elements of what you want to change, setting the 'Next Event' and 'Back Event' of your dialog and overwriting the events of elements that should come before and after your dialog

Related

Control that can close installator

Im trying to make Control with Dialog that cloes all instalator when i hit PushButton:
<Control Id="Cancel" Type="PushButton" X="304" Y="100" Width="56" Height="17" Default="yes" Text="Exit">
<Publish Event="Finish" Value="Return">1</Publish>
</Control>
When i press it, my installator returns code 2812.
How to write Control on Dialog, that will close Installator without any error?
Code:
...
<UI >
<Dialog Id="InstallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Ready to Install</Text>
</Control>
<Control Id="Install" Type="PushButton" X="304" Y="243" Width="56" Height="17" Default="yes" Text="Install">
<Publish Event="EndDialog" Value="Return" />
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="100" Width="56" Height="17" Default="yes" Text="Exit">
<Publish Event="Finish" Value="Return">1</Publish>
</Control>
</Dialog>
</UI>
...
<Upgrade Id="!(loc.UpgradeCode)">
<UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
Minimum='1.0.1' IncludeMinimum='no' />
</Upgrade>
...
<InstallUISequence>
<Show Dialog="InstallDlg" After='FindRelatedProducts' >NEWERFOUND</Show>
</InstallUISequence>
I assume you don't want a confirmation dialog to avoid an accidental exit. Change your code for that button to:
<Control Id="Cancel" Type="PushButton" X="304" Y="100" Width="56" Height="17" Cancel="yes" Text="Exit">
<Publish Event="EndDialog" Value="Exit">1</Publish>
</Control>

Back/Next Button in UI using Wix toolset

I can not make adequate buttons to move normally between windows.
My installer contains 3 windows. If I do "NewDialog" in "Back-button", the windows open once again. And if I do "EndDialog"- the windows disappear.
<UI Id="UserInterface">
<Property Id="WixUI_Mode" Value="Custom" />
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />
<Dialog Id="IISSettings" Width="250" Height="160" Title="IIS Settings">
<Control Type="Text" Id="HostNameEditLabel" X="10" Y="10" Width="200" Height="15" Text="Hostname" />
<Control Type="Edit" Id="HostNameEdit" X="10" Y="30" Width="118" Height="15" Property="HOSTNAME" Text="{80}" Indirect="no" />
<Control Type="PushButton" Id="BrowseLicenseFile" X="165" Y="70" Width="75" Height="15" Text="Browse...">
<Publish Event="DoAction" Value="BrowseForCertificateFileCA" Order="1"><![CDATA[1]]></Publish>
<Publish Property="CERTPATH" Value="[CERTPATH]"><![CDATA[1]]></Publish>
</Control>
<Control Type="Text" Id="PasswordLabel" X="10" Y="90" Width="82" Height="15" Text="Сertificate password" />
<Control Type="Edit" Password="yes" Id="CertificatePassword" X="10" Y="105" Width="123" Height="15" Property="PASSCERT" />
<Control Type="PushButton" Id="Next" X="184" Y="130" Width="56" Height="15" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="EndDialog" Value="Return"></Publish>
</Control>
<Control Type="PushButton" Id="Cancel" X="120" Y="130" Width="56" Height="15" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">
</Publish>
</Control>
</Dialog>
<Dialog Id="PortControlUserService" Width="370" Height="200" Title="Settings">
<Control Id="InfoText" Type="Text" X="10" Y="10" Width="350" Height="15" Text="*У пользователя должны быть права администратора на клиентских компьютерах!" />
<Control Id="DbServerNameEditLabel" Type="Text" X="10" Y="35" Width="350" Height="15" Text="User login" />
<Control Id="DbServerNameEdit" Type="Edit" X="10" Y="50" Width="350" Height="18" Property="USERLOGIN" Text="{80}" Indirect="no" />
<Control Id="PasswordEditLabel" Type="Text" X="10" Y="85" Width="350" Height="15" Text="User Password" />
<Control Id="PasswordEdit" Type="Edit" Password="yes" X="10" Y="100" Width="350" Height="18" Property="USERPASSWORD" Text="{80}" Indirect="no" />
<Control Id="Back" Type="PushButton" X="156" Y="130" Width="56" Height="17" Text="!(loc.WixUIBack)">
<Publish Event="NewDialog" Value="IISSettings"></Publish>
</Control>
<Control Id="Next" Type="PushButton" X="236" Y="130" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="EndDialog" Value="Return"></Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="130" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg"></Publish>
</Control>
</Dialog>
<Dialog Id="PortControlParams" Width="370" Height="350" Title="Settings">
<Control Id="DbServerNameEditLabel" Type="Text" X="10" Y="10" Width="350" Height="15" Text="Database Server Name" />
<Control Id="DbServerNameEdit" Type="Edit" X="10" Y="35" Width="350" Height="18" Property="DBSERVERNAME" Text="{80}" Indirect="no" />
<Control Id="DbInstanceNameEditLabel" Type="Text" X="10" Y="60" Width="350" Height="15" Text="Database Instance Name" />
<Control Id="DbInstanceNameEdit" Type="Edit" X="10" Y="85" Width="350" Height="18" Property="DBINSTANCENAME" Text="{80}" Indirect="no" />
<Control Id="PasswordEdit" Type="Edit" Password="yes" X="10" Y="235" Width="350" Height="18" Property="DBPASSWORD" Text="{80}" Indirect="no" />
<Control Id="Back" Type="PushButton" X="156" Y="273" Width="56" Height="17" Text="!(loc.WixUIBack)">
<Publish Event="NewDialog" Value="PortControlUserService"></Publish>
</Control>
<Control Id="Next" Type="PushButton" X="236" Y="273" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="EndDialog" Value="Return"></Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="273" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg"></Publish>
</Control>
</Dialog>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<InstallUISequence>
<Show Dialog="IISSettings" Before="PortControlUserService" ></Show>
<Show Dialog="PortControlUserService" Before="PortControlParams" ></Show>
<Show Dialog="PortControlParams" Before="ExecuteAction" ></Show>
</InstallUISequence>
</UI>
if I add "SpawnDialog" in "Back button", the windows will appear on top of another window, and I need to have one window. Looked at a lot of forums, but it's hard.
Dialog Order: Please see if this is helpful: Wix, custom dialog when previous version exists.
Dialog Customization: There is this answer on the overall topic of Customizing WiX Dialogs. Perhaps also see Helge Klein's real world sample (Wayback - Archived Version) for dialog changes (ServerDlg.wxs, WixUI_HK.wxs, LicenseAgreementDlg_HK.wxs) and many other nice features. Customizing Built-in WixUI Dialog Sets.
And throwing in this "general WiX quick start tips".

WiX - how do I refresh Edit control after file browse dialog

I am required to have a FileBrowseDialog during a WiX installation. I made my own custom dialog that raises the OpenFileDialog and sets the selected value in the session property (found the code here). I need a way to refresh the Edit control with the selected full path. Right now, after choosing the file, the edit control remains blank. How do I achieve this? I am not an expert in MSI or WiX.
Wix Code:
<UI>
<Dialog Id="DrugsDBFileBrowseDialog" Width="370" Height="270" Title="!(loc.DrugsDBFileDlg_Title)">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.SetupTypeDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.DrugsDBFileDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.DrugsDBFileDlgTitle)" />
<Control Type="Edit" Id="txtDrugsFilePath" Width="270" Height="15" X="22" Y="142" Property="DRUGSDBFILEPATH" Text="[DRUGSDBFILEPATH]" />
<Control Type="PushButton" Id="btnBrowse" Width="56" Height="21" X="300" Y="139" Text="&Browse" >
<Publish Event="DoAction" Value="BrowseDBFile" Order="0">1</Publish>
<Publish Event="SpawnDialog" Value="ValidationErrorDlg" Order="1000">ValidationErrorText</Publish>
</Control>
<Control Type="Text" Id="lblInstructions" Width="290" Height="15" X="26" Y="120" Text="!(loc.DrugsDBFileDlgLabelDescription)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<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" 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>
Custom Action Code:
[CustomAction]
public static ActionResult BrowseDBFile(Session session)
{
try {
session.Log("Begin OpenFileChooser Custom Action");
var task = new Thread(() => GetFile(session));
task.SetApartmentState(ApartmentState.STA);
task.Start();
task.Join();
session.Log("End OpenFileChooser Custom Action");
} catch (Exception ex) {
session.Log("Exception occurred as Message: {0}\r\n StackTrace: {1}", ex.Message, ex.StackTrace);
return ActionResult.Failure;
}
return ActionResult.Success;
}
private static void GetFile(Session session)
{
OpenFileDialog fileDialog = new OpenFileDialog();
if (fileDialog.ShowDialog() == DialogResult.OK) {
session["DRUGSDBFILEPATH"] = fileDialog.FileName;
}
}
UPDATE
Found out the solution is to invoke the RESET event before performing the action associated to the BROWSE button. I also performed a PUBLISH PROPERTY after performing the custom action. Look below.
<UI>
<Dialog Id="DrugsDBFileBrowseDialog" Width="370" Height="270" Title="!(loc.DrugsDBFileDlg_Title)">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.SetupTypeDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.DrugsDBFileDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.DrugsDBFileDlgTitle)" />
<Control Type="Edit" Id="txtDrugsFilePath" Width="270" Height="15" X="22" Y="142" Property="DRUGSDBFILEPATH" Text="[DRUGSDBFILEPATH]" />
<Control Type="PushButton" Id="btnBrowse" Width="56" Height="21" X="300" Y="139" Text="&Browse" >
<Publish Event="Reset" Value="1">1</Publish>
<Publish Event="DoAction" Value="BrowseDBFile" Order="1"><![CDATA[1]]></Publish>
<Publish Property="DRUGSDBFILEPATH" Value="[DRUGSDBFILEPATH]"><![CDATA[1]]></Publish>
</Control>
<Control Type="Text" Id="lblInstructions" Width="290" Height="15" X="26" Y="120" Text="!(loc.DrugsDBFileDlgLabelDescription)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<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" Text="!(loc.WixUINext)" >
<Publish Event="DoAction" Value="ValidateSelectedPath" Order="1">1</Publish>
<Publish Event="SpawnDialog" Value="ValidationErrorDlg" Order="1000">ValidationErrorText</Publish>
</Control>
<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>
<Control Type="Edit" Id="txtDrugsFilePath" Width="270" Height="15" X="22" Y="142" Property="DRUGSDBFILEPATH" Text="[DRUGSDBFILEPATH]" />
<Control Type="PushButton" Id="btnBrowse" Width="56" Height="21" X="300" Y="139" Text="&Browse" >
<Publish Event="Reset" Value="1">1</Publish>
<Publish Event="DoAction" Value="BrowseDBFile" Order="1"><![CDATA[1]]></Publish>
<Publish Property="DRUGSDBFILEPATH" Value="[DRUGSDBFILEPATH]"><![CDATA[1]]></Publish>
</Control>
<Control Type="Text" Id="lblInstructions" Width="290" Height="15" X="26" Y="120" Text="!(loc.DrugsDBFileDlgLabelDescription)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<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" Text="!(loc.WixUINext)" >
<Publish Event="DoAction" Value="ValidateSelectedPath" Order="1">1</Publish>
<Publish Event="SpawnDialog" Value="ValidationErrorDlg" Order="1000">ValidationErrorText</Publish>
</Control>
<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>
I did the same with the label
<Control
Type="PushButton"
Id="Browse"
Width="56"
Height="17"
X="281"
Y="125"
Text="Browser"
Property="FILE_PATH" >
<Publish Event="DoAction" Value="CA_TO_OPEN_FILE_BROWSER_DIALOG" Order="1">1</Publish>
<Publish Property="FILE_PATH" Value="[FILE_PATH]">1</Publish>
</Control>
<Control
Type="Text"
Id="LocationLabel"
Width="244"
Height="15"
X="26" Y="126"
Property="FILE_PATH"
Text="[FILE_PATH]"
Sunken="yes"
Indirect="yes"
Disabled="yes">
</Control>

Wix SetProperty by feature select | Launch specific feature after installation

My WixInstaller is installing two different Apps (Editor AND / OR Viewer).
After the Installation the user can check a checkbox for if he wants to launch the application.
By default, the WixShellExecTargetProperty has the value [#ViewerApp]. If the user has installed the Editor, the Property should have the value [#EditorApp]. But it is not assigned.
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<SetProperty Id="WixShellExecTarget" Value="[#EditorApp]" After="InstallExecute" Sequence="execute"><![CDATA[EditorFeature=3]]></SetProperty>
<Property Id="WixShellExecTarget" Value="[#ViewerApp]" />
Solution:
Here is my solution that works:
define the CustomAction for each apllication / feature that can/should be started.
<CustomAction Id="SetLaunchApplicationEditor" Property="WixShellExecTarget" Value="[#EditorApp]" />
<CustomAction Id="SetLaunchApplicationViewer" Property="WixShellExecTarget" Value="[#ViewerApp]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
on the last page, where the install is finished, define the start
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="[ButtonText_Finish]">
<Publish Event="EndDialog" Value="Return">1</Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationViewer"><![CDATA[&ViewerFeature=3]]></Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationEditor"><![CDATA[&EditorFeature=3]]></Publish>
<Publish Event="DoAction" Value="LaunchApplication">LaunchApp = 1</Publish>
</Control>
!!
If only the Viewer or Editor is installed, then this app is started. If both are installed, the Editor gets started, because it's DoAction is triggered afterwards.
Exit Dialog with the checkbox
<Dialog Id="HtExitDialog" Width="370" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes">
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="[ButtonText_Finish]">
<Publish Event="EndDialog" Value="Return">1</Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationViewer"><![CDATA[&ViewerFeature=3]]></Publish>
<Publish Event="DoAction" Value="SetLaunchApplicationEditor"><![CDATA[&EditorFeature=3]]></Publish>
<Publish Event="DoAction" Value="LaunchApplication">LaunchApp = 1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="[ButtonText_Cancel]" />
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="[DialogBitmap]" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="[ButtonText_Back]" />
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="20" Transparent="yes" NoPrefix="yes">
<Text>Click the Finish button to exit the [Wizard].</Text>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes">
<Text>{\VerdanaBold13}Completing the [ProductName] [Wizard]</Text>
</Control>
<Control Type="CheckBox" Id="StartApp" Width="142" Height="17" X="158" Y="120" Text="Launch Application" Property="LaunchApp" CheckBoxValue="1" />
</Dialog>

WIX installer - Installing Features based on checkbox selection in UI dialog is not working

Even though Checkbox is not selected, the msi installs all features. I have AddLocal and remove when Next is clicked. Here is the UI code:
<Control Id="SFCheckBox" Type="CheckBox" X="20" Y="80" Width="290" Height="17" Property="SF_FEATURE" CheckBoxValue="0" Integer="yes" Text="iNetSec Smart Finder Sensor Service will be installed." Default="yes" Disabled="yes" />
<Control Id="group_NDCforFEService" Type="CheckBox" X="20" Y="110" Width="290" Height="17" Property="FE_FEATURE" CheckBoxValue="1" Integer="yes" Text="iNetSec Smart Finder FireEye Integration Service will be installed." />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&Next">
<Publish Event="DoAction" Value="CostFinalize">1</Publish>
<Publish Event="NewDialog" Value="UserInfoDlg" Order="2">SF_FEATURE</Publish>
<Publish Event="AddLocal" Value="All" Order="3">1</Publish>
<Publish Event="Remove" Value="IntegrationFeatures" Order="4">NOT FE_FEATURE</Publish>
</Control>
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back">
<Publish Event="AddLocal" Value="All" Order="3">1</Publish>
<Publish Event="NewDialog" Value="InstallDirDlg" Order="4">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="iNetSec Smart Finder Features." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}iNetSec Smart Finder Features" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<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" />
</Dialog>
</UI>
The Features in Product is as follows.
I don't know what I am I doing wrong here. Even though I did not select the second checkbox, the "IntegrationFeatures" was installed. When I checked the log file, I see this:
Property(S): ADDLOCAL = IntegrationFeatures,ProductFeature.
Please help.
Thanks,
Ravi
I do not recommend the AddLocal and Remove approach found here for the reasons I listed in the comments which amount to "Install everything and then removing it based on checkbox selection is silly and complicates silent installs".
What you should be doing is adding conditions to your <Feature> nodes like this:
<Feature Id="FeatureA" Level="0">
<Condition Level="1">INSTALLFEATUREA</Condition>
<ComponentGroupRef Id="A_Files" />
</Feature>