From 21a0685ef69e9d634600622b19ea970c6f58ef03 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 6 Oct 2022 16:37:14 -0500 Subject: Add Netfx bundle extension and netfx:DotNetCoreSearch. Remove built-in .NET Core packages since they update too quickly. Fixes 6257 --- src/ext/Util/be/UtilBundleExtension.cpp | 12 ++++++------ src/ext/Util/be/beDecor.h | 13 ------------- src/ext/Util/be/detectsha2support.cpp | 8 ++++---- src/ext/Util/be/precomp.h | 2 +- src/ext/Util/be/utilbe.vcxproj | 1 - src/ext/Util/be/utilsearch.cpp | 20 +++++++++----------- src/ext/Util/wixext/Symbols/UtilSymbolDefinitions.cs | 2 -- 7 files changed, 20 insertions(+), 38 deletions(-) delete mode 100644 src/ext/Util/be/beDecor.h (limited to 'src/ext/Util') diff --git a/src/ext/Util/be/UtilBundleExtension.cpp b/src/ext/Util/be/UtilBundleExtension.cpp index 110599fa..23f5d94f 100644 --- a/src/ext/Util/be/UtilBundleExtension.cpp +++ b/src/ext/Util/be/UtilBundleExtension.cpp @@ -28,16 +28,16 @@ public: //CBextBaseBundleExtension IXMLDOMNode* pixnBundleExtension = NULL; hr = __super::Initialize(pCreateArgs); - ExitOnFailure(hr, "CBextBaseBundleExtension initialization failed."); + BextExitOnFailure(hr, "CBextBaseBundleExtension initialization failed."); hr = XmlLoadDocumentFromFile(m_sczBundleExtensionDataPath, &pixdManifest); - ExitOnFailure(hr, "Failed to load bundle extension manifest from path: %ls", m_sczBundleExtensionDataPath); + BextExitOnFailure(hr, "Failed to load bundle extension manifest from path: %ls", m_sczBundleExtensionDataPath); hr = BextGetBundleExtensionDataNode(pixdManifest, UTIL_BUNDLE_EXTENSION_ID, &pixnBundleExtension); - ExitOnFailure(hr, "Failed to get BundleExtension '%ls'", UTIL_BUNDLE_EXTENSION_ID); + BextExitOnFailure(hr, "Failed to get BundleExtension '%ls'", UTIL_BUNDLE_EXTENSION_ID); hr = UtilSearchParseFromXml(&m_searches, pixnBundleExtension); - ExitOnFailure(hr, "Failed to parse searches from bundle extension manifest."); + BextExitOnFailure(hr, "Failed to parse searches from bundle extension manifest."); LExit: ReleaseObject(pixnBundleExtension); @@ -73,10 +73,10 @@ HRESULT UtilBundleExtensionCreate( CWixUtilBundleExtension* pExtension = NULL; pExtension = new CWixUtilBundleExtension(pEngine); - ExitOnNull(pExtension, hr, E_OUTOFMEMORY, "Failed to create new CWixUtilBundleExtension."); + BextExitOnNull(pExtension, hr, E_OUTOFMEMORY, "Failed to create new CWixUtilBundleExtension."); hr = pExtension->Initialize(pArgs); - ExitOnFailure(hr, "CWixUtilBundleExtension initialization failed."); + BextExitOnFailure(hr, "CWixUtilBundleExtension initialization failed."); *ppBundleExtension = pExtension; pExtension = NULL; diff --git a/src/ext/Util/be/beDecor.h b/src/ext/Util/be/beDecor.h deleted file mode 100644 index 2c6a8818..00000000 --- a/src/ext/Util/be/beDecor.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once -// 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. - - -#if defined(_M_ARM64) -#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_A64" -#elif defined(_M_AMD64) -#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_X64" -#elif defined(_M_ARM) -#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_ARM" -#else -#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_X86" -#endif diff --git a/src/ext/Util/be/detectsha2support.cpp b/src/ext/Util/be/detectsha2support.cpp index 90e349cd..4abfc63c 100644 --- a/src/ext/Util/be/detectsha2support.cpp +++ b/src/ext/Util/be/detectsha2support.cpp @@ -13,7 +13,7 @@ HRESULT DetectSHA2CodeSigning( DWORD er = ERROR_SUCCESS; hr = LoadSystemLibrary(L"wintrust.dll", &hModule); - ExitOnFailure(hr, "Failed to load wintrust.dll"); + BextExitOnFailure(hr, "Failed to load wintrust.dll"); pfn = ::GetProcAddress(hModule, "CryptCATAdminAcquireContext2"); if (pfn) @@ -30,7 +30,7 @@ HRESULT DetectSHA2CodeSigning( } hr = HRESULT_FROM_WIN32(er); - ExitOnFailure(hr, "Failed to probe for CryptCATAdminAcquireContext2 in wintrust.dll"); + BextExitOnFailure(hr, "Failed to probe for CryptCATAdminAcquireContext2 in wintrust.dll"); LExit: ::FreeLibrary(hModule); @@ -48,10 +48,10 @@ HRESULT UtilPerformDetectSHA2CodeSigning( BOOL fSupported = FALSE; hr = DetectSHA2CodeSigning(&fSupported); - ExitOnFailure(hr, "DetectSHA2CodeSigning failed."); + BextExitOnFailure(hr, "DetectSHA2CodeSigning failed."); hr = pEngine->SetVariableNumeric(wzVariable, fSupported ? 1 : 0); - ExitOnFailure(hr, "Failed to set variable '%ls'", wzVariable); + BextExitOnFailure(hr, "Failed to set variable '%ls'", wzVariable); LExit: return hr; diff --git a/src/ext/Util/be/precomp.h b/src/ext/Util/be/precomp.h index bb36b3f3..5ce5744f 100644 --- a/src/ext/Util/be/precomp.h +++ b/src/ext/Util/be/precomp.h @@ -31,7 +31,7 @@ #include #include -#include "beDecor.h" +#include "..\..\beDecor.h" #include "utilsearch.h" #include "detectsha2support.h" #include "UtilBundleExtension.h" diff --git a/src/ext/Util/be/utilbe.vcxproj b/src/ext/Util/be/utilbe.vcxproj index 4e4f80d9..fa39dcf3 100644 --- a/src/ext/Util/be/utilbe.vcxproj +++ b/src/ext/Util/be/utilbe.vcxproj @@ -56,7 +56,6 @@ - diff --git a/src/ext/Util/be/utilsearch.cpp b/src/ext/Util/be/utilsearch.cpp index 7cd2ea09..20a514d8 100644 --- a/src/ext/Util/be/utilsearch.cpp +++ b/src/ext/Util/be/utilsearch.cpp @@ -17,11 +17,11 @@ STDMETHODIMP UtilSearchParseFromXml( // Select Util search nodes. hr = XmlSelectNodes(pixnBundleExtension, L"WixWindowsFeatureSearch", &pixnNodes); - ExitOnFailure(hr, "Failed to select Util search nodes."); + BextExitOnFailure(hr, "Failed to select Util search nodes."); // Get Util search node count. hr = pixnNodes->get_length((long*)&cNodes); - ExitOnFailure(hr, "Failed to get Util search node count."); + BextExitOnFailure(hr, "Failed to get Util search node count."); if (!cNodes) { @@ -30,7 +30,7 @@ STDMETHODIMP UtilSearchParseFromXml( // Allocate memory for searches. pSearches->rgSearches = (UTIL_SEARCH*)MemAlloc(sizeof(UTIL_SEARCH) * cNodes, TRUE); - ExitOnNull(pSearches->rgSearches, hr, E_OUTOFMEMORY, "Failed to allocate memory for search structs."); + BextExitOnNull(pSearches->rgSearches, hr, E_OUTOFMEMORY, "Failed to allocate memory for search structs."); pSearches->cSearches = cNodes; @@ -40,11 +40,11 @@ STDMETHODIMP UtilSearchParseFromXml( UTIL_SEARCH* pSearch = &pSearches->rgSearches[i]; hr = XmlNextElement(pixnNodes, &pixnNode, &bstrNodeName); - ExitOnFailure(hr, "Failed to get next node."); + BextExitOnFailure(hr, "Failed to get next node."); // @Id hr = XmlGetAttributeEx(pixnNode, L"Id", &pSearch->sczId); - ExitOnFailure(hr, "Failed to get @Id."); + BextExitOnFailure(hr, "Failed to get @Id."); // Read type specific attributes. if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"WixWindowsFeatureSearch", -1)) @@ -53,7 +53,7 @@ STDMETHODIMP UtilSearchParseFromXml( // @Type hr = XmlGetAttributeEx(pixnNode, L"Type", &scz); - ExitOnFailure(hr, "Failed to get @Type."); + BextExitOnFailure(hr, "Failed to get @Type."); if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"sha2CodeSigning", -1)) { @@ -61,14 +61,12 @@ STDMETHODIMP UtilSearchParseFromXml( } else { - hr = E_INVALIDARG; - ExitOnFailure(hr, "Invalid value for @Type: %ls", scz); + BextExitWithRootFailure(hr, E_INVALIDARG, "Invalid value for @Type: %ls", scz); } } else { - hr = E_UNEXPECTED; - ExitOnFailure(hr, "Unexpected element name: %ls", bstrNodeName); + BextExitWithRootFailure(hr, E_UNEXPECTED, "Unexpected element name: %ls", bstrNodeName); } // prepare next iteration @@ -112,7 +110,7 @@ STDMETHODIMP UtilSearchExecute( UTIL_SEARCH* pSearch = NULL; hr = UtilSearchFindById(pSearches, wzSearchId, &pSearch); - ExitOnFailure(hr, "Search id '%ls' is unknown to the util extension."); + BextExitOnFailure(hr, "Search id '%ls' is unknown to the util extension.", wzSearchId); switch (pSearch->Type) { diff --git a/src/ext/Util/wixext/Symbols/UtilSymbolDefinitions.cs b/src/ext/Util/wixext/Symbols/UtilSymbolDefinitions.cs index 72091c3b..3b357a96 100644 --- a/src/ext/Util/wixext/Symbols/UtilSymbolDefinitions.cs +++ b/src/ext/Util/wixext/Symbols/UtilSymbolDefinitions.cs @@ -33,8 +33,6 @@ namespace WixToolset.Util public static partial class UtilSymbolDefinitions { - public static readonly Version Version = new Version("4.0.0"); - public static IntermediateSymbolDefinition ByName(string name) { if (!Enum.TryParse(name, out UtilSymbolDefinitionType type)) -- cgit v1.2.3-55-g6feb