diff options
Diffstat (limited to 'src/ext/Util')
| -rw-r--r-- | src/ext/Util/README.md | 4 | ||||
| -rw-r--r-- | src/ext/Util/Util.wixext.sln | 87 | ||||
| -rw-r--r-- | src/ext/Util/Util.wixext.slnx | 22 | ||||
| -rw-r--r-- | src/ext/Util/be/utilsearch.cpp | 6 | ||||
| -rw-r--r-- | src/ext/Util/ca/scaexec.cpp | 22 | ||||
| -rw-r--r-- | src/ext/Util/ca/utilca.vcxproj | 2 | ||||
| -rw-r--r-- | src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | 9 | ||||
| -rw-r--r-- | src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj | 2 | ||||
| -rw-r--r-- | src/ext/Util/util_t.proj | 6 | ||||
| -rw-r--r-- | src/ext/Util/wixext/UtilCompiler.cs | 5 | ||||
| -rw-r--r-- | src/ext/Util/wixext/UtilDecompiler.cs | 6 | ||||
| -rw-r--r-- | src/ext/Util/wixext/UtilWarnings.cs | 6 |
12 files changed, 67 insertions, 110 deletions
diff --git a/src/ext/Util/README.md b/src/ext/Util/README.md index 11d7a363..2bbf17ce 100644 --- a/src/ext/Util/README.md +++ b/src/ext/Util/README.md | |||
| @@ -17,9 +17,9 @@ To pay the Maintenance Fee, [become a Sponsor](https://github.com/sponsors/wixto | |||
| 17 | Add the WiX Extension as a PackageReference to your .wixproj: | 17 | Add the WiX Extension as a PackageReference to your .wixproj: |
| 18 | 18 | ||
| 19 | ``` | 19 | ``` |
| 20 | <Project Sdk="WixToolset.Sdk/6.0.0"> | 20 | <Project Sdk="WixToolset.Sdk/7.0.0"> |
| 21 | <ItemGroup> | 21 | <ItemGroup> |
| 22 | <PackageReference Include="WixToolset.Util.wixext" Version="6.0.0" /> | 22 | <PackageReference Include="WixToolset.Util.wixext" Version="7.0.0" /> |
| 23 | </ItemGroup> | 23 | </ItemGroup> |
| 24 | </Project> | 24 | </Project> |
| 25 | ``` | 25 | ``` |
diff --git a/src/ext/Util/Util.wixext.sln b/src/ext/Util/Util.wixext.sln deleted file mode 100644 index 0168dab9..00000000 --- a/src/ext/Util/Util.wixext.sln +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | | ||
| 2 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| 3 | # Visual Studio Version 17 | ||
| 4 | VisualStudioVersion = 17.1.32228.430 | ||
| 5 | MinimumVisualStudioVersion = 15.0.26124.0 | ||
| 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utilbe", "be\utilbe.vcxproj", "{630C1EE7-2517-4A8C-83E3-DA1150308B58}" | ||
| 7 | EndProject | ||
| 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utilca", "ca\utilca.vcxproj", "{076018F7-19BD-423A-ABBF-229273DA08D8}" | ||
| 9 | EndProject | ||
| 10 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "util", "wixlib\util.wixproj", "{1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}" | ||
| 11 | EndProject | ||
| 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Util.wixext", "wixext\WixToolset.Util.wixext.csproj", "{6CF033EB-0A39-4AC6-9D41-9BD506352045}" | ||
| 13 | EndProject | ||
| 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Util", "test\WixToolsetTest.Util\WixToolsetTest.Util.csproj", "{D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}" | ||
| 15 | EndProject | ||
| 16 | Global | ||
| 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| 18 | Debug|Any CPU = Debug|Any CPU | ||
| 19 | Debug|x64 = Debug|x64 | ||
| 20 | Debug|x86 = Debug|x86 | ||
| 21 | Release|Any CPU = Release|Any CPU | ||
| 22 | Release|x64 = Release|x64 | ||
| 23 | Release|x86 = Release|x86 | ||
| 24 | EndGlobalSection | ||
| 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| 26 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Debug|Any CPU.ActiveCfg = Debug|Win32 | ||
| 27 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Debug|Any CPU.Build.0 = Debug|Win32 | ||
| 28 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Debug|x64.ActiveCfg = Debug|Win32 | ||
| 29 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Debug|x86.ActiveCfg = Debug|Win32 | ||
| 30 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Debug|x86.Build.0 = Debug|Win32 | ||
| 31 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Release|Any CPU.ActiveCfg = Release|Win32 | ||
| 32 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Release|Any CPU.Build.0 = Release|Win32 | ||
| 33 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Release|x64.ActiveCfg = Release|Win32 | ||
| 34 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Release|x86.ActiveCfg = Release|Win32 | ||
| 35 | {630C1EE7-2517-4A8C-83E3-DA1150308B58}.Release|x86.Build.0 = Release|Win32 | ||
| 36 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|Any CPU.ActiveCfg = Debug|Win32 | ||
| 37 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|Any CPU.Build.0 = Debug|Win32 | ||
| 38 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x64.ActiveCfg = Debug|Win32 | ||
| 39 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x86.ActiveCfg = Debug|Win32 | ||
| 40 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Debug|x86.Build.0 = Debug|Win32 | ||
| 41 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|Any CPU.ActiveCfg = Release|Win32 | ||
| 42 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|Any CPU.Build.0 = Release|Win32 | ||
| 43 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x64.ActiveCfg = Release|Win32 | ||
| 44 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x86.ActiveCfg = Release|Win32 | ||
| 45 | {076018F7-19BD-423A-ABBF-229273DA08D8}.Release|x86.Build.0 = Release|Win32 | ||
| 46 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|Any CPU.ActiveCfg = Debug|x86 | ||
| 47 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|Any CPU.Build.0 = Debug|x86 | ||
| 48 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x64.ActiveCfg = Debug|x86 | ||
| 49 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x86.ActiveCfg = Debug|x86 | ||
| 50 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Debug|x86.Build.0 = Debug|x86 | ||
| 51 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|Any CPU.ActiveCfg = Release|x86 | ||
| 52 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|Any CPU.Build.0 = Release|x86 | ||
| 53 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x64.ActiveCfg = Release|x86 | ||
| 54 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x86.ActiveCfg = Release|x86 | ||
| 55 | {1ACFFEFD-505A-41A5-ACBF-A02B7B473AA2}.Release|x86.Build.0 = Release|x86 | ||
| 56 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 57 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 58 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 59 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 60 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| 61 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Debug|x86.Build.0 = Debug|Any CPU | ||
| 62 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 63 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 64 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 65 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x64.Build.0 = Release|Any CPU | ||
| 66 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x86.ActiveCfg = Release|Any CPU | ||
| 67 | {6CF033EB-0A39-4AC6-9D41-9BD506352045}.Release|x86.Build.0 = Release|Any CPU | ||
| 68 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 69 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 70 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 71 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 72 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| 73 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Debug|x86.Build.0 = Debug|Any CPU | ||
| 74 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 75 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 76 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 77 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x64.Build.0 = Release|Any CPU | ||
| 78 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x86.ActiveCfg = Release|Any CPU | ||
| 79 | {D5D34EC4-AF91-4B11-AC0A-FA5242AE924B}.Release|x86.Build.0 = Release|Any CPU | ||
| 80 | EndGlobalSection | ||
| 81 | GlobalSection(SolutionProperties) = preSolution | ||
| 82 | HideSolutionNode = FALSE | ||
| 83 | EndGlobalSection | ||
| 84 | GlobalSection(ExtensibilityGlobals) = postSolution | ||
| 85 | SolutionGuid = {E4566A6B-47D0-4EA0-989A-D763AC39105D} | ||
| 86 | EndGlobalSection | ||
| 87 | EndGlobal | ||
diff --git a/src/ext/Util/Util.wixext.slnx b/src/ext/Util/Util.wixext.slnx new file mode 100644 index 00000000..737fba27 --- /dev/null +++ b/src/ext/Util/Util.wixext.slnx | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | <Solution> | ||
| 2 | <Configurations> | ||
| 3 | <Platform Name="Any CPU" /> | ||
| 4 | <Platform Name="x64" /> | ||
| 5 | <Platform Name="x86" /> | ||
| 6 | </Configurations> | ||
| 7 | <Project Path="be/utilbe.vcxproj" Id="630c1ee7-2517-4a8c-83e3-da1150308b58"> | ||
| 8 | <Platform Project="Win32" /> | ||
| 9 | <Build Solution="*|x64" Project="false" /> | ||
| 10 | </Project> | ||
| 11 | <Project Path="ca/utilca.vcxproj" Id="076018f7-19bd-423a-abbf-229273da08d8"> | ||
| 12 | <Platform Project="Win32" /> | ||
| 13 | <Build Solution="*|x64" Project="false" /> | ||
| 14 | </Project> | ||
| 15 | <Project Path="test/WixToolsetTest.Util/WixToolsetTest.Util.csproj" /> | ||
| 16 | <Project Path="wixext/WixToolset.Util.wixext.csproj" /> | ||
| 17 | <Project Path="wixlib/util.wixproj"> | ||
| 18 | <Platform Project="x86" /> | ||
| 19 | <Build Solution="*|Any CPU" /> | ||
| 20 | <Build Solution="*|x86" /> | ||
| 21 | </Project> | ||
| 22 | </Solution> | ||
diff --git a/src/ext/Util/be/utilsearch.cpp b/src/ext/Util/be/utilsearch.cpp index 59c497e3..a0818963 100644 --- a/src/ext/Util/be/utilsearch.cpp +++ b/src/ext/Util/be/utilsearch.cpp | |||
| @@ -47,7 +47,7 @@ STDMETHODIMP UtilSearchParseFromXml( | |||
| 47 | BextExitOnFailure(hr, "Failed to get @Id."); | 47 | BextExitOnFailure(hr, "Failed to get @Id."); |
| 48 | 48 | ||
| 49 | // Read type specific attributes. | 49 | // Read type specific attributes. |
| 50 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"WixWindowsFeatureSearch", -1)) | 50 | if (CSTR_EQUAL == ::CompareStringOrdinal(bstrNodeName, -1, L"WixWindowsFeatureSearch", -1, FALSE)) |
| 51 | { | 51 | { |
| 52 | pSearch->Type = UTIL_SEARCH_TYPE_WINDOWS_FEATURE_SEARCH; | 52 | pSearch->Type = UTIL_SEARCH_TYPE_WINDOWS_FEATURE_SEARCH; |
| 53 | 53 | ||
| @@ -55,7 +55,7 @@ STDMETHODIMP UtilSearchParseFromXml( | |||
| 55 | hr = XmlGetAttributeEx(pixnNode, L"Type", &scz); | 55 | hr = XmlGetAttributeEx(pixnNode, L"Type", &scz); |
| 56 | BextExitOnFailure(hr, "Failed to get @Type."); | 56 | BextExitOnFailure(hr, "Failed to get @Type."); |
| 57 | 57 | ||
| 58 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"sha2CodeSigning", -1)) | 58 | if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"sha2CodeSigning", -1, FALSE)) |
| 59 | { | 59 | { |
| 60 | pSearch->WindowsFeatureSearch.type = UTIL_WINDOWS_FEATURE_SEARCH_TYPE_SHA2_CODE_SIGNING; | 60 | pSearch->WindowsFeatureSearch.type = UTIL_WINDOWS_FEATURE_SEARCH_TYPE_SHA2_CODE_SIGNING; |
| 61 | } | 61 | } |
| @@ -144,7 +144,7 @@ STDMETHODIMP UtilSearchFindById( | |||
| 144 | { | 144 | { |
| 145 | UTIL_SEARCH* pSearch = &pSearches->rgSearches[i]; | 145 | UTIL_SEARCH* pSearch = &pSearches->rgSearches[i]; |
| 146 | 146 | ||
| 147 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pSearch->sczId, -1, wzId, -1)) | 147 | if (CSTR_EQUAL == ::CompareStringOrdinal(pSearch->sczId, -1, wzId, -1, FALSE)) |
| 148 | { | 148 | { |
| 149 | *ppSearch = pSearch; | 149 | *ppSearch = pSearch; |
| 150 | ExitFunction1(hr = S_OK); | 150 | ExitFunction1(hr = S_OK); |
diff --git a/src/ext/Util/ca/scaexec.cpp b/src/ext/Util/ca/scaexec.cpp index ee3c164f..2baab86e 100644 --- a/src/ext/Util/ca/scaexec.cpp +++ b/src/ext/Util/ca/scaexec.cpp | |||
| @@ -764,6 +764,7 @@ extern "C" UINT __stdcall CreateUser( | |||
| 764 | WCA_CASCRIPT_HANDLE hRollbackScript = NULL; | 764 | WCA_CASCRIPT_HANDLE hRollbackScript = NULL; |
| 765 | int iOriginalAttributes = 0; | 765 | int iOriginalAttributes = 0; |
| 766 | int iRollbackAttributes = 0; | 766 | int iRollbackAttributes = 0; |
| 767 | LPCWSTR wzOriginalComment = NULL; | ||
| 767 | 768 | ||
| 768 | USER_INFO_1 userInfo1; | 769 | USER_INFO_1 userInfo1; |
| 769 | USER_INFO_1* pUserInfo1 = NULL; | 770 | USER_INFO_1* pUserInfo1 = NULL; |
| @@ -885,14 +886,16 @@ extern "C" UINT __stdcall CreateUser( | |||
| 885 | } | 886 | } |
| 886 | } | 887 | } |
| 887 | 888 | ||
| 888 | hr = WcaCaScriptWriteString(hRollbackScript, pUserInfo1->usri1_comment); | 889 | wzOriginalComment = pUserInfo1->usri1_comment; |
| 889 | ExitOnFailure(hr, "Failed to add rollback comment to rollback script."); | 890 | if (!wzOriginalComment || !*wzOriginalComment) |
| 890 | |||
| 891 | if (!pUserInfo1->usri1_comment || !*pUserInfo1->usri1_comment) | ||
| 892 | { | 891 | { |
| 893 | iRollbackAttributes |= SCAU_REMOVE_COMMENT; | 892 | iRollbackAttributes |= SCAU_REMOVE_COMMENT; |
| 893 | wzOriginalComment = L""; | ||
| 894 | } | 894 | } |
| 895 | 895 | ||
| 896 | hr = WcaCaScriptWriteString(hRollbackScript, wzOriginalComment); | ||
| 897 | ExitOnFailure(hr, "Failed to add rollback comment to rollback script."); | ||
| 898 | |||
| 896 | hr = WcaCaScriptWriteNumber(hRollbackScript, iRollbackAttributes); | 899 | hr = WcaCaScriptWriteNumber(hRollbackScript, iRollbackAttributes); |
| 897 | ExitOnFailure(hr, "Failed to add rollback attributes to rollback script."); | 900 | ExitOnFailure(hr, "Failed to add rollback attributes to rollback script."); |
| 898 | 901 | ||
| @@ -1247,6 +1250,7 @@ extern "C" UINT __stdcall CreateGroup( | |||
| 1247 | 1250 | ||
| 1248 | WCA_CASCRIPT_HANDLE hRollbackScript = NULL; | 1251 | WCA_CASCRIPT_HANDLE hRollbackScript = NULL; |
| 1249 | int iRollbackAttributes = 0; | 1252 | int iRollbackAttributes = 0; |
| 1253 | LPCWSTR wzOriginalComment = NULL; | ||
| 1250 | 1254 | ||
| 1251 | DWORD dw; | 1255 | DWORD dw; |
| 1252 | LPWSTR pwzServerName = NULL; | 1256 | LPWSTR pwzServerName = NULL; |
| @@ -1338,14 +1342,16 @@ extern "C" UINT __stdcall CreateGroup( | |||
| 1338 | 1342 | ||
| 1339 | iRollbackAttributes = 0; | 1343 | iRollbackAttributes = 0; |
| 1340 | 1344 | ||
| 1341 | hr = WcaCaScriptWriteString(hRollbackScript, pGroupInfo1->lgrpi1_comment); | 1345 | wzOriginalComment = pGroupInfo1->lgrpi1_comment; |
| 1342 | ExitOnFailure(hr, "Failed to add rollback comment to rollback script."); | 1346 | if (!wzOriginalComment || !*wzOriginalComment) |
| 1343 | |||
| 1344 | if (!pGroupInfo1->lgrpi1_comment || !*pGroupInfo1->lgrpi1_comment) | ||
| 1345 | { | 1347 | { |
| 1346 | iRollbackAttributes |= SCAG_REMOVE_COMMENT; | 1348 | iRollbackAttributes |= SCAG_REMOVE_COMMENT; |
| 1349 | wzOriginalComment = L""; | ||
| 1347 | } | 1350 | } |
| 1348 | 1351 | ||
| 1352 | hr = WcaCaScriptWriteString(hRollbackScript, wzOriginalComment); | ||
| 1353 | ExitOnFailure(hr, "Failed to add rollback comment to rollback script."); | ||
| 1354 | |||
| 1349 | hr = WcaCaScriptWriteNumber(hRollbackScript, iRollbackAttributes); | 1355 | hr = WcaCaScriptWriteNumber(hRollbackScript, iRollbackAttributes); |
| 1350 | ExitOnFailure(hr, "Failed to add rollback attributes to rollback script."); | 1356 | ExitOnFailure(hr, "Failed to add rollback attributes to rollback script."); |
| 1351 | 1357 | ||
diff --git a/src/ext/Util/ca/utilca.vcxproj b/src/ext/Util/ca/utilca.vcxproj index 5dbe2792..e7cbc372 100644 --- a/src/ext/Util/ca/utilca.vcxproj +++ b/src/ext/Util/ca/utilca.vcxproj | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- 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 | <!-- 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. --> |
| 3 | 3 | ||
| 4 | <Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 4 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 5 | <ItemGroup Label="ProjectConfigurations"> | 5 | <ItemGroup Label="ProjectConfigurations"> |
| 6 | <ProjectConfiguration Include="Debug|ARM64"> | 6 | <ProjectConfiguration Include="Debug|ARM64"> |
| 7 | <Configuration>Debug</Configuration> | 7 | <Configuration>Debug</Configuration> |
diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 03d87e4e..b29607c7 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |||
| @@ -1,15 +1,18 @@ | |||
| 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. | 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 | 2 | ||
| 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
| 4 | |||
| 5 | [assembly: Parallelize(Scope = ExecutionScope.MethodLevel)] | ||
| 6 | |||
| 3 | namespace WixToolsetTest.Util | 7 | namespace WixToolsetTest.Util |
| 4 | { | 8 | { |
| 5 | using System; | ||
| 6 | using System.IO; | 9 | using System.IO; |
| 7 | using System.Linq; | 10 | using System.Linq; |
| 8 | using System.Xml; | 11 | using System.Xml; |
| 9 | using System.Xml.Linq; | 12 | using System.Xml.Linq; |
| 10 | using Microsoft.VisualStudio.TestTools.UnitTesting; | 13 | using Microsoft.VisualStudio.TestTools.UnitTesting; |
| 11 | using WixInternal.MSTestSupport; | ||
| 12 | using WixInternal.Core.MSTestPackage; | 14 | using WixInternal.Core.MSTestPackage; |
| 15 | using WixInternal.MSTestSupport; | ||
| 13 | using WixToolset.Util; | 16 | using WixToolset.Util; |
| 14 | 17 | ||
| 15 | [TestClass] | 18 | [TestClass] |
| @@ -374,7 +377,7 @@ namespace WixToolsetTest.Util | |||
| 374 | extractResult.AssertSuccess(); | 377 | extractResult.AssertSuccess(); |
| 375 | 378 | ||
| 376 | var bootstrapperExtensionDatas = extractResult.SelectBootstrapperExtensionDataNodes("/be:BootstrapperExtensionData/be:BootstrapperExtension[@Id='Wix4UtilBootstrapperExtension_X86']"); | 379 | var bootstrapperExtensionDatas = extractResult.SelectBootstrapperExtensionDataNodes("/be:BootstrapperExtensionData/be:BootstrapperExtension[@Id='Wix4UtilBootstrapperExtension_X86']"); |
| 377 | Assert.AreEqual(1, bootstrapperExtensionDatas.Count); | 380 | Assert.HasCount(1, bootstrapperExtensionDatas); |
| 378 | Assert.AreEqual("<BootstrapperExtension Id='Wix4UtilBootstrapperExtension_X86'>" + | 381 | Assert.AreEqual("<BootstrapperExtension Id='Wix4UtilBootstrapperExtension_X86'>" + |
| 379 | "<WixWindowsFeatureSearch Id='DetectSHA2SupportId' Type='sha2CodeSigning' />" + | 382 | "<WixWindowsFeatureSearch Id='DetectSHA2SupportId' Type='sha2CodeSigning' />" + |
| 380 | "</BootstrapperExtension>", bootstrapperExtensionDatas[0].GetTestXml()); | 383 | "</BootstrapperExtension>", bootstrapperExtensionDatas[0].GetTestXml()); |
diff --git a/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj b/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj index 4036c3ab..b5ea9d2e 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj +++ b/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | <Project Sdk="MSTest.Sdk"> | 4 | <Project Sdk="MSTest.Sdk"> |
| 5 | <PropertyGroup> | 5 | <PropertyGroup> |
| 6 | <TargetFramework>net6.0</TargetFramework> | 6 | <TargetFramework>net8.0</TargetFramework> |
| 7 | <IsWixMSTestProject>true</IsWixMSTestProject> | 7 | <IsWixMSTestProject>true</IsWixMSTestProject> |
| 8 | </PropertyGroup> | 8 | </PropertyGroup> |
| 9 | 9 | ||
diff --git a/src/ext/Util/util_t.proj b/src/ext/Util/util_t.proj index 6ec63476..02be4b49 100644 --- a/src/ext/Util/util_t.proj +++ b/src/ext/Util/util_t.proj | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | <Project Sdk="Microsoft.Build.Traversal"> | 4 | <Project Sdk="Microsoft.Build.Traversal"> |
| 5 | <ItemGroup> | 5 | <ItemGroup> |
| 6 | <ProjectReference Include="test\WixToolsetTest.Util\WixToolsetTest.Util.csproj" Targets="Test" /> | 6 | <ProjectReference Include="test\WixToolsetTest.Util\WixToolsetTest.Util.csproj" /> |
| 7 | <ProjectReference Include="wixext\WixToolset.Util.wixext.csproj" Targets="Pack" Properties="NoBuild=true" /> | 7 | <ProjectReference Include="wixext\WixToolset.Util.wixext.csproj" Targets="Pack" Properties="NoBuild=true" /> |
| 8 | </ItemGroup> | 8 | </ItemGroup> |
| 9 | 9 | ||
| @@ -14,4 +14,8 @@ | |||
| 14 | 14 | ||
| 15 | <Delete Files="$(ArtifactsFolder)WixToolset.Util.wixext.*.nupkg" /> | 15 | <Delete Files="$(ArtifactsFolder)WixToolset.Util.wixext.*.nupkg" /> |
| 16 | </Target> | 16 | </Target> |
| 17 | |||
| 18 | <Target Name="WixTest"> | ||
| 19 | <MSBuild Projects="test\WixToolsetTest.Util\WixToolsetTest.Util.csproj" Targets="Test" /> | ||
| 20 | </Target> | ||
| 17 | </Project> | 21 | </Project> |
diff --git a/src/ext/Util/wixext/UtilCompiler.cs b/src/ext/Util/wixext/UtilCompiler.cs index 1ad27322..919cc49b 100644 --- a/src/ext/Util/wixext/UtilCompiler.cs +++ b/src/ext/Util/wixext/UtilCompiler.cs | |||
| @@ -2736,8 +2736,11 @@ namespace WixToolset.Util | |||
| 2736 | case "assignment": | 2736 | case "assignment": |
| 2737 | type = WixProductSearchType.Assignment; | 2737 | type = WixProductSearchType.Assignment; |
| 2738 | break; | 2738 | break; |
| 2739 | case "exists": | ||
| 2740 | type = WixProductSearchType.Exists; | ||
| 2741 | break; | ||
| 2739 | default: | 2742 | default: |
| 2740 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, result, "version", "language", "state", "assignment")); | 2743 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, result, "version", "language", "state", "assignment", "exists")); |
| 2741 | break; | 2744 | break; |
| 2742 | } | 2745 | } |
| 2743 | break; | 2746 | break; |
diff --git a/src/ext/Util/wixext/UtilDecompiler.cs b/src/ext/Util/wixext/UtilDecompiler.cs index cde64f8f..55bb39c9 100644 --- a/src/ext/Util/wixext/UtilDecompiler.cs +++ b/src/ext/Util/wixext/UtilDecompiler.cs | |||
| @@ -292,7 +292,7 @@ namespace WixToolset.Util | |||
| 292 | break; | 292 | break; |
| 293 | 293 | ||
| 294 | default: | 294 | default: |
| 295 | this.Messaging.Write(WarningMessages.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "InstallMode", installMode)); | 295 | this.Messaging.Write(UtilWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "InstallMode", installMode)); |
| 296 | break; | 296 | break; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| @@ -347,7 +347,7 @@ namespace WixToolset.Util | |||
| 347 | break; | 347 | break; |
| 348 | 348 | ||
| 349 | default: | 349 | default: |
| 350 | this.Messaging.Write(WarningMessages.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "Attributes", attributes)); | 350 | this.Messaging.Write(UtilWarnings.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, "Attributes", attributes)); |
| 351 | break; | 351 | break; |
| 352 | } | 352 | } |
| 353 | 353 | ||
| @@ -538,7 +538,7 @@ namespace WixToolset.Util | |||
| 538 | new XAttribute("Name", Path.GetFileNameWithoutExtension(row.FieldAsString(3))), // remove .lnk/.url extension because compiler extension adds it back for us | 538 | new XAttribute("Name", Path.GetFileNameWithoutExtension(row.FieldAsString(3))), // remove .lnk/.url extension because compiler extension adds it back for us |
| 539 | new XAttribute("Type", type), | 539 | new XAttribute("Type", type), |
| 540 | new XAttribute("Target", row.FieldAsString(4)), | 540 | new XAttribute("Target", row.FieldAsString(4)), |
| 541 | new XAttribute("IconFile", row.FieldAsString(6)), | 541 | AttributeIfNotNull("IconFile", row, 6), |
| 542 | NumericAttributeIfNotNull("IconIndex", row, 7) | 542 | NumericAttributeIfNotNull("IconIndex", row, 7) |
| 543 | ); | 543 | ); |
| 544 | 544 | ||
diff --git a/src/ext/Util/wixext/UtilWarnings.cs b/src/ext/Util/wixext/UtilWarnings.cs index b65abe45..d0d22647 100644 --- a/src/ext/Util/wixext/UtilWarnings.cs +++ b/src/ext/Util/wixext/UtilWarnings.cs | |||
| @@ -18,6 +18,11 @@ namespace WixToolset.Util | |||
| 18 | return Message(sourceLineNumbers, Ids.RequiredAttributeForWindowsXP, "The {0}/@{1} attribute must be specified to successfully install on Windows XP. You can ignore this warning if this installation does not install on Windows XP.", elementName, attributeName); | 18 | return Message(sourceLineNumbers, Ids.RequiredAttributeForWindowsXP, "The {0}/@{1} attribute must be specified to successfully install on Windows XP. You can ignore this warning if this installation does not install on Windows XP.", elementName, attributeName); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | public static Message UnrepresentableColumnValue(SourceLineNumber sourceLineNumbers, string tableName, string columnName, object value) | ||
| 22 | { | ||
| 23 | return Message(sourceLineNumbers, Ids.UnrepresentableColumnValue, "The {0}.{1} column's value, '{2}', cannot currently be represented in the WiX schema.", tableName, columnName, value); | ||
| 24 | } | ||
| 25 | |||
| 21 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) | 26 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
| 22 | { | 27 | { |
| 23 | return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); | 28 | return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); |
| @@ -30,6 +35,7 @@ namespace WixToolset.Util | |||
| 30 | 35 | ||
| 31 | public enum Ids | 36 | public enum Ids |
| 32 | { | 37 | { |
| 38 | UnrepresentableColumnValue = 1064, | ||
| 33 | DeprecatedPerfCounterElement = 5153, | 39 | DeprecatedPerfCounterElement = 5153, |
| 34 | RequiredAttributeForWindowsXP = 5154, | 40 | RequiredAttributeForWindowsXP = 5154, |
| 35 | } | 41 | } |
