aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Util/be
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/Util/be')
-rw-r--r--src/ext/Util/be/UtilBootstrapperExtension.cpp87
-rw-r--r--src/ext/Util/be/UtilBootstrapperExtension.h16
-rw-r--r--src/ext/Util/be/UtilBundleExtension.cpp87
-rw-r--r--src/ext/Util/be/UtilBundleExtension.h16
-rw-r--r--src/ext/Util/be/detectsha2support.cpp2
-rw-r--r--src/ext/Util/be/detectsha2support.h4
-rw-r--r--src/ext/Util/be/precomp.h4
-rw-r--r--src/ext/Util/be/utilbe.cpp26
-rw-r--r--src/ext/Util/be/utilbe.def4
-rw-r--r--src/ext/Util/be/utilbe.vcxproj8
-rw-r--r--src/ext/Util/be/utilsearch.cpp6
-rw-r--r--src/ext/Util/be/utilsearch.h4
12 files changed, 132 insertions, 132 deletions
diff --git a/src/ext/Util/be/UtilBootstrapperExtension.cpp b/src/ext/Util/be/UtilBootstrapperExtension.cpp
new file mode 100644
index 00000000..4d4d89c7
--- /dev/null
+++ b/src/ext/Util/be/UtilBootstrapperExtension.cpp
@@ -0,0 +1,87 @@
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#include "precomp.h"
4#include "BextBaseBootstrapperExtension.h"
5
6class CWixUtilBootstrapperExtension : public CBextBaseBootstrapperExtension
7{
8public: // IBootstrapperExtension
9 virtual STDMETHODIMP Search(
10 __in LPCWSTR wzId,
11 __in LPCWSTR wzVariable
12 )
13 {
14 HRESULT hr = S_OK;
15
16 hr = UtilSearchExecute(&m_searches, wzId, wzVariable, m_pEngine);
17
18 return hr;
19 }
20
21public: //CBextBaseBootstrapperExtension
22 virtual STDMETHODIMP Initialize(
23 __in const BOOTSTRAPPER_EXTENSION_CREATE_ARGS* pCreateArgs
24 )
25 {
26 HRESULT hr = S_OK;
27 IXMLDOMDocument* pixdManifest = NULL;
28 IXMLDOMNode* pixnBootstrapperExtension = NULL;
29
30 hr = __super::Initialize(pCreateArgs);
31 BextExitOnFailure(hr, "CBextBaseBootstrapperExtension initialization failed.");
32
33 hr = XmlLoadDocumentFromFile(m_sczBootstrapperExtensionDataPath, &pixdManifest);
34 BextExitOnFailure(hr, "Failed to load bundle extension manifest from path: %ls", m_sczBootstrapperExtensionDataPath);
35
36 hr = BextGetBootstrapperExtensionDataNode(pixdManifest, UTIL_BOOTSTRAPPER_EXTENSION_ID, &pixnBootstrapperExtension);
37 BextExitOnFailure(hr, "Failed to get BootstrapperExtension '%ls'", UTIL_BOOTSTRAPPER_EXTENSION_ID);
38
39 hr = UtilSearchParseFromXml(&m_searches, pixnBootstrapperExtension);
40 BextExitOnFailure(hr, "Failed to parse searches from bundle extension manifest.");
41
42 LExit:
43 ReleaseObject(pixnBootstrapperExtension);
44 ReleaseObject(pixdManifest);
45
46 return hr;
47 }
48
49public:
50 CWixUtilBootstrapperExtension(
51 __in IBootstrapperExtensionEngine* pEngine
52 ) : CBextBaseBootstrapperExtension(pEngine)
53 {
54 m_searches = { };
55 }
56
57 ~CWixUtilBootstrapperExtension()
58 {
59 UtilSearchUninitialize(&m_searches);
60 }
61
62private:
63 UTIL_SEARCHES m_searches;
64};
65
66HRESULT UtilBootstrapperExtensionCreate(
67 __in IBootstrapperExtensionEngine* pEngine,
68 __in const BOOTSTRAPPER_EXTENSION_CREATE_ARGS* pArgs,
69 __out IBootstrapperExtension** ppBootstrapperExtension
70 )
71{
72 HRESULT hr = S_OK;
73 CWixUtilBootstrapperExtension* pExtension = NULL;
74
75 pExtension = new CWixUtilBootstrapperExtension(pEngine);
76 BextExitOnNull(pExtension, hr, E_OUTOFMEMORY, "Failed to create new CWixUtilBootstrapperExtension.");
77
78 hr = pExtension->Initialize(pArgs);
79 BextExitOnFailure(hr, "CWixUtilBootstrapperExtension initialization failed.");
80
81 *ppBootstrapperExtension = pExtension;
82 pExtension = NULL;
83
84LExit:
85 ReleaseObject(pExtension);
86 return hr;
87}
diff --git a/src/ext/Util/be/UtilBootstrapperExtension.h b/src/ext/Util/be/UtilBootstrapperExtension.h
new file mode 100644
index 00000000..32cabb89
--- /dev/null
+++ b/src/ext/Util/be/UtilBootstrapperExtension.h
@@ -0,0 +1,16 @@
1#pragma once
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
4
5// constants
6
7#define UTIL_BOOTSTRAPPER_EXTENSION_ID BOOTSTRAPPER_EXTENSION_DECORATION(L"UtilBootstrapperExtension")
8
9
10// function declarations
11
12HRESULT UtilBootstrapperExtensionCreate(
13 __in IBootstrapperExtensionEngine* pEngine,
14 __in const BOOTSTRAPPER_EXTENSION_CREATE_ARGS* pArgs,
15 __out IBootstrapperExtension** ppBootstrapperExtension
16 );
diff --git a/src/ext/Util/be/UtilBundleExtension.cpp b/src/ext/Util/be/UtilBundleExtension.cpp
deleted file mode 100644
index 23f5d94f..00000000
--- a/src/ext/Util/be/UtilBundleExtension.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
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#include "precomp.h"
4#include "BextBaseBundleExtension.h"
5
6class CWixUtilBundleExtension : public CBextBaseBundleExtension
7{
8public: // IBundleExtension
9 virtual STDMETHODIMP Search(
10 __in LPCWSTR wzId,
11 __in LPCWSTR wzVariable
12 )
13 {
14 HRESULT hr = S_OK;
15
16 hr = UtilSearchExecute(&m_searches, wzId, wzVariable, m_pEngine);
17
18 return hr;
19 }
20
21public: //CBextBaseBundleExtension
22 virtual STDMETHODIMP Initialize(
23 __in const BUNDLE_EXTENSION_CREATE_ARGS* pCreateArgs
24 )
25 {
26 HRESULT hr = S_OK;
27 IXMLDOMDocument* pixdManifest = NULL;
28 IXMLDOMNode* pixnBundleExtension = NULL;
29
30 hr = __super::Initialize(pCreateArgs);
31 BextExitOnFailure(hr, "CBextBaseBundleExtension initialization failed.");
32
33 hr = XmlLoadDocumentFromFile(m_sczBundleExtensionDataPath, &pixdManifest);
34 BextExitOnFailure(hr, "Failed to load bundle extension manifest from path: %ls", m_sczBundleExtensionDataPath);
35
36 hr = BextGetBundleExtensionDataNode(pixdManifest, UTIL_BUNDLE_EXTENSION_ID, &pixnBundleExtension);
37 BextExitOnFailure(hr, "Failed to get BundleExtension '%ls'", UTIL_BUNDLE_EXTENSION_ID);
38
39 hr = UtilSearchParseFromXml(&m_searches, pixnBundleExtension);
40 BextExitOnFailure(hr, "Failed to parse searches from bundle extension manifest.");
41
42 LExit:
43 ReleaseObject(pixnBundleExtension);
44 ReleaseObject(pixdManifest);
45
46 return hr;
47 }
48
49public:
50 CWixUtilBundleExtension(
51 __in IBundleExtensionEngine* pEngine
52 ) : CBextBaseBundleExtension(pEngine)
53 {
54 m_searches = { };
55 }
56
57 ~CWixUtilBundleExtension()
58 {
59 UtilSearchUninitialize(&m_searches);
60 }
61
62private:
63 UTIL_SEARCHES m_searches;
64};
65
66HRESULT UtilBundleExtensionCreate(
67 __in IBundleExtensionEngine* pEngine,
68 __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs,
69 __out IBundleExtension** ppBundleExtension
70 )
71{
72 HRESULT hr = S_OK;
73 CWixUtilBundleExtension* pExtension = NULL;
74
75 pExtension = new CWixUtilBundleExtension(pEngine);
76 BextExitOnNull(pExtension, hr, E_OUTOFMEMORY, "Failed to create new CWixUtilBundleExtension.");
77
78 hr = pExtension->Initialize(pArgs);
79 BextExitOnFailure(hr, "CWixUtilBundleExtension initialization failed.");
80
81 *ppBundleExtension = pExtension;
82 pExtension = NULL;
83
84LExit:
85 ReleaseObject(pExtension);
86 return hr;
87}
diff --git a/src/ext/Util/be/UtilBundleExtension.h b/src/ext/Util/be/UtilBundleExtension.h
deleted file mode 100644
index c55d6b85..00000000
--- a/src/ext/Util/be/UtilBundleExtension.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#pragma once
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
4
5// constants
6
7#define UTIL_BUNDLE_EXTENSION_ID BUNDLE_EXTENSION_DECORATION(L"UtilBundleExtension")
8
9
10// function declarations
11
12HRESULT UtilBundleExtensionCreate(
13 __in IBundleExtensionEngine* pEngine,
14 __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs,
15 __out IBundleExtension** ppBundleExtension
16 );
diff --git a/src/ext/Util/be/detectsha2support.cpp b/src/ext/Util/be/detectsha2support.cpp
index 4abfc63c..c7175a47 100644
--- a/src/ext/Util/be/detectsha2support.cpp
+++ b/src/ext/Util/be/detectsha2support.cpp
@@ -41,7 +41,7 @@ LExit:
41HRESULT UtilPerformDetectSHA2CodeSigning( 41HRESULT UtilPerformDetectSHA2CodeSigning(
42 __in LPCWSTR wzVariable, 42 __in LPCWSTR wzVariable,
43 __in UTIL_SEARCH* /*pSearch*/, 43 __in UTIL_SEARCH* /*pSearch*/,
44 __in IBundleExtensionEngine* pEngine 44 __in IBootstrapperExtensionEngine* pEngine
45 ) 45 )
46{ 46{
47 HRESULT hr = S_OK; 47 HRESULT hr = S_OK;
diff --git a/src/ext/Util/be/detectsha2support.h b/src/ext/Util/be/detectsha2support.h
index c38a3d59..b387a3ea 100644
--- a/src/ext/Util/be/detectsha2support.h
+++ b/src/ext/Util/be/detectsha2support.h
@@ -4,5 +4,5 @@
4HRESULT UtilPerformDetectSHA2CodeSigning( 4HRESULT UtilPerformDetectSHA2CodeSigning(
5 __in LPCWSTR wzVariable, 5 __in LPCWSTR wzVariable,
6 __in UTIL_SEARCH* pSearch, 6 __in UTIL_SEARCH* pSearch,
7 __in IBundleExtensionEngine* pEngine 7 __in IBootstrapperExtensionEngine* pEngine
8 ); \ No newline at end of file 8 );
diff --git a/src/ext/Util/be/precomp.h b/src/ext/Util/be/precomp.h
index d04bf305..0cf0c761 100644
--- a/src/ext/Util/be/precomp.h
+++ b/src/ext/Util/be/precomp.h
@@ -24,9 +24,9 @@
24#include <xmlutil.h> 24#include <xmlutil.h>
25 25
26#include <bextutil.h> 26#include <bextutil.h>
27#include <BextBundleExtensionEngine.h> 27#include <BextBootstrapperExtensionEngine.h>
28 28
29#include "..\..\beDecor.h" 29#include "..\..\beDecor.h"
30#include "utilsearch.h" 30#include "utilsearch.h"
31#include "detectsha2support.h" 31#include "detectsha2support.h"
32#include "UtilBundleExtension.h" 32#include "UtilBootstrapperExtension.h"
diff --git a/src/ext/Util/be/utilbe.cpp b/src/ext/Util/be/utilbe.cpp
index d9816dc7..b4e6fda3 100644
--- a/src/ext/Util/be/utilbe.cpp
+++ b/src/ext/Util/be/utilbe.cpp
@@ -1,19 +1,19 @@
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#include "precomp.h" 3#include "precomp.h"
4#include "BextBaseBundleExtensionProc.h" 4#include "BextBaseBootstrapperExtensionProc.h"
5 5
6static IBundleExtension* vpBundleExtension = NULL; 6static IBootstrapperExtension* vpBootstrapperExtension = NULL;
7 7
8// function definitions 8// function definitions
9 9
10extern "C" HRESULT WINAPI BundleExtensionCreate( 10extern "C" HRESULT WINAPI BootstrapperExtensionCreate(
11 __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs, 11 __in const BOOTSTRAPPER_EXTENSION_CREATE_ARGS* pArgs,
12 __inout BUNDLE_EXTENSION_CREATE_RESULTS* pResults 12 __inout BOOTSTRAPPER_EXTENSION_CREATE_RESULTS* pResults
13 ) 13 )
14{ 14{
15 HRESULT hr = S_OK; 15 HRESULT hr = S_OK;
16 IBundleExtensionEngine* pEngine = NULL; 16 IBootstrapperExtensionEngine* pEngine = NULL;
17 17
18 hr = XmlInitialize(); 18 hr = XmlInitialize();
19 ExitOnFailure(hr, "Failed to initialize XML."); 19 ExitOnFailure(hr, "Failed to initialize XML.");
@@ -21,11 +21,11 @@ extern "C" HRESULT WINAPI BundleExtensionCreate(
21 hr = BextInitializeFromCreateArgs(pArgs, &pEngine); 21 hr = BextInitializeFromCreateArgs(pArgs, &pEngine);
22 ExitOnFailure(hr, "Failed to initialize bext"); 22 ExitOnFailure(hr, "Failed to initialize bext");
23 23
24 hr = UtilBundleExtensionCreate(pEngine, pArgs, &vpBundleExtension); 24 hr = UtilBootstrapperExtensionCreate(pEngine, pArgs, &vpBootstrapperExtension);
25 BextExitOnFailure(hr, "Failed to create WixUtilBundleExtension"); 25 BextExitOnFailure(hr, "Failed to create WixUtilBootstrapperExtension");
26 26
27 pResults->pfnBundleExtensionProc = BextBaseBundleExtensionProc; 27 pResults->pfnBootstrapperExtensionProc = BextBaseBootstrapperExtensionProc;
28 pResults->pvBundleExtensionProcContext = vpBundleExtension; 28 pResults->pvBootstrapperExtensionProcContext = vpBootstrapperExtension;
29 29
30LExit: 30LExit:
31 ReleaseObject(pEngine); 31 ReleaseObject(pEngine);
@@ -33,9 +33,9 @@ LExit:
33 return hr; 33 return hr;
34} 34}
35 35
36extern "C" void WINAPI BundleExtensionDestroy() 36extern "C" void WINAPI BootstrapperExtensionDestroy()
37{ 37{
38 BextUninitialize(); 38 BextUninitialize();
39 ReleaseNullObject(vpBundleExtension); 39 ReleaseNullObject(vpBootstrapperExtension);
40 XmlUninitialize(); 40 XmlUninitialize();
41} \ No newline at end of file 41}
diff --git a/src/ext/Util/be/utilbe.def b/src/ext/Util/be/utilbe.def
index 711b1a5c..b4e7e893 100644
--- a/src/ext/Util/be/utilbe.def
+++ b/src/ext/Util/be/utilbe.def
@@ -4,5 +4,5 @@
4LIBRARY "utilbe" 4LIBRARY "utilbe"
5 5
6EXPORTS 6EXPORTS
7 BundleExtensionCreate 7 BootstrapperExtensionCreate
8 BundleExtensionDestroy 8 BootstrapperExtensionDestroy
diff --git a/src/ext/Util/be/utilbe.vcxproj b/src/ext/Util/be/utilbe.vcxproj
index d2697bbd..df06cb46 100644
--- a/src/ext/Util/be/utilbe.vcxproj
+++ b/src/ext/Util/be/utilbe.vcxproj
@@ -35,7 +35,7 @@
35 <TargetName>utilbe</TargetName> 35 <TargetName>utilbe</TargetName>
36 <CharacterSet>Unicode</CharacterSet> 36 <CharacterSet>Unicode</CharacterSet>
37 <ProjectModuleDefinitionFile>utilbe.def</ProjectModuleDefinitionFile> 37 <ProjectModuleDefinitionFile>utilbe.def</ProjectModuleDefinitionFile>
38 <Description>WiX Toolset Util BundleExtension</Description> 38 <Description>WiX Toolset Util BootstrapperExtension</Description>
39 </PropertyGroup> 39 </PropertyGroup>
40 40
41 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> 41 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -51,14 +51,14 @@
51 <PrecompiledHeader>Create</PrecompiledHeader> 51 <PrecompiledHeader>Create</PrecompiledHeader>
52 </ClCompile> 52 </ClCompile>
53 <ClCompile Include="utilbe.cpp" /> 53 <ClCompile Include="utilbe.cpp" />
54 <ClCompile Include="UtilBundleExtension.cpp" /> 54 <ClCompile Include="UtilBootstrapperExtension.cpp" />
55 <ClCompile Include="utilsearch.cpp" /> 55 <ClCompile Include="utilsearch.cpp" />
56 </ItemGroup> 56 </ItemGroup>
57 57
58 <ItemGroup> 58 <ItemGroup>
59 <ClInclude Include="detectsha2support.h" /> 59 <ClInclude Include="detectsha2support.h" />
60 <ClInclude Include="precomp.h" /> 60 <ClInclude Include="precomp.h" />
61 <ClInclude Include="UtilBundleExtension.h" /> 61 <ClInclude Include="UtilBootstrapperExtension.h" />
62 <ClInclude Include="utilsearch.h" /> 62 <ClInclude Include="utilsearch.h" />
63 </ItemGroup> 63 </ItemGroup>
64 64
@@ -67,7 +67,7 @@
67 </ItemGroup> 67 </ItemGroup>
68 68
69 <ItemGroup> 69 <ItemGroup>
70 <PackageReference Include="WixToolset.BextUtil" /> 70 <PackageReference Include="WixToolset.BootstrapperExtensionApi" />
71 71
72 <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" /> 72 <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
73 </ItemGroup> 73 </ItemGroup>
diff --git a/src/ext/Util/be/utilsearch.cpp b/src/ext/Util/be/utilsearch.cpp
index 20a514d8..59c497e3 100644
--- a/src/ext/Util/be/utilsearch.cpp
+++ b/src/ext/Util/be/utilsearch.cpp
@@ -5,7 +5,7 @@
5 5
6STDMETHODIMP UtilSearchParseFromXml( 6STDMETHODIMP UtilSearchParseFromXml(
7 __in UTIL_SEARCHES* pSearches, 7 __in UTIL_SEARCHES* pSearches,
8 __in IXMLDOMNode* pixnBundleExtension 8 __in IXMLDOMNode* pixnBootstrapperExtension
9 ) 9 )
10{ 10{
11 HRESULT hr = S_OK; 11 HRESULT hr = S_OK;
@@ -16,7 +16,7 @@ STDMETHODIMP UtilSearchParseFromXml(
16 LPWSTR scz = NULL; 16 LPWSTR scz = NULL;
17 17
18 // Select Util search nodes. 18 // Select Util search nodes.
19 hr = XmlSelectNodes(pixnBundleExtension, L"WixWindowsFeatureSearch", &pixnNodes); 19 hr = XmlSelectNodes(pixnBootstrapperExtension, L"WixWindowsFeatureSearch", &pixnNodes);
20 BextExitOnFailure(hr, "Failed to select Util search nodes."); 20 BextExitOnFailure(hr, "Failed to select Util search nodes.");
21 21
22 // Get Util search node count. 22 // Get Util search node count.
@@ -103,7 +103,7 @@ STDMETHODIMP UtilSearchExecute(
103 __in UTIL_SEARCHES* pSearches, 103 __in UTIL_SEARCHES* pSearches,
104 __in LPCWSTR wzSearchId, 104 __in LPCWSTR wzSearchId,
105 __in LPCWSTR wzVariable, 105 __in LPCWSTR wzVariable,
106 __in IBundleExtensionEngine* pEngine 106 __in IBootstrapperExtensionEngine* pEngine
107 ) 107 )
108{ 108{
109 HRESULT hr = S_OK; 109 HRESULT hr = S_OK;
diff --git a/src/ext/Util/be/utilsearch.h b/src/ext/Util/be/utilsearch.h
index deeab1f7..d19e240f 100644
--- a/src/ext/Util/be/utilsearch.h
+++ b/src/ext/Util/be/utilsearch.h
@@ -44,7 +44,7 @@ typedef struct _UTIL_SEARCHES
44 44
45STDMETHODIMP UtilSearchParseFromXml( 45STDMETHODIMP UtilSearchParseFromXml(
46 __in UTIL_SEARCHES* pSearches, 46 __in UTIL_SEARCHES* pSearches,
47 __in IXMLDOMNode* pixnBundleExtension 47 __in IXMLDOMNode* pixnBootstrapperExtension
48 ); 48 );
49 49
50void UtilSearchUninitialize( 50void UtilSearchUninitialize(
@@ -55,7 +55,7 @@ STDMETHODIMP UtilSearchExecute(
55 __in UTIL_SEARCHES* pSearches, 55 __in UTIL_SEARCHES* pSearches,
56 __in LPCWSTR wzSearchId, 56 __in LPCWSTR wzSearchId,
57 __in LPCWSTR wzVariable, 57 __in LPCWSTR wzVariable,
58 __in IBundleExtensionEngine* pEngine 58 __in IBootstrapperExtensionEngine* pEngine
59 ); 59 );
60 60
61STDMETHODIMP UtilSearchFindById( 61STDMETHODIMP UtilSearchFindById(