From f8d1a711625599ab94630242976a740a4790915e Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 27 Sep 2024 22:09:24 -0400 Subject: Drop CA path validation in WixUI by default. Add `WixUI/ExtendedPathValidation="yes"` to opt-in. Removed the WIXUI_DONTVALIDATEPATH runtime opt-out. Fixes https://github.com/wixtoolset/issues/issues/8718 Relies on https://github.com/wixtoolset/wix/pull/563 --- .../TestData/InstallDir_NoLicense/Package.wxs | 15 +++---- .../TestData/InstallDir_SpecialDlg/Package.wxs | 11 ++---- .../TestData/WixUI_Advanced/Package.wxs | 4 +- .../TestData/WixUI_InstallDir/Package.wxs | 4 +- .../TestData/WixUI_Mondo/Package.wxs | 6 +-- .../test/WixToolsetTest.UI/UIExtensionFixture.cs | 46 +++++----------------- 6 files changed, 29 insertions(+), 57 deletions(-) (limited to 'src/ext/UI/test') 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 index 86b7453e..0c9fd195 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_NoLicense/Package.wxs +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_NoLicense/Package.wxs @@ -24,8 +24,8 @@ - - + + @@ -50,8 +50,6 @@ - - @@ -59,11 +57,14 @@ - - - + + + + + + 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 index eeb44833..de179240 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_SpecialDlg/Package.wxs +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/InstallDir_SpecialDlg/Package.wxs @@ -42,10 +42,7 @@ - - - - + @@ -70,7 +67,7 @@ - + @@ -85,8 +82,8 @@ - - + + diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs index c22328e6..095a4546 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_Advanced/Package.wxs @@ -1,12 +1,12 @@ - + - + diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs index 68e1177d..8a6556a9 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/WixUI_InstallDir/Package.wxs @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + 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 5bb7fa1a..24f18c1e 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,8 +1,8 @@ - + - + @@ -12,7 +12,7 @@ - + diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index eb5e3687..bb20f087 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs @@ -29,7 +29,6 @@ namespace WixToolsetTest.UI "Binary:WixUI_Bmp_Up\t[Binary data]", "Binary:WixUI_Ico_Exclam\t[Binary data]", "Binary:WixUI_Ico_Info\t[Binary data]", - "Binary:WixUiCa_X86\t[Binary data]", }, results.Where(r => r.StartsWith("Binary:")).ToArray()); WixAssert.CompareLineByLine(new[] { @@ -37,13 +36,8 @@ namespace WixToolsetTest.UI "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t", "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", - "CustomAction:WixUIValidatePath_X86\t65\tWixUiCa_X86\tValidatePath\t", }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); - WixAssert.CompareLineByLine(new[] - { - "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t1", - "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2", - }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); WixAssert.CompareLineByLine(new[] { "InstallUISequence:AdvancedWelcomeEulaDlg\tNOT Installed\t1297", @@ -68,7 +62,6 @@ namespace WixToolsetTest.UI "Binary:WixUI_Bmp_Up\t[Binary data]", "Binary:WixUI_Ico_Exclam\t[Binary data]", "Binary:WixUI_Ico_Info\t[Binary data]", - "Binary:WixUiCa_X64\t[Binary data]", }, results.Where(r => r.StartsWith("Binary:")).ToArray()); WixAssert.CompareLineByLine(new[] { @@ -76,13 +69,8 @@ namespace WixToolsetTest.UI "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t", "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", - "CustomAction:WixUIValidatePath_X64\t65\tWixUiCa_X64\tValidatePath\t", }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); - WixAssert.CompareLineByLine(new[] - { - "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t1", - "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t2", - }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); } [Fact] @@ -102,7 +90,6 @@ namespace WixToolsetTest.UI "Binary:WixUI_Bmp_Up\t[Binary data]", "Binary:WixUI_Ico_Exclam\t[Binary data]", "Binary:WixUI_Ico_Info\t[Binary data]", - "Binary:WixUiCa_A64\t[Binary data]", }, results.Where(r => r.StartsWith("Binary:")).ToArray()); WixAssert.CompareLineByLine(new[] { @@ -110,13 +97,8 @@ namespace WixToolsetTest.UI "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t", "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", - "CustomAction:WixUIValidatePath_A64\t65\tWixUiCa_A64\tValidatePath\t", }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); - WixAssert.CompareLineByLine(new[] - { - "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_A64\tNOT WIXUI_DONTVALIDATEPATH\t1", - "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_A64\tNOT WIXUI_DONTVALIDATEPATH\t2", - }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); } [Fact] @@ -180,8 +162,8 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray()); WixAssert.CompareLineByLine(new[] { - "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t3", - "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2", + "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\t1\t1", + "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\t1\t1", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); WixAssert.CompareLineByLine(new[] { @@ -281,7 +263,7 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); WixAssert.CompareLineByLine(new[] { - "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t3", + "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\t1\t1", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); WixAssert.CompareLineByLine(new[] { @@ -332,8 +314,8 @@ namespace WixToolsetTest.UI }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray()); WixAssert.CompareLineByLine(new[] { - "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t3", - "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2", + "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\t1\t3", + "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\t1\t2", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); Assert.Empty(results.Where(result => result.Contains("LicenseAgreementDlg")).ToArray()); @@ -361,21 +343,13 @@ namespace WixToolsetTest.UI "Binary:WixUI_Bmp_Up\t[Binary data]", "Binary:WixUI_Ico_Exclam\t[Binary data]", "Binary:WixUI_Ico_Info\t[Binary data]", - "Binary:WixUiCa_X64\t[Binary data]", }, results.Where(r => r.StartsWith("Binary:")).ToArray()); - WixAssert.CompareLineByLine(new[] - { - "CustomAction:WixUIValidatePath_X64\t65\tWixUiCa_X64\tValidatePath\t", - }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); + Assert.Empty(results.Where(r => r.StartsWith("CustomAction:")).ToArray()); WixAssert.CompareLineByLine(new[] { "Property:WIXUI_INSTALLDIR\tINSTALLFOLDER", }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray()); - WixAssert.CompareLineByLine(new[] - { - "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t3", - "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t2", - }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); + Assert.Empty(results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); WixAssert.CompareLineByLine(new[] { "InstallUISequence:WelcomeDlg\tNOT Installed OR PATCH\t1297", -- cgit v1.2.3-55-g6feb