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

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>

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>

WiX: How to call UAC on "Repair"?

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>

Wix Installer - Add custom dialog to WixUI_Minimal

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

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"/>

Wix: How to add browse button in Wix

Is there a simple way to add browse button in Wix. I created a custom by modifying from WixUI_InstallDir.wxs. This browse button is in another dialog (not the same one as for locating the installation path). This browse button will be use to specify the path to put my log files that will be created during installation.
EDIT:
sorry about the confusion on "below code". I intended to show the codes initially but the space on the above reply was limited. Here I've added the codes. I manage to show the Browse dialog now but i need to be able to change the path so that it is not same as the Browse dialog path of the installation path which is _BrowseProperty. My code below is using _LogBrowseProperty but i'm not sure how do i properly define it and at where should i define it. Using the code below will generate 2819 error. Can you help to take a look on what is wrong here? Thanks a lot.
CUSTOMDIR is defined in Product.wxs
<Property Id='CUSTOMDIR' Value="TARGETDIR"></Property>
Below is in MyWixUI_InstallDir.wxs
<Control Id="LogFolderLabel" Type="Text" X="20" Y="160" Width="290" Height="30" NoPrefix="yes"
Text="Folder Label" />
<Control Id="LogFolder" Type="PathEdit" X="20" Y="200" Width="320" Height="18" Property="CUSTOMDIR"
Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="220" Width="56" Height="17"
Text="Change Folder" />
....
<Publish Dialog="myDlg" Control="ChangeFolder" Property="_LogBrowseProperty" Value="[CUSTOMDIR]" Order="1">1</Publish>
<Publish Dialog="myDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Property Id="_LogBrowseProperty" Value="TARGETDIR" />
I was looking for a while at trying to do the same thing and amended the Wix BroseDlg dialog to achieve this.
In the parent control I had the following path edit and push button controls:
<Control Id="LogFilePathValue" Type="PathEdit" X="50" Y="205" Width="215" Height="18" Property="LOGFILE_PATH"/>
<Control Id="LogFilePathButton" Type="PushButton" X="270" Y="205" Width="50" Height="17" Text="!(loc.LogFilePathButton_Text)">
<Publish Property="LOGFILE_PATH_TEMP" Value="[LOGFILE_PATH]" Order="1">1</Publish>
<Publish Event="SpawnDialog" Value="MyLogFileDialog" Order="2">1</Publish>
</Control>
</Control>
MyLogFileDialog then looked like this:
<Dialog Id="MyLogFileDialog" Width="370" Height="270" Title="!(loc.MyLogFileDialog_DialogTitle)">
<Control Id="PathEdit" Type="PathEdit" X="25" Y="202" Width="320" Height="18" Property="LOGFILE_PATH_TEMP" />
<Control Id="OK" Type="PushButton" X="240" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUIOK)">
<Publish Property="LOGFILE_PATH" Value="[LOGFILE_PATH_TEMP]" Order="1">1</Publish>
<Publish Event="EndDialog" Value="Return" Order="2">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Id="ComboLabel" Type="Text" X="25" Y="58" Width="44" Height="10" TabSkip="no" Text="!(loc.BrowseDlgComboLabel)" />
<Control Id="DirectoryCombo" Type="DirectoryCombo" X="70" Y="55" Width="220" Height="80" Property="LOGFILE_PATH_TEMP" Fixed="yes" Remote="yes">
<Subscribe Event="IgnoreChange" Attribute="IgnoreChange" />
</Control>
<Control Id="WixUI_Bmp_Up" Type="PushButton" X="298" Y="55" Width="19" Height="19" ToolTip="!(loc.BrowseDlgWixUI_Bmp_UpTooltip)" Icon="yes" FixedSize="yes" IconSize="16" Text="!(loc.BrowseDlgWixUI_Bmp_Up)">
<Publish Event="DirectoryListUp" Value="0">1</Publish>
</Control>
<Control Id="NewFolder" Type="PushButton" X="325" Y="55" Width="19" Height="19" ToolTip="!(loc.BrowseDlgNewFolderTooltip)" Icon="yes" FixedSize="yes" IconSize="16" Text="!(loc.BrowseDlgNewFolder)">
<Publish Event="DirectoryListNew" Value="0">1</Publish>
</Control>
<Control Id="DirectoryList" Type="DirectoryList" X="25" Y="83" Width="320" Height="98" Property="LOGFILE_PATH_TEMP" Sunken="yes" TabSkip="no" />
<Control Id="PathLabel" Type="Text" X="25" Y="190" Width="320" Height="10" TabSkip="no" Text="!(loc.BrowseDlgPathLabel)" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.BrowseDlgBannerBitmap)" />
<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="15" Transparent="yes" NoPrefix="yes" Text="!(loc.MyLogFileDialog_TitleBody)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.MyLogFileDialog_TitleMain)" />
</Dialog>
You then have to make sure the property LOGFILE_PATH is set prior to calling this parent form. In my case I'm using my own version of the UI_Mondo so I set the property after the user has selected the install type:
<Publish Dialog="SetupTypeDlg" Control="TypicalButton" Property="LOGFILE_PATH" Value="[COMPONENTINSTALLFOLDER]\Logs" Order="1">1</Publish>
<Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="ParentDialogWithLogLocationControls" Order="2">1</Publish>
Try to examine the WiXUIExtension closer, especially the WixUI_InstallDir.wxs and InstallDirDlg.wxs. See how the controls and dialogs are set up in order to handle directory browsing properly and try to adjust it to your needs.
From InstallDirDlg.wxs:
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
From WixUI_InstallDir.wxs:
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
...
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>