diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-06-04 13:38:04 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-06-04 14:57:11 -0500 |
commit | 4fac8fca0e04b6d7f9be8c3cf90439f9f614cecf (patch) | |
tree | 966ca79322c925d55a797bf2f6c26eb0f4b9cd68 | |
parent | 1b2b372b452b5aee5dd2b8aa2cbbbe49e8d3c9e6 (diff) | |
download | wix-4fac8fca0e04b6d7f9be8c3cf90439f9f614cecf.tar.gz wix-4fac8fca0e04b6d7f9be8c3cf90439f9f614cecf.tar.bz2 wix-4fac8fca0e04b6d7f9be8c3cf90439f9f614cecf.zip |
Fix loading BAFunctions.
-rw-r--r-- | src/ext/Bal/wixext/BalBurnBackendExtension.cs | 6 | ||||
-rw-r--r-- | src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs | 8 | ||||
-rw-r--r-- | src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | 23 |
3 files changed, 14 insertions, 23 deletions
diff --git a/src/ext/Bal/wixext/BalBurnBackendExtension.cs b/src/ext/Bal/wixext/BalBurnBackendExtension.cs index e8dc7a3e..c6a1e0c1 100644 --- a/src/ext/Bal/wixext/BalBurnBackendExtension.cs +++ b/src/ext/Bal/wixext/BalBurnBackendExtension.cs | |||
@@ -107,12 +107,14 @@ namespace WixToolset.Bal | |||
107 | } | 107 | } |
108 | else | 108 | else |
109 | { | 109 | { |
110 | var payloadId = baFunctionsSymbol.Id; | 110 | var payloadId = baFunctionsSymbol.PayloadId; |
111 | var bundlePayloadSymbol = payloadPropertiesSymbols.Single(x => payloadId == x.Id); | 111 | var bundlePayloadSymbol = payloadPropertiesSymbols.Single(x => payloadId == x.Id.Id); |
112 | if (BurnConstants.BurnUXContainerName != bundlePayloadSymbol.ContainerRef) | 112 | if (BurnConstants.BurnUXContainerName != bundlePayloadSymbol.ContainerRef) |
113 | { | 113 | { |
114 | this.Messaging.Write(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsSymbol.SourceLineNumbers)); | 114 | this.Messaging.Write(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsSymbol.SourceLineNumbers)); |
115 | } | 115 | } |
116 | |||
117 | baFunctionsSymbol.FilePath = bundlePayloadSymbol.Name; | ||
116 | } | 118 | } |
117 | } | 119 | } |
118 | 120 | ||
diff --git a/src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs index 19c7602d..83dd20b0 100644 --- a/src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs +++ b/src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs | |||
@@ -12,6 +12,7 @@ namespace WixToolset.Bal | |||
12 | new[] | 12 | new[] |
13 | { | 13 | { |
14 | new IntermediateFieldDefinition(nameof(WixBalBAFunctionsSymbolFields.PayloadId), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(WixBalBAFunctionsSymbolFields.PayloadId), IntermediateFieldType.String), |
15 | new IntermediateFieldDefinition(nameof(WixBalBAFunctionsSymbolFields.FilePath), IntermediateFieldType.String), | ||
15 | }, | 16 | }, |
16 | typeof(WixBalBAFunctionsSymbol)); | 17 | typeof(WixBalBAFunctionsSymbol)); |
17 | } | 18 | } |
@@ -24,6 +25,7 @@ namespace WixToolset.Bal.Symbols | |||
24 | public enum WixBalBAFunctionsSymbolFields | 25 | public enum WixBalBAFunctionsSymbolFields |
25 | { | 26 | { |
26 | PayloadId, | 27 | PayloadId, |
28 | FilePath, | ||
27 | } | 29 | } |
28 | 30 | ||
29 | public class WixBalBAFunctionsSymbol : IntermediateSymbol | 31 | public class WixBalBAFunctionsSymbol : IntermediateSymbol |
@@ -43,5 +45,11 @@ namespace WixToolset.Bal.Symbols | |||
43 | get => this.Fields[(int)WixBalBAFunctionsSymbolFields.PayloadId].AsString(); | 45 | get => this.Fields[(int)WixBalBAFunctionsSymbolFields.PayloadId].AsString(); |
44 | set => this.Set((int)WixBalBAFunctionsSymbolFields.PayloadId, value); | 46 | set => this.Set((int)WixBalBAFunctionsSymbolFields.PayloadId, value); |
45 | } | 47 | } |
48 | |||
49 | public string FilePath | ||
50 | { | ||
51 | get => this.Fields[(int)WixBalBAFunctionsSymbolFields.FilePath].AsString(); | ||
52 | set => this.Set((int)WixBalBAFunctionsSymbolFields.FilePath, value); | ||
53 | } | ||
46 | } | 54 | } |
47 | } \ No newline at end of file | 55 | } \ No newline at end of file |
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index d4bf7b43..42dfb220 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -3849,9 +3849,6 @@ private: // privates | |||
3849 | { | 3849 | { |
3850 | HRESULT hr = S_OK; | 3850 | HRESULT hr = S_OK; |
3851 | IXMLDOMNode* pBAFunctionsNode = NULL; | 3851 | IXMLDOMNode* pBAFunctionsNode = NULL; |
3852 | IXMLDOMNode* pPayloadNode = NULL; | ||
3853 | LPWSTR sczPayloadId = NULL; | ||
3854 | LPWSTR sczPayloadXPath = NULL; | ||
3855 | LPWSTR sczBafName = NULL; | 3852 | LPWSTR sczBafName = NULL; |
3856 | LPWSTR sczBafPath = NULL; | 3853 | LPWSTR sczBafPath = NULL; |
3857 | BA_FUNCTIONS_CREATE_ARGS bafCreateArgs = { }; | 3854 | BA_FUNCTIONS_CREATE_ARGS bafCreateArgs = { }; |
@@ -3865,21 +3862,8 @@ private: // privates | |||
3865 | ExitFunction(); | 3862 | ExitFunction(); |
3866 | } | 3863 | } |
3867 | 3864 | ||
3868 | hr = XmlGetAttributeEx(pBAFunctionsNode, L"PayloadId", &sczPayloadId); | 3865 | hr = XmlGetAttributeEx(pBAFunctionsNode, L"FilePath", &sczBafName); |
3869 | BalExitOnFailure(hr, "Failed to get BAFunctions PayloadId."); | 3866 | BalExitOnFailure(hr, "Failed to get BAFunctions FilePath."); |
3870 | |||
3871 | hr = StrAllocFormatted(&sczPayloadXPath, L"/BootstrapperApplicationData/WixPayloadProperties[@Payload='%ls']", sczPayloadId); | ||
3872 | BalExitOnFailure(hr, "Failed to format BAFunctions payload XPath."); | ||
3873 | |||
3874 | hr = XmlSelectSingleNode(pixdManifest, sczPayloadXPath, &pPayloadNode); | ||
3875 | if (S_FALSE == hr) | ||
3876 | { | ||
3877 | hr = E_NOTFOUND; | ||
3878 | } | ||
3879 | BalExitOnFailure(hr, "Failed to find WixPayloadProperties node for BAFunctions PayloadId: %ls.", sczPayloadId); | ||
3880 | |||
3881 | hr = XmlGetAttributeEx(pPayloadNode, L"Name", &sczBafName); | ||
3882 | BalExitOnFailure(hr, "Failed to get BAFunctions Name."); | ||
3883 | 3867 | ||
3884 | hr = PathRelativeToModule(&sczBafPath, sczBafName, m_hModule); | 3868 | hr = PathRelativeToModule(&sczBafPath, sczBafName, m_hModule); |
3885 | BalExitOnFailure(hr, "Failed to get path to BAFunctions DLL."); | 3869 | BalExitOnFailure(hr, "Failed to get path to BAFunctions DLL."); |
@@ -3912,10 +3896,7 @@ private: // privates | |||
3912 | } | 3896 | } |
3913 | ReleaseStr(sczBafPath); | 3897 | ReleaseStr(sczBafPath); |
3914 | ReleaseStr(sczBafName); | 3898 | ReleaseStr(sczBafName); |
3915 | ReleaseStr(sczPayloadXPath); | ||
3916 | ReleaseStr(sczPayloadId); | ||
3917 | ReleaseObject(pBAFunctionsNode); | 3899 | ReleaseObject(pBAFunctionsNode); |
3918 | ReleaseObject(pPayloadNode); | ||
3919 | 3900 | ||
3920 | return hr; | 3901 | return hr; |
3921 | } | 3902 | } |