| 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
| 2 | |
| 3 | <!-- |
| 4 | WixUI_Advanced offers a two-click install (EULA checkbox and Install button) |
| 5 | and offers an Advanced button that lets users choose per-machine or per-user |
| 6 | installs, install path, and features. |
| 7 | |
| 8 | WiX variables used: |
| 9 | - WixUISupportPerMachine |
| 10 | - WixUISupportPerUser |
| 11 | |
| 12 | Todo: |
| 13 | - Clicking Install doesn't work! - APPLICATIONFOLDER isn't set; need to accept another "incoming" property. |
| 14 | - Replace this dialog set UI fragment with the UI extension. |
| 15 | = This set is still in active development. |
| 16 | = Future releases are likely to be incompatible. |
| 17 | = Future releases are likely to be much easier to use. |
| 18 | = Use at your own risk. |
| 19 | |
| 20 | --> |
| 21 | |
| 22 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 23 | <?foreach WIXUIARCH in X86;X64;A64 ?> |
| 24 | <Fragment> |
| 25 | <UI Id="WixUI_Advanced_$(WIXUIARCH)"> |
| 26 | <Publish Dialog="BrowseDlg" Control="OK" Event="CheckTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" /> |
| 27 | |
| 28 | <Publish Dialog="InstallDirDlg" Control="Next" Event="CheckTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" /> |
| 29 | <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="4" /> |
| 30 | </UI> |
| 31 | |
| 32 | <UIRef Id="WixUI_Advanced" /> |
| 33 | </Fragment> |
| 34 | <?endforeach?> |
| 35 | |
| 36 | <?foreach WIXUIARCH in X86;X64;A64 ?> |
| 37 | <Fragment> |
| 38 | <UI Id="WixUI_Advanced_ExtendedPathValidation_$(WIXUIARCH)"> |
| 39 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="1" /> |
| 40 | <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="2" Condition="WIXUI_INSTALLDIR_VALID<>"1"" /> |
| 41 | |
| 42 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="1" /> |
| 43 | <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="2" Condition="WIXUI_INSTALLDIR_VALID<>"1"" /> |
| 44 | <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="4" Condition="WIXUI_INSTALLDIR_VALID="1"" /> |
| 45 | </UI> |
| 46 | |
| 47 | <UIRef Id="WixUI_Advanced" /> |
| 48 | </Fragment> |
| 49 | <?endforeach?> |
| 50 | |
| 51 | <Fragment> |
| 52 | <WixVariable Id="virtual WixUISupportPerUser" Value="1" /> |
| 53 | <WixVariable Id="virtual WixUISupportPerMachine" Value="1" /> |
| 54 | |
| 55 | <PropertyRef Id="ApplicationFolderName" /> |
| 56 | |
| 57 | <CustomAction Id="WixSetDefaultPerUserFolder" Property="WixPerUserFolder" Value="[LocalAppDataFolder]Apps\[ApplicationFolderName]" Execute="immediate" /> |
| 58 | <CustomAction Id="WixSetDefaultPerMachineFolder" Property="WixPerMachineFolder" Value="[ProgramFilesFolder][ApplicationFolderName]" Execute="immediate" /> |
| 59 | <CustomAction Id="WixSetPerUserFolder" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Execute="immediate" /> |
| 60 | <CustomAction Id="WixSetPerMachineFolder" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Execute="immediate" /> |
| 61 | |
| 62 | <InstallExecuteSequence> |
| 63 | <Custom Action="WixSetDefaultPerUserFolder" Before="CostFinalize" /> |
| 64 | <Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" /> |
| 65 | <Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachineFolder" Condition="ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))" /> |
| 66 | <Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" /> |
| 67 | </InstallExecuteSequence> |
| 68 | <InstallUISequence> |
| 69 | <Custom Action="WixSetDefaultPerUserFolder" Before="CostFinalize" /> |
| 70 | <Custom Action="WixSetDefaultPerMachineFolder" After="WixSetDefaultPerUserFolder" /> |
| 71 | <Custom Action="WixSetPerUserFolder" After="WixSetDefaultPerMachineFolder" Condition="ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))" /> |
| 72 | <Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" /> |
| 73 | </InstallUISequence> |
| 74 | |
| 75 | <UI Id="file WixUI_Advanced"> |
| 76 | <TextStyle Id="WixUI_Font_Normal" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Normal_Size)" /> |
| 77 | <TextStyle Id="WixUI_Font_Bigger" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Bigger_Size)" /> |
| 78 | <TextStyle Id="WixUI_Font_Title" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Title_Size)" Bold="yes" /> |
| 79 | <TextStyle Id="WixUI_Font_Emphasized" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Emphasized_Size)" Bold="yes" /> |
| 80 | |
| 81 | <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> |
| 82 | |
| 83 | <DialogRef Id="BrowseDlg" /> |
| 84 | <DialogRef Id="DiskCostDlg" /> |
| 85 | <DialogRef Id="ErrorDlg" /> |
| 86 | <DialogRef Id="FatalError" /> |
| 87 | <DialogRef Id="FilesInUse" /> |
| 88 | <DialogRef Id="MsiRMFilesInUse" /> |
| 89 | <DialogRef Id="PrepareDlg" /> |
| 90 | <DialogRef Id="ProgressDlg" /> |
| 91 | <DialogRef Id="ResumeDlg" /> |
| 92 | <DialogRef Id="UserExit" /> |
| 93 | <DialogRef Id="WelcomeDlg" /> |
| 94 | |
| 95 | <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999" /> |
| 96 | |
| 97 | <Publish Dialog="AdvancedWelcomeEulaDlg" Control="Advanced" Event="NewDialog" Value="InstallScopeDlg" Order="1" Condition="!(wix.WixUISupportPerMachine) AND !(wix.WixUISupportPerUser)" /> |
| 98 | <Publish Dialog="AdvancedWelcomeEulaDlg" Control="Advanced" Event="NewDialog" Value="FeaturesDlg" Order="2" Condition="NOT !(wix.WixUISupportPerMachine)" /> |
| 99 | <Publish Dialog="AdvancedWelcomeEulaDlg" Control="Advanced" Event="NewDialog" Value="InstallDirDlg" Order="3" Condition="!(wix.WixUISupportPerMachine) AND NOT !(wix.WixUISupportPerUser)" /> |
| 100 | |
| 101 | <Publish Dialog="InstallScopeDlg" Control="Back" Event="NewDialog" Value="AdvancedWelcomeEulaDlg" /> |
| 102 | <!-- override default WixAppFolder of WixPerMachineFolder as standard user won't be shown the radio group to set WixAppFolder --> |
| 103 | <Publish Dialog="InstallScopeDlg" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1" Condition="!(wix.WixUISupportPerUser) AND NOT Privileged" /> |
| 104 | <Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="{}" Order="2" Condition="WixAppFolder = "WixPerUserFolder"" /> |
| 105 | <Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="1" Order="3" Condition="WixAppFolder = "WixPerMachineFolder"" /> |
| 106 | <Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Order="4" Condition="WixAppFolder = "WixPerUserFolder"" /> |
| 107 | <Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Order="5" Condition="WixAppFolder = "WixPerMachineFolder"" /> |
| 108 | <Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="6" Condition="WixAppFolder = "WixPerUserFolder"" /> |
| 109 | <Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="7" Condition="WixAppFolder = "WixPerMachineFolder"" /> |
| 110 | |
| 111 | <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg" Condition="!(wix.WixUISupportPerUser)" /> |
| 112 | <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="AdvancedWelcomeEulaDlg" Condition="NOT !(wix.WixUISupportPerUser)" /> |
| 113 | <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="3" /> |
| 114 | <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" /> |
| 115 | <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2" /> |
| 116 | |
| 117 | <Publish Dialog="BrowseDlg" Control="OK" Event="SetTargetPath" Value="[_BrowseProperty]" Order="3" /> |
| 118 | <Publish Dialog="BrowseDlg" Control="OK" Event="EndDialog" Value="Return" Order="4" /> |
| 119 | |
| 120 | <Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg" Condition="NOT Installed AND WixAppFolder = "WixPerUserFolder"" /> |
| 121 | <Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Condition="NOT Installed AND WixAppFolder = "WixPerMachineFolder"" /> |
| 122 | <Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Condition="Installed" /> |
| 123 | |
| 124 | <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg" /> |
| 125 | |
| 126 | <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="FeaturesDlg" /> |
| 127 | <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg" /> |
| 128 | <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" /> |
| 129 | <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" /> |
| 130 | |
| 131 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2" Condition="Installed AND NOT PATCH" /> |
| 132 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3" Condition="Installed AND PATCH" /> |
| 133 | |
| 134 | <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Condition="Installed AND PATCH" /> |
| 135 | </UI> |
| 136 | |
| 137 | <InstallUISequence> |
| 138 | <Show Dialog="override WelcomeDlg" Before="AdvancedWelcomeEulaDlg" Condition="Installed AND PATCH" /> |
| 139 | </InstallUISequence> |
| 140 | |
| 141 | <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" /> |
| 142 | <UIRef Id="WixUI_Common" /> |
| 143 | </Fragment> |
| 144 | </Wix> |