WiX: How to call UAC on "Repair"? - wix

How can I show privilege escalation window on button "Repair"?
<Control Id="RepairButton" ElevationShield="yes" Type="PushButton" X="40" Y="118" Width="80" Height="17" ToolTip="!(loc.MaintenanceTypeDlgRepairButtonTooltip)" Text="!(loc.MaintenanceTypeDlgRepairButton)">
<Publish Event="Reinstall" Value="ALL" />
<Publish Property="WixUI_InstallMode" Value="Repair">1</Publish>
<Publish Property="TYPE_DESCRIPTION" Value="repair">1</Publish>
<Publish Property="TYPE_DESCRIPTION2" Value="repair">1</Publish>
</Control>

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>

Issue replacing the default WelcomeDlg dialog

I have managed to add a custom dialog in the middle of the sequence which collects several values from the user and saves them to the registry (in the dialog with ID ApiKeyDlg).
However, I'm having difficulty (5+ hours wasted) replacing the WelcomeDlg with a custom dialog during major upgrades only. I.E. I want to show a custom WelcomeDlg that goes straight to the VerifyReadyDlg for Major Upgrades (detected using Installed OR PREVFOUND).
I have also tried using WIX_UPGRADE_DETECTED, same results.
What am I doing incorrectly here? Is it my condition that is failing or am I misunderstanding the process of editing the sequence?
Light.exe shows no errors, but it fails to either:
Detect that an older version of the app is already installed
Show the UpgradeWelcomeDlg after detecting an old version installed
I'm not sure how I can narrow down which part is failing?
<UI>
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="LicenseAgreementDlg" />
<DialogRef Id="VerifyReadyDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed OR NOT PREVFOUND</Publish>
<Publish Dialog="UpgradeWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed OR PREVFOUND</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="ApiKeyDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="ApiKeyDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="ApiKeyDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg"></Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ApiKeyDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="UpgradeWelcomeDlg" Order="2">Installed OR PREVFOUND</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Dialog Id="ApiKeyDlg" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.ProgressDlgBannerBitmap)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<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="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Only the Organisation ID is required unless you're using a web proxy" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Agent configuration" />
<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="ApiKeyLabel" Type="Text" X="20" Y="55" Width="290" Height="10" NoPrefix="yes" Text="Organisation ID (required):" />
<Control Id="ApiKey" Type="Edit" X="20" Y="70" Width="300" Height="18" Property="UI_ORGANISATION" Indirect="yes" />
<Control Id="ProxyAddressLabel" Type="Text" X="20" Y="95" Width="290" Height="10" NoPrefix="yes" Text="Proxy server address (optional):" />
<Control Id="Proxy" Type="Edit" X="20" Y="110" Width="300" Height="18" Property="UI_PROXYADDRESS" Indirect="yes" />
<Control Id="ProxyUsernameLabel" Type="Text" X="20" Y="130" Width="290" Height="10" NoPrefix="yes" Text="Proxy username (leave blank for default):" />
<Control Id="ProxyUsername" Type="Edit" X="20" Y="145" Width="300" Height="18" Property="UI_PROXYUSERNAME" Indirect="yes" />
<Control Id="ProxyPasswordLabel" Type="Text" X="20" Y="165" Width="290" Height="10" NoPrefix="yes" Text="Proxy password (leave blank for default):" />
<Control Id="ProxyPassword" Type="Edit" Password="yes" X="20" Y="180" Width="300" Height="18" Property="UI_PROXYPASSWORD" Indirect="yes" />
<Control Id="ScoutCheckbox" Type="CheckBox" X="20" Y="205" Width="300" Height="17" Property='SCOUTSHORTCUT' CheckBoxValue='1'>
<Text> Create a Start Menu shortcut for SomeApplicationName Scout (optional)</Text>
</Control>
</Dialog>
<Dialog Id="UpgradeWelcomeDlg" Width="370" Height="270" Title="[ProductName] Update">
<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" Disabled="yes" Text="!(loc.WixUIBack)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="135" Y="80" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)" >
</Control>
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgTitle)" />
</Dialog>
<InstallUISequence>
<Show Dialog="UpgradeWelcomeDlg" Before="ProgressDlg">Installed OR PREVFOUND</Show>
</InstallUISequence>
<UIRef Id="WixUI_Common" />
</UI>
Ultimately, I want to show completely different dialogs for Major Upgrades compared to an initial install.
Well then... I just managed to get it working using this:
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed OR NOT PREVFOUND OR NOT WIX_UPGRADE_DETECTED</Publish>
<Publish Dialog="UpgradeWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed OR PREVFOUND OR WIX_UPGRADE_DETECTED</Publish>
Perhaps writing this question cleared my mind! Who knows.

Create new dialog with 4 checkboxes and add the dialog UI.wxs

How can I add a new dialog to the installation set of dialogs in WiX? Before the future selection dialog I want to pop up a dialog with 4 check boxes to add some extra files.
I have found some help on adding a checkbox to an existing dialog, but how can I add a new dialog?
I have tried this:
added the following inside in my UI.wxs
<Dialog Id="NewDlg" Width="370" Height="270" Title="Conditions dialog">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<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="OP1" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="OPONE" Text="Op1" />
<Control Id="OP2" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="OPTWO" Text="Op2" />
<Control Id="OP2" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="OPTHREE" Text="Op3" />
<Control Id="OP2" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="OPFOUR" Text="Op4" />
</Dialog>
<Publish Dialog="NewDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg"></Publish>
<Publish Dialog="NewDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg"></Publish>
But the dialog in not popping up.
UPDATE: Now the dialog is showing up. But,
The checkbox is not allowing to uncheck and,
How to install a file based on the check box's check?
You should define next step in LicenseAgreementDlg for creating your dialog. Check the markup code below:
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="NewDlg" Order="1"></Publish>
<Publish Dialog="NewDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg"></Publish>
<Publish Dialog="NewDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg"></Publish>

WIX - Adding a custom Dialog having trouble with back/next buttons

I am working on creating a custom WixUi configuration, here is what I've done so far:
Copied the WixUI_Minimal.wxs file into my project and changed the Id to: WixUI_CustomMinimal
Copied the WelcomeEulaDlg.wxs file into my project and changed the Id to: CustomWelcomeEulaDlg
Copied the WelcomeDlg.wxs file into my project and changed the Id to: CustomWelcomeDlg
Added InstallTypeDlg.wxs to my project
Modified the CustomWelcomeEulaDlg to change the Install button to a next button.
Modified WixUI_CustomMinimal to make the Next/NextNoShield buttons on WelcomeEulaDlg open the InstallTypeDlg dialog
Added the InstallTypeDlg Dialog to the InstallUiSequence.
So now the problem: I am trying to setup a back button on InstallTypeDlg, this is working but after pressing the back button and then pressing the next button on CustomWelcomeEulaDlg InstallTypeDlg is skipped and it goes straight to installing.
Here are my files:
WixUI_CustomMinimal
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WixUI_Minimal.wxs" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<!--
First-time install dialog sequence:
- WixUI_WelcomeEulaDlg
Maintenance dialog sequence:
WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="WixUI_CustomMinimal">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="Minimal" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<DialogRef Id="CustomWelcomeDlg" />
<DialogRef Id="CustomWelcomeEulaDlg" />
<DialogRef Id="InstallTypeDlg" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Publish Dialog="CustomWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="CustomWelcomeEulaDlg" Control="Next" Event="NewDialog" Value="InstallTypeDlg">Installed AND PATCH</Publish>
<Publish Dialog="CustomWelcomeEulaDlg" Control="NextNoShield" Event="NewDialog" Value="InstallTypeDlg">Installed AND PATCH</Publish>
<Publish Dialog="InstallTypeDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeEulaDlg" Order="2">Installed AND PATCH</Publish>
<InstallUISequence>
<Show Dialog="CustomWelcomeDlg" Before="CustomWelcomeEulaDlg">Installed AND PATCH</Show>
<Show Dialog="CustomWelcomeEulaDlg" Before="InstallTypeDlg">NOT Installed</Show>
<Show Dialog="InstallTypeDlg" Before="ProgressDlg">NOT Installed</Show>
</InstallUISequence>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>
CustomWelcomeEulaDlg
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WelcomeEulaDlg.wxs" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="CustomWelcomeEulaDlg" Width="370" Height="270" Title="!(loc.WelcomeEulaDlg_Title)">
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeEulaDlgBitmap)" />
<Control Id="Title" Type="Text" X="130" Y="6" Width="225" Height="30" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeEulaDlgTitle)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="130" Y="207" Width="226" Height="18" CheckBoxValue="1" Property="LicenseAccepted" Text="!(loc.WelcomeEulaDlgLicenseAcceptedCheckBox)" />
<Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
<Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
</Control>
<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Next" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
<Condition Action="enable">LicenseAccepted = "1"</Condition>
<Condition Action="show">ALLUSERS</Condition>
</Control>
<Control Id="NextNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Next" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
<Condition Action="enable">LicenseAccepted = "1"</Condition>
<Condition Action="show">NOT ALLUSERS</Condition>
</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="LicenseText" Type="ScrollableText" X="130" Y="36" Width="226" Height="162" Sunken="yes" TabSkip="no">
<Text SourceFile="!(wix.WixUILicenseRtf)" />
</Control>
</Dialog>
</UI>
<InstallUISequence>
<Show Dialog="CustomWelcomeEulaDlg" Before="ProgressDlg" Overridable="yes">NOT Installed</Show>
</InstallUISequence>
</Fragment>
</Wix>
InstallTypeDlg
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WelcomeEulaDlg.wxs" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Property Id="INSTALLTYPE" Value="Null"/>
<Dialog Id="InstallTypeDlg" Width="370" Height="270" Title="!(loc.WelcomeEulaDlg_Title)">
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeEulaDlgBitmap)" />
<Control Id="Title" Type="Text" X="130" Y="6" Width="225" Height="30" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeEulaDlgTitle)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
<Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
</Control>
<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Publish Event="AddLocal" Value="ServiceFeature"><![CDATA[INSTALLTYPE = "SERVICE"]]></Publish>
<Publish Event="Remove" Value="ServiceFeature"><![CDATA[INSTALLTYPE <> "SERVICE"]]></Publish>
<Condition Action="disable">INSTALLTYPE = "Null"</Condition>
<Condition Action="enable"><![CDATA[INSTALLTYPE <> "Null"]]></Condition>
<Condition Action="show">ALLUSERS</Condition>
</Control>
<Control Id="InstallNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
<Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
<Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
<Publish Event="AddLocal" Value="ServiceFeature"><![CDATA[INSTALLTYPE = "SERVICE"]]></Publish>
<Publish Event="Remove" Value="ServiceFeature"><![CDATA[INSTALLTYPE <> "SERVICE"]]></Publish>
<Condition Action="disable">INSTALLTYPE = "Null"</Condition>
<Condition Action="enable"><![CDATA[INSTALLTYPE <> "Null"]]></Condition>
<Condition Action="show">NOT ALLUSERS</Condition>
</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="FeatureGroup" Property="INSTALLTYPE" Type="RadioButtonGroup" Default="no" X="130" Y="36" Width="226" Height="162">
<RadioButtonGroup Property="INSTALLTYPE">
<RadioButton Text="Console" Height="17" Value="CONSOLE" Width="150" X="20" Y="0" />
<RadioButton Text="Windows Service" Height="17" Value="SERVICE" Width="150" X="20" Y="25" />
<RadioButton Value="Null" X="0" Y="0" Width="0" Height="0" Text="Null" />
</RadioButtonGroup>
</Control>
</Dialog>
</UI>
<InstallUISequence>
<Show Dialog="InstallTypeDlg" Before="ProgressDlg" Overridable="yes">NOT Installed</Show>
</InstallUISequence>
</Fragment>
</Wix>
The first problem is in the InstallUISequence. You should use:
<Show Dialog="CustomWelcomeDlg" Before="CustomWelcomeEulaDlg">
Installed AND PATCH
</Show>
<Show Dialog="CustomWelcomeEulaDlg" Before="ProgressDlg">
NOT Installed
</Show>
In the CustomWelcomeEulaDlg, the Back and Next buttons should be like this:
<Control Id="Back" Type="PushButton" X="156" Y="243"
Width="56" Height="17" Disabled="yes" Text="Back" />
<Control Id="Next" Type="PushButton" ElevationShield="yes"
X="212" Y="243" Width="80" Height="17" Default="yes"
Text="Next" Hidden="yes">
<Publish Event="NewDialog" Value="InstallTypeDlg">1</Publish>
</Control>
And in the InstallTypeDlg, the Back and Install buttons should be similar to this:
<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56"
Height="17" Disabled="yes" Text="Back">
<Publish Event="NewDialog" Value="CustomWelcomeEulaDlg">1</Publish>
</Control>
<Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243"
Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
<Publish Event="EndDialog" Value="Return" />
</Control>

BrowseDialog and InstallDirDlg wix

I have an InstallDirDLG and i need other browse dialog, the problem is when i select the path in second browse dialog also change the installdir path.
This is the control code:
<Control Id="IISLogDirectoryEdit" Type="PathEdit" X="45" Y="100" Width="220" Height="18" Disabled="yes" Property="IISLOGDIRECTORY" Indirect="yes" />
<Control Id="IIsLogDirectoryExplorer" Type="PushButton" X="267" Y="100" Width="56" Height="18" Text="Explorar..." />
And this is the publish:
<Publish Dialog="DirectoriesDlg" Control="Next" Event="SetTargetPath" Value="[IISLOGDIRECTORY]" Order="1">1</Publish>
<Publish Dialog="DirectoriesDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="2"><![CDATA[NOT IISLOGDIRECTORY]]></Publish>
<Publish Dialog="DirectoriesDlg" Control="Next" Event="NewDialog" Value="FtpDlg" Order="3">1</Publish>
<Publish Dialog="DirectoriesDlg" Control="IIsLogDirectoryExplorer" Property="_IISBrowseProperty" Value="[IISLOGDIRECTORY]" Order="1">1</Publish>
<Publish Dialog="DirectoriesDlg" Control="IIsLogDirectoryExplorer" Event="SpawnDialog" Value="IISBrowseDlg" Order="2">1</Publish>
Thanks.
Use different property name for the second browse dialog and set that property value to some default location.
For example:
<Control Id="TestPathEdit"
Type="PathEdit"
X="120" Y="157" Width="160" Height="18"
Property="TESTPROPERTY"/>
<Control Id="TestBrowse"
Type="PushButton"
X="290" Y="157" Width="56" Height="17"
Text="Browse">
<Publish Property="_BrowseProperty"
Value="TESTPROPERTY"
Order="1">1</Publish>
<Publish Event="SpawnDialog"
Value="BrowseDlg"
Order="2">1</Publish>
</Control>
and the default property value
<Property Id="TESTPROPERTY" Value="C:\Test"/>