diff options
| author | Bob Arnson <bob@firegiant.com> | 2023-03-13 21:20:09 -0400 |
|---|---|---|
| committer | Bob Arnson <github@bobs.org> | 2023-03-13 22:40:22 -0400 |
| commit | 68ea7b2f8dccb48d69e8aeb960ce8cb29790e8c4 (patch) | |
| tree | 34566b7cc1eb6f99cbdf796227729d9bfd3e3eac /src | |
| parent | 0d3150d3671e2441661593ffb0fb402f484f7ff6 (diff) | |
| download | wix-68ea7b2f8dccb48d69e8aeb960ce8cb29790e8c4.tar.gz wix-68ea7b2f8dccb48d69e8aeb960ce8cb29790e8c4.tar.bz2 wix-68ea7b2f8dccb48d69e8aeb960ce8cb29790e8c4.zip | |
Add tests for custom WixUI sets.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_NoLicense/Package.wxs | 82 | ||||
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_SpecialDlg/Package.wxs | 106 | ||||
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs | 11 | ||||
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs | 3 | ||||
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIBannerBmp.png | bin | 0 -> 1203 bytes | |||
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIDialogBmp.png | bin | 0 -> 5045 bytes | |||
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/data/bpl.rtf | bin | 0 -> 279 bytes | |||
| -rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs | 87 |
8 files changed, 285 insertions, 4 deletions
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_NoLicense/Package.wxs b/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_NoLicense/Package.wxs new file mode 100644 index 00000000..86b7453e --- /dev/null +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_NoLicense/Package.wxs | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> | ||
| 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> | ||
| 3 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
| 4 | |||
| 5 | <Feature Id="ProductFeature" Title="MsiPackage"> | ||
| 6 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 7 | </Feature> | ||
| 8 | |||
| 9 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 10 | <Component> | ||
| 11 | <File Source="example.txt" /> | ||
| 12 | </Component> | ||
| 13 | </ComponentGroup> | ||
| 14 | |||
| 15 | <ui:WixUI Id="InstallDir_NoLicense" InstallDirectory="INSTALLFOLDER" /> | ||
| 16 | </Package> | ||
| 17 | |||
| 18 | <Fragment> | ||
| 19 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 20 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 21 | </StandardDirectory> | ||
| 22 | </Fragment> | ||
| 23 | |||
| 24 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
| 25 | <Fragment> | ||
| 26 | <UI Id="InstallDir_NoLicense_$(WIXUIARCH)"> | ||
| 27 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
| 28 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
| 29 | </UI> | ||
| 30 | |||
| 31 | <UIRef Id="InstallDir_NoLicense" /> | ||
| 32 | </Fragment> | ||
| 33 | <?endforeach?> | ||
| 34 | |||
| 35 | <Fragment> | ||
| 36 | <UI Id="file InstallDir_NoLicense"> | ||
| 37 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> | ||
| 38 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> | ||
| 39 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> | ||
| 40 | |||
| 41 | <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> | ||
| 42 | |||
| 43 | <DialogRef Id="BrowseDlg" /> | ||
| 44 | <DialogRef Id="DiskCostDlg" /> | ||
| 45 | <DialogRef Id="ErrorDlg" /> | ||
| 46 | <DialogRef Id="FatalError" /> | ||
| 47 | <DialogRef Id="FilesInUse" /> | ||
| 48 | <DialogRef Id="MsiRMFilesInUse" /> | ||
| 49 | <DialogRef Id="PrepareDlg" /> | ||
| 50 | <DialogRef Id="ProgressDlg" /> | ||
| 51 | <DialogRef Id="ResumeDlg" /> | ||
| 52 | <DialogRef Id="UserExit" /> | ||
| 53 | |||
| 54 | <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" /> | ||
| 55 | |||
| 56 | <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999" /> | ||
| 57 | |||
| 58 | <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Condition="NOT Installed" /> | ||
| 59 | <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Condition="Installed AND PATCH" /> | ||
| 60 | |||
| 61 | <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" /> | ||
| 62 | <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" /> | ||
| 63 | <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" /> | ||
| 64 | <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4" Condition="WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"" /> | ||
| 65 | <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" /> | ||
| 66 | <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2" /> | ||
| 67 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1" Condition="NOT Installed" /> | ||
| 68 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2" Condition="Installed AND NOT PATCH" /> | ||
| 69 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" Condition="Installed AND PATCH" /> | ||
| 70 | |||
| 71 | <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg" /> | ||
| 72 | |||
| 73 | <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg" /> | ||
| 74 | <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" /> | ||
| 75 | <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" /> | ||
| 76 | |||
| 77 | <Property Id="ARPNOMODIFY" Value="1" /> | ||
| 78 | </UI> | ||
| 79 | |||
| 80 | <UIRef Id="WixUI_Common" /> | ||
| 81 | </Fragment> | ||
| 82 | </Wix> | ||
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_SpecialDlg/Package.wxs b/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_SpecialDlg/Package.wxs new file mode 100644 index 00000000..35879fb3 --- /dev/null +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_SpecialDlg/Package.wxs | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> | ||
| 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 3 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
| 4 | |||
| 5 | <Feature Id="ProductFeature" Title="MsiPackage"> | ||
| 6 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 7 | </Feature> | ||
| 8 | |||
| 9 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 10 | <Component> | ||
| 11 | <File Source="example.txt" /> | ||
| 12 | </Component> | ||
| 13 | </ComponentGroup> | ||
| 14 | |||
| 15 | <ui:WixUI Id="InstallDir_SpecialDlg" InstallDirectory="INSTALLFOLDER" /> | ||
| 16 | </Package> | ||
| 17 | |||
| 18 | <Fragment> | ||
| 19 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 20 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 21 | </StandardDirectory> | ||
| 22 | </Fragment> | ||
| 23 | |||
| 24 | <Fragment> | ||
| 25 | <UI> | ||
| 26 | <Dialog Id="SpecialDlg" Width="370" Height="270" Title="My Special Dialog"> | ||
| 27 | <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" /> | ||
| 28 | <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="!(loc.WixUINext)" /> | ||
| 29 | <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"> | ||
| 30 | <Publish Event="SpawnDialog" Value="CancelDlg" /> | ||
| 31 | </Control> | ||
| 32 | <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" /> | ||
| 33 | <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /> | ||
| 34 | <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> | ||
| 35 | <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="My Special Dialog" /> | ||
| 36 | <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="A dialog where special stuff happens" /> | ||
| 37 | </Dialog> | ||
| 38 | </UI> | ||
| 39 | </Fragment> | ||
| 40 | |||
| 41 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
| 42 | <Fragment> | ||
| 43 | <UI Id="InstallDir_SpecialDlg_$(WIXUIARCH)"> | ||
| 44 | <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
| 45 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
| 46 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
| 47 | </UI> | ||
| 48 | |||
| 49 | <UIRef Id="InstallDir_SpecialDlg" /> | ||
| 50 | </Fragment> | ||
| 51 | <?endforeach?> | ||
| 52 | |||
| 53 | <Fragment> | ||
| 54 | <UI Id="file InstallDir_SpecialDlg"> | ||
| 55 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> | ||
| 56 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> | ||
| 57 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> | ||
| 58 | |||
| 59 | <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> | ||
| 60 | |||
| 61 | <DialogRef Id="BrowseDlg" /> | ||
| 62 | <DialogRef Id="DiskCostDlg" /> | ||
| 63 | <DialogRef Id="ErrorDlg" /> | ||
| 64 | <DialogRef Id="FatalError" /> | ||
| 65 | <DialogRef Id="FilesInUse" /> | ||
| 66 | <DialogRef Id="MsiRMFilesInUse" /> | ||
| 67 | <DialogRef Id="PrepareDlg" /> | ||
| 68 | <DialogRef Id="ProgressDlg" /> | ||
| 69 | <DialogRef Id="ResumeDlg" /> | ||
| 70 | <DialogRef Id="UserExit" /> | ||
| 71 | |||
| 72 | <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" /> | ||
| 73 | |||
| 74 | <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999" /> | ||
| 75 | |||
| 76 | <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="SpecialDlg" /> | ||
| 77 | <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Condition="Installed AND PATCH" /> | ||
| 78 | |||
| 79 | <Publish Dialog="SpecialDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" /> | ||
| 80 | <Publish Dialog="SpecialDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg" /> | ||
| 81 | |||
| 82 | <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="SpecialDlg" /> | ||
| 83 | <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Condition="LicenseAccepted = "1"" /> | ||
| 84 | |||
| 85 | <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" /> | ||
| 86 | <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" /> | ||
| 87 | <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" /> | ||
| 88 | <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4" Condition="WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"" /> | ||
| 89 | <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" /> | ||
| 90 | <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2" /> | ||
| 91 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1" Condition="NOT Installed" /> | ||
| 92 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2" Condition="Installed AND NOT PATCH" /> | ||
| 93 | <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" Condition="Installed AND PATCH" /> | ||
| 94 | |||
| 95 | <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg" /> | ||
| 96 | |||
| 97 | <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg" /> | ||
| 98 | <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" /> | ||
| 99 | <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" /> | ||
| 100 | |||
| 101 | <Property Id="ARPNOMODIFY" Value="1" /> | ||
| 102 | </UI> | ||
| 103 | |||
| 104 | <UIRef Id="WixUI_Common" /> | ||
| 105 | </Fragment> | ||
| 106 | </Wix> | ||
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs index 7c4db223..aeb9b322 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_FeatureTree/Package.wxs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> |
| 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> | 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> |
| 3 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | 3 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> |
| 4 | 4 | ||
| @@ -13,6 +13,15 @@ | |||
| 13 | </ComponentGroup> | 13 | </ComponentGroup> |
| 14 | 14 | ||
| 15 | <ui:WixUI Id="WixUI_FeatureTree" /> | 15 | <ui:WixUI Id="WixUI_FeatureTree" /> |
| 16 | <WixVariable Id="WixUIDialogBmp" Value="WixUIDialogBmp.png" /> | ||
| 17 | <WixVariable Id="WixUIBannerBmp" Value="WixUIBannerBmp.png" /> | ||
| 18 | |||
| 19 | <SetProperty | ||
| 20 | Id="WIXUI_EXITDIALOGOPTIONALTEXT" | ||
| 21 | Value="Thank you for installing [ProductName]." | ||
| 22 | After="FindRelatedProducts" | ||
| 23 | Sequence="ui" | ||
| 24 | /> | ||
| 16 | </Package> | 25 | </Package> |
| 17 | 26 | ||
| 18 | <Fragment> | 27 | <Fragment> |
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs index 9eca9790..5bb7fa1a 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Mondo/Package.wxs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> |
| 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> | 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> |
| 3 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | 3 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> |
| 4 | 4 | ||
| @@ -13,6 +13,7 @@ | |||
| 13 | </ComponentGroup> | 13 | </ComponentGroup> |
| 14 | 14 | ||
| 15 | <ui:WixUI Id="WixUI_Mondo" /> | 15 | <ui:WixUI Id="WixUI_Mondo" /> |
| 16 | <WixVariable Id="WixUILicenseRtf" Value="bpl.rtf" /> | ||
| 16 | </Package> | 17 | </Package> |
| 17 | 18 | ||
| 18 | <Fragment> | 19 | <Fragment> |
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIBannerBmp.png b/src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIBannerBmp.png new file mode 100644 index 00000000..40473017 --- /dev/null +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIBannerBmp.png | |||
| Binary files differ | |||
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIDialogBmp.png b/src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIDialogBmp.png new file mode 100644 index 00000000..8a37f64c --- /dev/null +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/data/WixUIDialogBmp.png | |||
| Binary files differ | |||
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/data/bpl.rtf b/src/ext/UI/test/WixToolsetTest.UI/TestData/data/bpl.rtf new file mode 100644 index 00000000..b215a391 --- /dev/null +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/data/bpl.rtf | |||
| Binary files differ | |||
diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index 7f9b7313..17eec347 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs | |||
| @@ -143,6 +143,7 @@ namespace WixToolsetTest.UI | |||
| 143 | }, results.Where(r => r.StartsWith("Binary:")).ToArray()); | 143 | }, results.Where(r => r.StartsWith("Binary:")).ToArray()); |
| 144 | WixAssert.CompareLineByLine(new[] | 144 | WixAssert.CompareLineByLine(new[] |
| 145 | { | 145 | { |
| 146 | "CustomAction:SetWIXUI_EXITDIALOGOPTIONALTEXT\t51\tWIXUI_EXITDIALOGOPTIONALTEXT\tThank you for installing [ProductName].\t", | ||
| 146 | "CustomAction:WixUIPrintEula_X64\t65\tWixUiCa_X64\tPrintEula\t", | 147 | "CustomAction:WixUIPrintEula_X64\t65\tWixUiCa_X64\tPrintEula\t", |
| 147 | }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); | 148 | }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); |
| 148 | WixAssert.CompareLineByLine(new[] | 149 | WixAssert.CompareLineByLine(new[] |
| @@ -152,13 +153,13 @@ namespace WixToolsetTest.UI | |||
| 152 | } | 153 | } |
| 153 | 154 | ||
| 154 | [Fact] | 155 | [Fact] |
| 155 | public void CanBuildUsingWixUIInstallDir() | 156 | public void CanBuildUsingWixUIInstallDirWithCustomizedEula() |
| 156 | { | 157 | { |
| 157 | var folder = TestData.Get(@"TestData", "WixUI_InstallDir"); | 158 | var folder = TestData.Get(@"TestData", "WixUI_InstallDir"); |
| 158 | var bindFolder = TestData.Get(@"TestData", "data"); | 159 | var bindFolder = TestData.Get(@"TestData", "data"); |
| 159 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 160 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
| 160 | 161 | ||
| 161 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent"); | 162 | var results = build.BuildAndQuery(BuildEula, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent"); |
| 162 | Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); | 163 | Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); |
| 163 | WixAssert.CompareLineByLine(new[] | 164 | WixAssert.CompareLineByLine(new[] |
| 164 | { | 165 | { |
| @@ -303,6 +304,82 @@ namespace WixToolsetTest.UI | |||
| 303 | } | 304 | } |
| 304 | 305 | ||
| 305 | [Fact] | 306 | [Fact] |
| 307 | public void CanBuildUsingWithInstallDirAndRemovedDialog() | ||
| 308 | { | ||
| 309 | var folder = TestData.Get(@"TestData", "InstallDir_NoLicense"); | ||
| 310 | var bindFolder = TestData.Get(@"TestData", "data"); | ||
| 311 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | ||
| 312 | |||
| 313 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent"); | ||
| 314 | Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); | ||
| 315 | WixAssert.CompareLineByLine(new[] | ||
| 316 | { | ||
| 317 | "Binary:WixUI_Bmp_Banner\t[Binary data]", | ||
| 318 | "Binary:WixUI_Bmp_Dialog\t[Binary data]", | ||
| 319 | "Binary:WixUI_Bmp_New\t[Binary data]", | ||
| 320 | "Binary:WixUI_Bmp_Up\t[Binary data]", | ||
| 321 | "Binary:WixUI_Ico_Exclam\t[Binary data]", | ||
| 322 | "Binary:WixUI_Ico_Info\t[Binary data]", | ||
| 323 | "Binary:WixUiCa_X86\t[Binary data]", | ||
| 324 | }, results.Where(r => r.StartsWith("Binary:")).ToArray()); | ||
| 325 | WixAssert.CompareLineByLine(new[] | ||
| 326 | { | ||
| 327 | "CustomAction:WixUIValidatePath_X86\t65\tWixUiCa_X86\tValidatePath\t", | ||
| 328 | }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); | ||
| 329 | WixAssert.CompareLineByLine(new[] | ||
| 330 | { | ||
| 331 | "Property:WIXUI_INSTALLDIR\tINSTALLFOLDER", | ||
| 332 | }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray()); | ||
| 333 | WixAssert.CompareLineByLine(new[] | ||
| 334 | { | ||
| 335 | "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t3", | ||
| 336 | "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2", | ||
| 337 | }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); | ||
| 338 | |||
| 339 | Assert.Empty(results.Where(result => result.Contains("LicenseAgreementDlg")).ToArray()); | ||
| 340 | } | ||
| 341 | |||
| 342 | [Fact] | ||
| 343 | public void CanBuildUsingWithInstallDirAndAddedDialog() | ||
| 344 | { | ||
| 345 | var folder = TestData.Get(@"TestData", "InstallDir_SpecialDlg"); | ||
| 346 | var bindFolder = TestData.Get(@"TestData", "data"); | ||
| 347 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | ||
| 348 | |||
| 349 | var results = build.BuildAndQuery(BuildX64, "Binary", "Control", "Dialog", "CustomAction", "Property", "ControlEvent"); | ||
| 350 | Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); | ||
| 351 | WixAssert.CompareLineByLine(new[] | ||
| 352 | { | ||
| 353 | "Binary:WixUI_Bmp_Banner\t[Binary data]", | ||
| 354 | "Binary:WixUI_Bmp_Dialog\t[Binary data]", | ||
| 355 | "Binary:WixUI_Bmp_New\t[Binary data]", | ||
| 356 | "Binary:WixUI_Bmp_Up\t[Binary data]", | ||
| 357 | "Binary:WixUI_Ico_Exclam\t[Binary data]", | ||
| 358 | "Binary:WixUI_Ico_Info\t[Binary data]", | ||
| 359 | "Binary:WixUiCa_X64\t[Binary data]", | ||
| 360 | }, results.Where(r => r.StartsWith("Binary:")).ToArray()); | ||
| 361 | WixAssert.CompareLineByLine(new[] | ||
| 362 | { | ||
| 363 | "CustomAction:WixUIPrintEula_X64\t65\tWixUiCa_X64\tPrintEula\t", | ||
| 364 | "CustomAction:WixUIValidatePath_X64\t65\tWixUiCa_X64\tValidatePath\t", | ||
| 365 | }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); | ||
| 366 | WixAssert.CompareLineByLine(new[] | ||
| 367 | { | ||
| 368 | "Property:WIXUI_INSTALLDIR\tINSTALLFOLDER", | ||
| 369 | }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray()); | ||
| 370 | WixAssert.CompareLineByLine(new[] | ||
| 371 | { | ||
| 372 | "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t3", | ||
| 373 | "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t2", | ||
| 374 | "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X64\t1\t1", | ||
| 375 | }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); | ||
| 376 | |||
| 377 | Assert.Equal(8, results.Where(result => result.StartsWith("Control:") && result.Contains("SpecialDlg")).Count()); | ||
| 378 | Assert.Equal(5, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("SpecialDlg")).Count()); | ||
| 379 | Assert.Single(results.Where(result => result.StartsWith("Dialog:") && result.Contains("SpecialDlg"))); | ||
| 380 | } | ||
| 381 | |||
| 382 | [Fact] | ||
| 306 | public void CannotBuildWithV3LikeUIRef() | 383 | public void CannotBuildWithV3LikeUIRef() |
| 307 | { | 384 | { |
| 308 | var folder = TestData.Get(@"TestData", "InvalidUIRef"); | 385 | var folder = TestData.Get(@"TestData", "InvalidUIRef"); |
| @@ -345,6 +422,12 @@ namespace WixToolsetTest.UI | |||
| 345 | .AssertSuccess(); | 422 | .AssertSuccess(); |
| 346 | } | 423 | } |
| 347 | 424 | ||
| 425 | private static void BuildEula(string[] args) | ||
| 426 | { | ||
| 427 | var result = WixRunner.Execute(args.Concat(new[] { "-bv", "WixUILicenseRtf=bpl.rtf" }).ToArray()) | ||
| 428 | .AssertSuccess(); | ||
| 429 | } | ||
| 430 | |||
| 348 | private static void BuildInGerman(string[] args) | 431 | private static void BuildInGerman(string[] args) |
| 349 | { | 432 | { |
| 350 | var localizedArgs = args.Append("-culture").Append("de-DE").ToArray(); | 433 | var localizedArgs = args.Append("-culture").Append("de-DE").ToArray(); |
