diff options
author | Staffan Gustafsson <staffangu@outlook.com> | 2022-11-30 17:15:12 +0100 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2023-01-18 18:10:56 -0600 |
commit | 853887b4e84df1965794802b7683f3a9aca3e930 (patch) | |
tree | c2db272b63381c94186712c0029ed0e000ec3391 | |
parent | 9f368d76848e31d21ec3c193fa8c92849b1362a1 (diff) | |
download | wix-853887b4e84df1965794802b7683f3a9aca3e930.tar.gz wix-853887b4e84df1965794802b7683f3a9aca3e930.tar.bz2 wix-853887b4e84df1965794802b7683f3a9aca3e930.zip |
Adding support for DotNetCoreSdkSearch and DotNetCoreSdkCompatibilityCheck
19 files changed, 770 insertions, 119 deletions
diff --git a/src/ext/NetFx/be/detectnetcore.cpp b/src/ext/NetFx/be/detectnetcore.cpp index 42156692..aeb04203 100644 --- a/src/ext/NetFx/be/detectnetcore.cpp +++ b/src/ext/NetFx/be/detectnetcore.cpp | |||
@@ -60,7 +60,7 @@ HRESULT DetectNetCore( | |||
60 | hr = StrAllocFormatted(&sczExePath, L"%ls%ls\\netcoresearch.exe", wzBaseDirectory, wzPlatformName); | 60 | hr = StrAllocFormatted(&sczExePath, L"%ls%ls\\netcoresearch.exe", wzBaseDirectory, wzPlatformName); |
61 | BextExitOnFailure(hr, "Failed to build netcoresearch.exe path."); | 61 | BextExitOnFailure(hr, "Failed to build netcoresearch.exe path."); |
62 | 62 | ||
63 | hr = StrAllocFormatted(&sczCommandLine, L"\"%ls\" %ls %ls", sczExePath, wzMajorVersion, wzRuntimeType); | 63 | hr = StrAllocFormatted(&sczCommandLine, L"\"%ls\" runtime %ls %ls", sczExePath, wzMajorVersion, wzRuntimeType); |
64 | BextExitOnFailure(hr, "Failed to build netcoresearch.exe command line."); | 64 | BextExitOnFailure(hr, "Failed to build netcoresearch.exe command line."); |
65 | 65 | ||
66 | hr = ProcExecute(sczExePath, sczCommandLine, &hProcess, NULL, &hStdOutErr); | 66 | hr = ProcExecute(sczExePath, sczCommandLine, &hProcess, NULL, &hStdOutErr); |
diff --git a/src/ext/NetFx/be/detectnetcoresdk.cpp b/src/ext/NetFx/be/detectnetcoresdk.cpp new file mode 100644 index 00000000..08b18334 --- /dev/null +++ b/src/ext/NetFx/be/detectnetcoresdk.cpp | |||
@@ -0,0 +1,122 @@ | |||
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 | |||
5 | HRESULT DetectNetCoreSdk( | ||
6 | __in NETFX_NET_CORE_PLATFORM platform, | ||
7 | __in LPCWSTR wzVersion, | ||
8 | __in LPCWSTR wzBaseDirectory, | ||
9 | __inout LPWSTR* psczLatestVersion | ||
10 | ) | ||
11 | { | ||
12 | HRESULT hr = S_OK; | ||
13 | LPCWSTR wzPlatformName = NULL; | ||
14 | LPWSTR sczExePath = NULL; | ||
15 | LPWSTR sczCommandLine = NULL; | ||
16 | HANDLE hProcess = NULL; | ||
17 | HANDLE hStdOutErr = INVALID_HANDLE_VALUE; | ||
18 | BYTE* rgbOutput = NULL; | ||
19 | DWORD cbOutput = 0; | ||
20 | DWORD cbTotalRead = 0; | ||
21 | DWORD cbRead = 0; | ||
22 | DWORD dwExitCode = 0; | ||
23 | |||
24 | ReleaseNullStr(*psczLatestVersion); | ||
25 | |||
26 | switch (platform) | ||
27 | { | ||
28 | case NETFX_NET_CORE_PLATFORM_ARM64: | ||
29 | wzPlatformName = L"arm64"; | ||
30 | break; | ||
31 | case NETFX_NET_CORE_PLATFORM_X64: | ||
32 | wzPlatformName = L"x64"; | ||
33 | break; | ||
34 | case NETFX_NET_CORE_PLATFORM_X86: | ||
35 | wzPlatformName = L"x86"; | ||
36 | break; | ||
37 | default: | ||
38 | BextExitWithRootFailure(hr, E_INVALIDARG, "Unknown platform: %u", platform); | ||
39 | break; | ||
40 | } | ||
41 | |||
42 | hr = StrAllocFormatted(&sczExePath, L"%ls%ls\\netcoresearch.exe", wzBaseDirectory, wzPlatformName); | ||
43 | BextExitOnFailure(hr, "Failed to build netcoresearch.exe path."); | ||
44 | |||
45 | hr = StrAllocFormatted(&sczCommandLine, L"\"%ls\" sdk %ls", sczExePath, wzVersion); | ||
46 | BextExitOnFailure(hr, "Failed to build netcoresearch.exe command line."); | ||
47 | |||
48 | hr = ProcExecute(sczExePath, sczCommandLine, &hProcess, NULL, &hStdOutErr); | ||
49 | if (HRESULT_FROM_WIN32(ERROR_EXE_MACHINE_TYPE_MISMATCH) == hr) | ||
50 | { | ||
51 | ExitFunction1(hr = S_FALSE); | ||
52 | } | ||
53 | BextExitOnFailure(hr, "Failed to run: %ls", sczCommandLine); | ||
54 | |||
55 | cbOutput = 64; | ||
56 | |||
57 | rgbOutput = static_cast<BYTE*>(MemAlloc(cbOutput, TRUE)); | ||
58 | BextExitOnNull(rgbOutput, hr, E_OUTOFMEMORY, "Failed to alloc output string."); | ||
59 | |||
60 | while (::ReadFile(hStdOutErr, rgbOutput + cbTotalRead, cbOutput - cbTotalRead, &cbRead, NULL)) | ||
61 | { | ||
62 | cbTotalRead += cbRead; | ||
63 | |||
64 | if (cbTotalRead == cbOutput) | ||
65 | { | ||
66 | cbOutput *= 2; | ||
67 | |||
68 | const LPVOID pvNew = MemReAlloc(rgbOutput, cbOutput, TRUE); | ||
69 | BextExitOnNull(pvNew, hr, E_OUTOFMEMORY, "Failed to realloc output string."); | ||
70 | |||
71 | rgbOutput = static_cast<BYTE*>(pvNew); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | if (ERROR_BROKEN_PIPE != ::GetLastError()) | ||
76 | { | ||
77 | BextExitWithLastError(hr, "Failed to read netcoresearch.exe output."); | ||
78 | } | ||
79 | |||
80 | hr = ProcWaitForCompletion(hProcess, INFINITE, &dwExitCode); | ||
81 | BextExitOnFailure(hr, "Failed to wait for netcoresearch.exe to exit."); | ||
82 | |||
83 | if (0 != dwExitCode) | ||
84 | { | ||
85 | BextExitWithRootFailure(hr, E_UNEXPECTED, "netcoresearch.exe failed with exit code: 0x%x\r\nOutput:\r\n%hs", dwExitCode, rgbOutput); | ||
86 | } | ||
87 | |||
88 | if (*rgbOutput) | ||
89 | { | ||
90 | hr = StrAllocStringAnsi(psczLatestVersion, reinterpret_cast<LPSTR>(rgbOutput), 0, CP_UTF8); | ||
91 | BextExitOnFailure(hr, "Failed to widen output string: %hs", rgbOutput); | ||
92 | } | ||
93 | |||
94 | LExit: | ||
95 | ReleaseFileHandle(hStdOutErr); | ||
96 | ReleaseHandle(hProcess); | ||
97 | ReleaseMem(rgbOutput); | ||
98 | ReleaseStr(sczCommandLine); | ||
99 | ReleaseStr(sczExePath); | ||
100 | |||
101 | return hr; | ||
102 | } | ||
103 | |||
104 | HRESULT NetfxPerformDetectNetCoreSdk( | ||
105 | __in LPCWSTR wzVariable, | ||
106 | __in NETFX_SEARCH* pSearch, | ||
107 | __in IBundleExtensionEngine* pEngine, | ||
108 | __in LPCWSTR wzBaseDirectory | ||
109 | ) | ||
110 | { | ||
111 | HRESULT hr = S_OK; | ||
112 | LPWSTR sczLatestVersion = nullptr; | ||
113 | const auto& searchParams = pSearch->NetCoreSdkSearch; | ||
114 | hr = DetectNetCoreSdk(searchParams.platform, searchParams.sczVersion, wzBaseDirectory, &sczLatestVersion); | ||
115 | BextExitOnFailure(hr, "DetectNetCoreSdk failed."); | ||
116 | |||
117 | hr = pEngine->SetVariableVersion(wzVariable, sczLatestVersion); | ||
118 | BextExitOnFailure(hr, "Failed to set variable '%ls' to '%ls'", wzVariable, sczLatestVersion); | ||
119 | |||
120 | LExit: | ||
121 | return hr; | ||
122 | } | ||
diff --git a/src/ext/NetFx/be/detectnetcoresdk.h b/src/ext/NetFx/be/detectnetcoresdk.h new file mode 100644 index 00000000..025deaa2 --- /dev/null +++ b/src/ext/NetFx/be/detectnetcoresdk.h | |||
@@ -0,0 +1,9 @@ | |||
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 | HRESULT NetfxPerformDetectNetCoreSdk( | ||
5 | __in LPCWSTR wzVariable, | ||
6 | __in NETFX_SEARCH* pSearch, | ||
7 | __in IBundleExtensionEngine* pEngine, | ||
8 | __in LPCWSTR wzBaseDirectory | ||
9 | ); | ||
diff --git a/src/ext/NetFx/be/netfxbe.vcxproj b/src/ext/NetFx/be/netfxbe.vcxproj index d1084dd1..0408da72 100644 --- a/src/ext/NetFx/be/netfxbe.vcxproj +++ b/src/ext/NetFx/be/netfxbe.vcxproj | |||
@@ -47,6 +47,7 @@ | |||
47 | 47 | ||
48 | <ItemGroup> | 48 | <ItemGroup> |
49 | <ClCompile Include="detectnetcore.cpp" /> | 49 | <ClCompile Include="detectnetcore.cpp" /> |
50 | <ClCompile Include="detectnetcoresdk.cpp" /> | ||
50 | <ClCompile Include="netfxbe.cpp" /> | 51 | <ClCompile Include="netfxbe.cpp" /> |
51 | <ClCompile Include="NetfxBundleExtension.cpp" /> | 52 | <ClCompile Include="NetfxBundleExtension.cpp" /> |
52 | <ClCompile Include="netfxsearch.cpp" /> | 53 | <ClCompile Include="netfxsearch.cpp" /> |
@@ -57,6 +58,7 @@ | |||
57 | 58 | ||
58 | <ItemGroup> | 59 | <ItemGroup> |
59 | <ClInclude Include="detectnetcore.h" /> | 60 | <ClInclude Include="detectnetcore.h" /> |
61 | <ClInclude Include="detectnetcoresdk.h" /> | ||
60 | <ClInclude Include="NetfxBundleExtension.h" /> | 62 | <ClInclude Include="NetfxBundleExtension.h" /> |
61 | <ClInclude Include="netfxsearch.h" /> | 63 | <ClInclude Include="netfxsearch.h" /> |
62 | <ClInclude Include="precomp.h" /> | 64 | <ClInclude Include="precomp.h" /> |
diff --git a/src/ext/NetFx/be/netfxsearch.cpp b/src/ext/NetFx/be/netfxsearch.cpp index 3c12161d..671e7546 100644 --- a/src/ext/NetFx/be/netfxsearch.cpp +++ b/src/ext/NetFx/be/netfxsearch.cpp | |||
@@ -15,7 +15,7 @@ STDMETHODIMP NetfxSearchParseFromXml( | |||
15 | BSTR bstrNodeName = NULL; | 15 | BSTR bstrNodeName = NULL; |
16 | 16 | ||
17 | // Select Netfx search nodes. | 17 | // Select Netfx search nodes. |
18 | hr = XmlSelectNodes(pixnBundleExtension, L"NetFxNetCoreSearch", &pixnNodes); | 18 | hr = XmlSelectNodes(pixnBundleExtension, L"NetFxNetCoreSearch|NetFxNetCoreSdkSearch", &pixnNodes); |
19 | BextExitOnFailure(hr, "Failed to select Netfx search nodes."); | 19 | BextExitOnFailure(hr, "Failed to select Netfx search nodes."); |
20 | 20 | ||
21 | // Get Netfx search node count. | 21 | // Get Netfx search node count. |
@@ -50,18 +50,32 @@ STDMETHODIMP NetfxSearchParseFromXml( | |||
50 | { | 50 | { |
51 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SEARCH; | 51 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SEARCH; |
52 | 52 | ||
53 | auto& netCoreSearch = pSearch->NetCoreSearch; | ||
53 | // @RuntimeType | 54 | // @RuntimeType |
54 | hr = XmlGetAttributeUInt32(pixnNode, L"RuntimeType", reinterpret_cast<DWORD*>(&pSearch->NetCoreSearch.runtimeType)); | 55 | hr = XmlGetAttributeUInt32(pixnNode, L"RuntimeType", reinterpret_cast<DWORD*>(&netCoreSearch.runtimeType)); |
55 | BextExitOnFailure(hr, "Failed to get @RuntimeType."); | 56 | BextExitOnFailure(hr, "Failed to get @RuntimeType."); |
56 | 57 | ||
57 | // @Platform | 58 | // @Platform |
58 | hr = XmlGetAttributeUInt32(pixnNode, L"Platform", reinterpret_cast<DWORD*>(&pSearch->NetCoreSearch.platform)); | 59 | hr = XmlGetAttributeUInt32(pixnNode, L"Platform", reinterpret_cast<DWORD*>(&netCoreSearch.platform)); |
59 | BextExitOnFailure(hr, "Failed to get @Platform."); | 60 | BextExitOnFailure(hr, "Failed to get @Platform."); |
60 | 61 | ||
61 | // @MajorVersion | 62 | // @MajorVersion |
62 | hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &pSearch->NetCoreSearch.sczMajorVersion); | 63 | hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &netCoreSearch.sczMajorVersion); |
63 | BextExitOnFailure(hr, "Failed to get @MajorVersion."); | 64 | BextExitOnFailure(hr, "Failed to get @MajorVersion."); |
64 | } | 65 | } |
66 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"NetFxNetCoreSdkSearch", -1)) | ||
67 | { | ||
68 | pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SDK_SEARCH; | ||
69 | |||
70 | auto& netCoreSdkSearch = pSearch->NetCoreSdkSearch; | ||
71 | // @Platform | ||
72 | hr = XmlGetAttributeUInt32(pixnNode, L"Platform", reinterpret_cast<DWORD*>(&netCoreSdkSearch.platform)); | ||
73 | BextExitOnFailure(hr, "Failed to get @Platform."); | ||
74 | |||
75 | // @Version | ||
76 | hr = XmlGetAttributeEx(pixnNode, L"Version", &netCoreSdkSearch.sczVersion); | ||
77 | BextExitOnFailure(hr, "Failed to get @Version."); | ||
78 | } | ||
65 | else | 79 | else |
66 | { | 80 | { |
67 | BextExitWithRootFailure(hr, E_UNEXPECTED, "Unexpected element name: %ls", bstrNodeName); | 81 | BextExitWithRootFailure(hr, E_UNEXPECTED, "Unexpected element name: %ls", bstrNodeName); |
@@ -115,6 +129,9 @@ STDMETHODIMP NetfxSearchExecute( | |||
115 | case NETFX_SEARCH_TYPE_NET_CORE_SEARCH: | 129 | case NETFX_SEARCH_TYPE_NET_CORE_SEARCH: |
116 | hr = NetfxPerformDetectNetCore(wzVariable, pSearch, pEngine, wzBaseDirectory); | 130 | hr = NetfxPerformDetectNetCore(wzVariable, pSearch, pEngine, wzBaseDirectory); |
117 | break; | 131 | break; |
132 | case NETFX_SEARCH_TYPE_NET_CORE_SDK_SEARCH: | ||
133 | hr = NetfxPerformDetectNetCoreSdk(wzVariable, pSearch, pEngine, wzBaseDirectory); | ||
134 | break; | ||
118 | default: | 135 | default: |
119 | hr = E_UNEXPECTED; | 136 | hr = E_UNEXPECTED; |
120 | } | 137 | } |
diff --git a/src/ext/NetFx/be/netfxsearch.h b/src/ext/NetFx/be/netfxsearch.h index ae250690..f4e4db01 100644 --- a/src/ext/NetFx/be/netfxsearch.h +++ b/src/ext/NetFx/be/netfxsearch.h | |||
@@ -8,6 +8,7 @@ enum NETFX_SEARCH_TYPE | |||
8 | { | 8 | { |
9 | NETFX_SEARCH_TYPE_NONE, | 9 | NETFX_SEARCH_TYPE_NONE, |
10 | NETFX_SEARCH_TYPE_NET_CORE_SEARCH, | 10 | NETFX_SEARCH_TYPE_NET_CORE_SEARCH, |
11 | NETFX_SEARCH_TYPE_NET_CORE_SDK_SEARCH, | ||
11 | }; | 12 | }; |
12 | 13 | ||
13 | enum NETFX_NET_CORE_RUNTIME_TYPE | 14 | enum NETFX_NET_CORE_RUNTIME_TYPE |
@@ -40,6 +41,11 @@ typedef struct _NETFX_SEARCH | |||
40 | NETFX_NET_CORE_PLATFORM platform; | 41 | NETFX_NET_CORE_PLATFORM platform; |
41 | LPWSTR sczMajorVersion; | 42 | LPWSTR sczMajorVersion; |
42 | } NetCoreSearch; | 43 | } NetCoreSearch; |
44 | struct | ||
45 | { | ||
46 | NETFX_NET_CORE_PLATFORM platform; | ||
47 | LPWSTR sczVersion; | ||
48 | } NetCoreSdkSearch; | ||
43 | }; | 49 | }; |
44 | } NETFX_SEARCH; | 50 | } NETFX_SEARCH; |
45 | 51 | ||
diff --git a/src/ext/NetFx/be/precomp.h b/src/ext/NetFx/be/precomp.h index 33aea9bc..4a774200 100644 --- a/src/ext/NetFx/be/precomp.h +++ b/src/ext/NetFx/be/precomp.h | |||
@@ -30,4 +30,5 @@ | |||
30 | #include "..\..\beDecor.h" | 30 | #include "..\..\beDecor.h" |
31 | #include "netfxsearch.h" | 31 | #include "netfxsearch.h" |
32 | #include "detectnetcore.h" | 32 | #include "detectnetcore.h" |
33 | #include "detectnetcoresdk.h" | ||
33 | #include "NetfxBundleExtension.h" | 34 | #include "NetfxBundleExtension.h" |
diff --git a/src/ext/NetFx/netcoresearch/netcoresearch.cpp b/src/ext/NetFx/netcoresearch/netcoresearch.cpp index 517f6ac4..5cf6d10b 100644 --- a/src/ext/NetFx/netcoresearch/netcoresearch.cpp +++ b/src/ext/NetFx/netcoresearch/netcoresearch.cpp | |||
@@ -2,16 +2,36 @@ | |||
2 | 2 | ||
3 | #include "precomp.h" | 3 | #include "precomp.h" |
4 | 4 | ||
5 | enum class NETCORESEARCHKIND | ||
6 | { | ||
7 | None, | ||
8 | Runtime, | ||
9 | Sdk, | ||
10 | }; | ||
11 | |||
5 | struct NETCORESEARCH_STATE | 12 | struct NETCORESEARCH_STATE |
6 | { | 13 | { |
7 | LPCWSTR wzTargetName; | 14 | NETCORESEARCHKIND Kind = NETCORESEARCHKIND::None; |
8 | DWORD dwMajorVersion; | 15 | union |
16 | { | ||
17 | struct | ||
18 | { | ||
19 | LPCWSTR wzTargetName; | ||
20 | DWORD dwMajorVersion; | ||
21 | } Runtime; | ||
22 | struct | ||
23 | { | ||
24 | DWORD dwMajorVersion; | ||
25 | DWORD dwMinorVersion; | ||
26 | DWORD dwFeatureBand; | ||
27 | } | ||
28 | Sdk; | ||
29 | } Data; | ||
9 | VERUTIL_VERSION* pVersion; | 30 | VERUTIL_VERSION* pVersion; |
10 | }; | 31 | }; |
11 | 32 | ||
12 | static HRESULT GetDotnetEnvironmentInfo( | 33 | static HRESULT GetDotnetEnvironmentInfo( |
13 | __in DWORD dwMajorVersion, | 34 | __in NETCORESEARCH_STATE& pSearchState, |
14 | __in_z LPCWSTR wzTargetName, | ||
15 | __inout VERUTIL_VERSION** ppVersion | 35 | __inout VERUTIL_VERSION** ppVersion |
16 | ); | 36 | ); |
17 | static void HOSTFXR_CALLTYPE GetDotnetEnvironmentInfoResult( | 37 | static void HOSTFXR_CALLTYPE GetDotnetEnvironmentInfoResult( |
@@ -19,24 +39,28 @@ static void HOSTFXR_CALLTYPE GetDotnetEnvironmentInfoResult( | |||
19 | __in LPVOID pvContext | 39 | __in LPVOID pvContext |
20 | ); | 40 | ); |
21 | 41 | ||
42 | bool string_equal_invariant(__in PCWSTR const x,__in PCWSTR const y) { return CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, x, -1, y, -1); } | ||
43 | |||
44 | HRESULT get_search_state_from_arguments(__in int argc, __in LPWSTR argv[], __out NETCORESEARCH_STATE& searchState); | ||
45 | |||
22 | int __cdecl wmain(int argc, LPWSTR argv[]) | 46 | int __cdecl wmain(int argc, LPWSTR argv[]) |
23 | { | 47 | { |
24 | HRESULT hr = S_OK; | 48 | HRESULT hr = S_OK; |
25 | DWORD dwMajorVersion = 0; | ||
26 | VERUTIL_VERSION* pVersion = NULL; | 49 | VERUTIL_VERSION* pVersion = NULL; |
50 | NETCORESEARCH_STATE searchState = {}; | ||
51 | |||
52 | ::SetConsoleCP(CP_UTF8); | ||
27 | 53 | ||
28 | ConsoleInitialize(); | 54 | ConsoleInitialize(); |
29 | 55 | ||
30 | if (argc != 3) | 56 | hr = get_search_state_from_arguments(argc, argv, OUT searchState); |
57 | if (FAILED(hr)) | ||
31 | { | 58 | { |
32 | ExitFunction1(hr = E_INVALIDARG); | 59 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to parse arguments."); |
33 | } | 60 | } |
34 | 61 | ||
35 | hr = StrStringToUInt32(argv[1], 0, reinterpret_cast<UINT*>(&dwMajorVersion)); | 62 | hr = GetDotnetEnvironmentInfo(searchState, &pVersion); |
36 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to get target version from: %ls", argv[1]); | ||
37 | 63 | ||
38 | hr = GetDotnetEnvironmentInfo(dwMajorVersion, argv[2], &pVersion); | ||
39 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to search for .NET Core."); | ||
40 | 64 | ||
41 | if (pVersion) | 65 | if (pVersion) |
42 | { | 66 | { |
@@ -49,9 +73,65 @@ LExit: | |||
49 | return hr; | 73 | return hr; |
50 | } | 74 | } |
51 | 75 | ||
76 | HRESULT get_search_state_from_arguments(int argc, LPWSTR argv[], __out NETCORESEARCH_STATE& searchState) | ||
77 | { | ||
78 | HRESULT hr = S_OK; | ||
79 | searchState = {}; | ||
80 | const auto searchKind = argv[1]; | ||
81 | |||
82 | if (argc < 3) | ||
83 | { | ||
84 | ExitFunction1(hr = E_INVALIDARG); | ||
85 | } | ||
86 | |||
87 | |||
88 | if (string_equal_invariant(searchKind, L"runtime")) | ||
89 | { | ||
90 | if (argc != 4) | ||
91 | { | ||
92 | ExitFunction1(hr = E_INVALIDARG); | ||
93 | } | ||
94 | searchState.Kind = NETCORESEARCHKIND::Runtime; | ||
95 | |||
96 | const PCWSTR majorVersion = argv[2]; | ||
97 | const PCWSTR targetName = argv[3]; | ||
98 | |||
99 | auto& data = searchState.Data.Runtime; | ||
100 | |||
101 | data.wzTargetName = targetName; | ||
102 | hr = StrStringToUInt32(majorVersion, 0, reinterpret_cast<UINT*>(&data.dwMajorVersion)); | ||
103 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to get target version from: %ls", majorVersion); | ||
104 | } | ||
105 | else if(string_equal_invariant(searchKind, L"sdk")) | ||
106 | { | ||
107 | searchState.Kind = NETCORESEARCHKIND::Sdk; | ||
108 | |||
109 | const PCWSTR version = argv[2]; | ||
110 | |||
111 | VERUTIL_VERSION* sdkVersion = nullptr; | ||
112 | hr = VerParseVersion(version, 0, FALSE, &sdkVersion); | ||
113 | if (FAILED(hr)) | ||
114 | { | ||
115 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to parse version from: %ls", version); | ||
116 | } | ||
117 | |||
118 | auto& data = searchState.Data.Sdk; | ||
119 | |||
120 | data.dwMajorVersion = sdkVersion->dwMajor; | ||
121 | data.dwMinorVersion = sdkVersion->dwMinor; | ||
122 | data.dwFeatureBand = sdkVersion->dwPatch; | ||
123 | |||
124 | VerFreeVersion(sdkVersion); | ||
125 | } | ||
126 | |||
127 | LExit: | ||
128 | return hr; | ||
129 | } | ||
130 | |||
131 | |||
132 | |||
52 | static HRESULT GetDotnetEnvironmentInfo( | 133 | static HRESULT GetDotnetEnvironmentInfo( |
53 | __in DWORD dwMajorVersion, | 134 | __in NETCORESEARCH_STATE& state, |
54 | __in_z LPCWSTR wzTargetName, | ||
55 | __inout VERUTIL_VERSION** ppVersion | 135 | __inout VERUTIL_VERSION** ppVersion |
56 | ) | 136 | ) |
57 | { | 137 | { |
@@ -60,10 +140,6 @@ static HRESULT GetDotnetEnvironmentInfo( | |||
60 | LPWSTR sczHostfxrPath = NULL; | 140 | LPWSTR sczHostfxrPath = NULL; |
61 | HMODULE hModule = NULL; | 141 | HMODULE hModule = NULL; |
62 | hostfxr_get_dotnet_environment_info_fn pfnGetDotnetEnvironmentInfo = NULL; | 142 | hostfxr_get_dotnet_environment_info_fn pfnGetDotnetEnvironmentInfo = NULL; |
63 | NETCORESEARCH_STATE state = { }; | ||
64 | |||
65 | state.dwMajorVersion = dwMajorVersion; | ||
66 | state.wzTargetName = wzTargetName; | ||
67 | 143 | ||
68 | hr = PathForCurrentProcess(&sczProcessPath, NULL); | 144 | hr = PathForCurrentProcess(&sczProcessPath, NULL); |
69 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to get process path."); | 145 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to get process path."); |
@@ -102,50 +178,108 @@ LExit: | |||
102 | return hr; | 178 | return hr; |
103 | } | 179 | } |
104 | 180 | ||
181 | bool matches_feature_band(const int requested, const int actual) | ||
182 | { | ||
183 | // we have not requested a match on feature band, so skip the check | ||
184 | if (requested == 0) return true; | ||
185 | |||
186 | const int requestedBand = requested / 100; | ||
187 | const int actualBand = actual / 100; | ||
188 | |||
189 | if (actualBand != requestedBand) return false; | ||
190 | |||
191 | return actual >= requested; | ||
192 | } | ||
193 | |||
105 | static void HOSTFXR_CALLTYPE GetDotnetEnvironmentInfoResult( | 194 | static void HOSTFXR_CALLTYPE GetDotnetEnvironmentInfoResult( |
106 | __in const hostfxr_dotnet_environment_info* pInfo, | 195 | __in const hostfxr_dotnet_environment_info* pInfo, |
107 | __in LPVOID pvContext | 196 | __in LPVOID pvContext |
108 | ) | 197 | ) |
109 | { | 198 | { |
110 | NETCORESEARCH_STATE* pState = reinterpret_cast<NETCORESEARCH_STATE*>(pvContext); | 199 | NETCORESEARCH_STATE* pState = static_cast<NETCORESEARCH_STATE*>(pvContext); |
111 | HRESULT hr = S_OK; | 200 | HRESULT hr = S_OK; |
112 | VERUTIL_VERSION* pFrameworkVersion = NULL; | 201 | VERUTIL_VERSION* pDotnetVersion = nullptr; |
113 | int nCompare = 0; | 202 | int nCompare = 0; |
114 | 203 | ||
115 | for (size_t i = 0; i < pInfo->framework_count; ++i) | ||
116 | { | ||
117 | const hostfxr_dotnet_environment_framework_info* pFrameworkInfo = pInfo->frameworks + i; | ||
118 | ReleaseVerutilVersion(pFrameworkVersion); | ||
119 | 204 | ||
120 | if (CSTR_EQUAL != ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pState->wzTargetName, -1, pFrameworkInfo->name, -1)) | 205 | if (pState->Kind == NETCORESEARCHKIND::Sdk) |
206 | { | ||
207 | auto& sdkData = pState->Data.Sdk; | ||
208 | for (size_t i = 0; i < pInfo->sdk_count; ++i) | ||
121 | { | 209 | { |
122 | continue; | 210 | const hostfxr_dotnet_environment_sdk_info* pSdkInfo = pInfo->sdks + i; |
123 | } | 211 | ReleaseVerutilVersion(pDotnetVersion); |
124 | 212 | ||
125 | hr = VerParseVersion(pFrameworkInfo->version, 0, FALSE, &pFrameworkVersion); | 213 | hr = VerParseVersion(pSdkInfo->version, 0, FALSE, &pDotnetVersion); |
126 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to parse framework version: %ls", pFrameworkInfo->version); | 214 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to parse sdk version: %ls", pSdkInfo->version); |
127 | 215 | ||
128 | if (pFrameworkVersion->dwMajor != pState->dwMajorVersion) | 216 | if (pDotnetVersion->dwMajor != sdkData.dwMajorVersion) |
129 | { | 217 | { |
130 | continue; | 218 | continue; |
131 | } | 219 | } |
220 | if (!matches_feature_band(sdkData.dwFeatureBand, pDotnetVersion->dwPatch)) | ||
221 | { | ||
222 | continue; | ||
223 | } | ||
132 | 224 | ||
133 | if (pState->pVersion) | 225 | if (pState->pVersion) |
226 | { | ||
227 | hr = VerCompareParsedVersions(pState->pVersion, pDotnetVersion, &nCompare); | ||
228 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to compare versions."); | ||
229 | |||
230 | if (nCompare > -1) | ||
231 | { | ||
232 | continue; | ||
233 | } | ||
234 | } | ||
235 | |||
236 | ReleaseVerutilVersion(pState->pVersion); | ||
237 | pState->pVersion = pDotnetVersion; | ||
238 | pDotnetVersion = nullptr; | ||
239 | } | ||
240 | } | ||
241 | else if(pState->Kind == NETCORESEARCHKIND::Runtime) | ||
242 | { | ||
243 | auto& runtimeData = pState->Data.Runtime; | ||
244 | for (size_t i = 0; i < pInfo->framework_count; ++i) | ||
134 | { | 245 | { |
135 | hr = VerCompareParsedVersions(pState->pVersion, pFrameworkVersion, &nCompare); | 246 | const hostfxr_dotnet_environment_framework_info* pFrameworkInfo = pInfo->frameworks + i; |
136 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to compare versions."); | 247 | ReleaseVerutilVersion(pDotnetVersion); |
137 | 248 | ||
138 | if (nCompare > -1) | 249 | if (string_equal_invariant(runtimeData.wzTargetName, pFrameworkInfo->name)) |
139 | { | 250 | { |
140 | continue; | 251 | continue; |
141 | } | 252 | } |
142 | } | ||
143 | 253 | ||
144 | ReleaseVerutilVersion(pState->pVersion); | 254 | hr = VerParseVersion(pFrameworkInfo->version, 0, FALSE, &pDotnetVersion); |
145 | pState->pVersion = pFrameworkVersion; | 255 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to parse framework version: %ls", pFrameworkInfo->version); |
146 | pFrameworkVersion = NULL; | 256 | |
257 | if (pDotnetVersion->dwMajor != runtimeData.dwMajorVersion) | ||
258 | { | ||
259 | continue; | ||
260 | } | ||
261 | |||
262 | if (pState->pVersion) | ||
263 | { | ||
264 | hr = VerCompareParsedVersions(pState->pVersion, pDotnetVersion, &nCompare); | ||
265 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to compare versions."); | ||
266 | |||
267 | if (nCompare > -1) | ||
268 | { | ||
269 | continue; | ||
270 | } | ||
271 | } | ||
272 | |||
273 | ReleaseVerutilVersion(pState->pVersion); | ||
274 | pState->pVersion = pDotnetVersion; | ||
275 | pDotnetVersion = nullptr; | ||
276 | } | ||
277 | } | ||
278 | else | ||
279 | { | ||
280 | ConsoleWriteError(E_INVALIDARG, CONSOLE_COLOR_RED, "Invalid NETCORESEARCHKIND."); | ||
147 | } | 281 | } |
148 | 282 | ||
149 | LExit: | 283 | LExit: |
150 | ReleaseVerutilVersion(pFrameworkVersion); | 284 | ReleaseVerutilVersion(pDotnetVersion); |
151 | } | 285 | } |
diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x64.wxs b/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x64.wxs index 20b266a5..74e82405 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x64.wxs +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x64.wxs | |||
@@ -5,11 +5,15 @@ | |||
5 | <?define NetCorePlatform = x64?> | 5 | <?define NetCorePlatform = x64?> |
6 | <?define NetCoreIdVersion = 3112?> | 6 | <?define NetCoreIdVersion = 3112?> |
7 | <?define NetCoreVersion = 3.1.12?> | 7 | <?define NetCoreVersion = 3.1.12?> |
8 | <?define NetCoreSdkPlatform = x64?> | ||
9 | <?define NetCoreSdkIdVersion = 31425?> | ||
10 | <?define NetCoreSdkVersion = 3.1.425?> | ||
8 | <?include NetCore3_Platform.wxi?> | 11 | <?include NetCore3_Platform.wxi?> |
9 | 12 | ||
10 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/20cf277c-2ccf-449f-a0b8-925ba0c175e7/aa50b052ceb8a8d36a5b4f9b8d0bd91c/aspnetcore-runtime-3.1.12-win-x64.exe?> | 13 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/20cf277c-2ccf-449f-a0b8-925ba0c175e7/aa50b052ceb8a8d36a5b4f9b8d0bd91c/aspnetcore-runtime-3.1.12-win-x64.exe?> |
11 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/076a47e9-c65b-4b78-95a7-93eb988891a4/3574764590cfa650e0aa87c44d3fe384/windowsdesktop-runtime-3.1.12-win-x64.exe?> | 14 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/076a47e9-c65b-4b78-95a7-93eb988891a4/3574764590cfa650e0aa87c44d3fe384/windowsdesktop-runtime-3.1.12-win-x64.exe?> |
12 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/2fdc3009-cf5c-4cf6-8f3b-a61e83200cbb/2c71ee04b48103a7464f4e28a8bf339b/dotnet-runtime-3.1.12-win-x64.exe?> | 15 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/2fdc3009-cf5c-4cf6-8f3b-a61e83200cbb/2c71ee04b48103a7464f4e28a8bf339b/dotnet-runtime-3.1.12-win-x64.exe?> |
16 | <?define DotNetCoreSdkRedistLink = https://download.visualstudio.microsoft.com/download/pr/9cf7e571-76c7-4ce8-9777-37bd6c3540e9/5c01197afed195cdb6cd2ae9e49606fc/dotnet-sdk-3.1.425-win-x64.exe?> | ||
13 | 17 | ||
14 | <Fragment> | 18 | <Fragment> |
15 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="3" Variable="$(var.AspNetCoreId)" /> | 19 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="3" Variable="$(var.AspNetCoreId)" /> |
@@ -55,4 +59,19 @@ | |||
55 | </ExePackage> | 59 | </ExePackage> |
56 | </PackageGroup> | 60 | </PackageGroup> |
57 | </Fragment> | 61 | </Fragment> |
62 | |||
63 | <Fragment> | ||
64 | <netfx:DotNetCoreSdkSearch Id="$(var.DotNetCoreSdkId)" Platform="$(var.NetCoreSdkPlatform)" Version="3.0.100" Variable="$(var.DotNetCoreSdkId)" /> | ||
65 | |||
66 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition" Value="$(var.DotNetCoreSdkId) >= v$(var.NetCoreSdkVersion)" Overridable="yes" /> | ||
67 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition" Value="" Overridable="yes" /> | ||
68 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory" Value="redist\" Overridable="yes" /> | ||
69 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)RepairArguments" Value="" Overridable="yes" /> | ||
70 | |||
71 | <PackageGroup Id="$(var.DotNetCoreSdkRedistId)"> | ||
72 | <ExePackage CacheId="$(var.DotNetCoreSdkRedistId)_2485A7AFA98E178CB8F30C9838346B514AEA4769" InstallArguments="$(var.DotNetCoreSdkRedistInstallArguments)" PerMachine="yes" DetectCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition)" InstallCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition)" Id="$(var.DotNetCoreSdkRedistId)" Vital="yes" Permanent="yes" Protocol="burn" LogPathVariable="$(var.DotNetCoreSdkRedistLog)" Cache="remove"> | ||
73 | <ExePackagePayload Name="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory)dotnet-sdk-$(var.NetCoreSdkVersion)-win-$(var.NetCoreSdkPlatform).exe" DownloadUrl="$(var.DotNetCoreSdkRedistLink)" ProductName="Microsoft .NET Core Runtime - 3.1.425 (x64)" Description="Microsoft .NET Core Runtime - 3.1.425 (x64)" CertificatePublicKey="3756E9BBF4461DCD0AA68E0D1FCFFA9CEA47AC18" CertificateThumbprint="2485A7AFA98E178CB8F30C9838346B514AEA4769" Size="135024384" Version="3.1.425" /> | ||
74 | </ExePackage> | ||
75 | </PackageGroup> | ||
76 | </Fragment> | ||
58 | </Wix> | 77 | </Wix> |
diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x86.wxs b/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x86.wxs index 4bd97492..9acc4dc5 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x86.wxs +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3.1.12_x86.wxs | |||
@@ -5,11 +5,15 @@ | |||
5 | <?define NetCorePlatform = x86?> | 5 | <?define NetCorePlatform = x86?> |
6 | <?define NetCoreIdVersion = 3112?> | 6 | <?define NetCoreIdVersion = 3112?> |
7 | <?define NetCoreVersion = 3.1.12?> | 7 | <?define NetCoreVersion = 3.1.12?> |
8 | <?define NetCoreSdkPlatform = x86?> | ||
9 | <?define NetCoreSdkIdVersion = 31425?> | ||
10 | <?define NetCoreSdkVersion = 3.1.425?> | ||
8 | <?include NetCore3_Platform.wxi?> | 11 | <?include NetCore3_Platform.wxi?> |
9 | 12 | ||
10 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/55d6ff56-2725-4657-bffd-fdf35d6816fd/7431d1d3533f0b1ac97df734c45c33f2/aspnetcore-runtime-3.1.12-win-x86.exe?> | 13 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/55d6ff56-2725-4657-bffd-fdf35d6816fd/7431d1d3533f0b1ac97df734c45c33f2/aspnetcore-runtime-3.1.12-win-x86.exe?> |
11 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/5d89a010-88bf-4e4e-ac12-a07258ddbf5f/1ff5dfe312c5bd9760f3b500b1b37597/windowsdesktop-runtime-3.1.12-win-x86.exe?> | 14 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/5d89a010-88bf-4e4e-ac12-a07258ddbf5f/1ff5dfe312c5bd9760f3b500b1b37597/windowsdesktop-runtime-3.1.12-win-x86.exe?> |
12 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/cbdd1603-7fa9-4957-8869-94e24963ba6c/ca0b7d1be494882d5a7433accfa3c94c/dotnet-runtime-3.1.12-win-x86.exe?> | 15 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/cbdd1603-7fa9-4957-8869-94e24963ba6c/ca0b7d1be494882d5a7433accfa3c94c/dotnet-runtime-3.1.12-win-x86.exe?> |
16 | <?define DotNetCoreSdkRedistLink = https://download.visualstudio.microsoft.com/download/pr/d595e303-d26d-447c-92e7-5dc32c8e70b9/0669c3a6247a96a98ea96b1698294970/dotnet-sdk-3.1.425-win-x86.zip?> | ||
13 | 17 | ||
14 | <Fragment> | 18 | <Fragment> |
15 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="3" Variable="$(var.AspNetCoreId)" /> | 19 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="3" Variable="$(var.AspNetCoreId)" /> |
@@ -55,4 +59,19 @@ | |||
55 | </ExePackage> | 59 | </ExePackage> |
56 | </PackageGroup> | 60 | </PackageGroup> |
57 | </Fragment> | 61 | </Fragment> |
62 | |||
63 | <Fragment> | ||
64 | <netfx:DotNetCoreSdkSearch Id="$(var.DotNetCoreSdkId)" Platform="$(var.NetCoreSdkPlatform)" Version="3.0.100" Variable="$(var.DotNetCoreSdkId)" /> | ||
65 | |||
66 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition" Value="$(var.DotNetCoreSdkId) >= v$(var.NetCoreSdkVersion)" Overridable="yes" /> | ||
67 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition" Value="" Overridable="yes" /> | ||
68 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory" Value="redist\" Overridable="yes" /> | ||
69 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)RepairArguments" Value="" Overridable="yes" /> | ||
70 | |||
71 | <PackageGroup Id="$(var.DotNetCoreSdkRedistId)"> | ||
72 | <ExePackage CacheId="$(var.DotNetCoreSdkRedistId)_2485A7AFA98E178CB8F30C9838346B514AEA4769" InstallArguments="$(var.DotNetCoreSdkRedistInstallArguments)" PerMachine="yes" DetectCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition)" InstallCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition)" Id="$(var.DotNetCoreSdkRedistId)" Vital="yes" Permanent="yes" Protocol="burn" LogPathVariable="$(var.DotNetCoreSdkRedistLog)" Cache="remove"> | ||
73 | <ExePackagePayload Name="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory)dotnet-sdk-$(var.NetCoreSdkVersion)-win-$(var.NetCoreSdkPlatform).exe" DownloadUrl="$(var.DotNetCoreSdkRedistLink)" ProductName="Microsoft .NET Core SDK - 3.1.425 (x86)" Description="Microsoft .NET Core Runtime - 3.1.12 (x86)" CertificatePublicKey="3756E9BBF4461DCD0AA68E0D1FCFFA9CEA47AC18" CertificateThumbprint="2485A7AFA98E178CB8F30C9838346B514AEA4769" Size="124974936" Version="3.1.425" /> | ||
74 | </ExePackage> | ||
75 | </PackageGroup> | ||
76 | </Fragment> | ||
58 | </Wix> | 77 | </Wix> |
diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3_Platform.wxi b/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3_Platform.wxi index f0b97d33..2933196d 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3_Platform.wxi +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/TestData/UsingDotNetCorePackages/NetCore3_Platform.wxi | |||
@@ -21,6 +21,12 @@ | |||
21 | <?define DotNetCoreRedistInstallArguments = /install /quiet /log "[$(var.DotNetCoreRedistLog)]"?> | 21 | <?define DotNetCoreRedistInstallArguments = /install /quiet /log "[$(var.DotNetCoreRedistLog)]"?> |
22 | <?define DotNetCoreRedistUninstallArguments = /uninstall /quiet /log "[$(var.DotNetCoreRedistLog)]"?> | 22 | <?define DotNetCoreRedistUninstallArguments = /uninstall /quiet /log "[$(var.DotNetCoreRedistLog)]"?> |
23 | 23 | ||
24 | <?define DotNetCoreSdkId = DOTNETCORESDK3_$(var.NetCoreSdkPlatform)?> | ||
25 | <?define DotNetCoreSdkRedistId = DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist_$(var.NetCoreSdkPlatform)?> | ||
26 | <?define DotNetCoreSdkRedistLog = DotNetCoreSdk$(var.NetCoreSdkIdVersion)RedistLog?> | ||
27 | <?define DotNetCoreSdkRedistInstallArguments = /install /quiet /log "[$(var.DotNetCoreSdkRedistLog)]"?> | ||
28 | <?define DotNetCoreSdkRedistUninstallArguments = /uninstall /quiet /log "[$(var.DotNetCoreSdkRedistLog)]"?> | ||
29 | |||
24 | <?define NetCoreEulaLink = https://go.microsoft.com/fwlink/?LinkId=329770?> | 30 | <?define NetCoreEulaLink = https://go.microsoft.com/fwlink/?LinkId=329770?> |
25 | 31 | ||
26 | <Fragment> | 32 | <Fragment> |
@@ -46,4 +52,12 @@ | |||
46 | 52 | ||
47 | <bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.DotNetCoreRedistId)" LicenseUrl="$(var.NetCoreEulaLink)" /> | 53 | <bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.DotNetCoreRedistId)" LicenseUrl="$(var.NetCoreEulaLink)" /> |
48 | </Fragment> | 54 | </Fragment> |
55 | |||
56 | <Fragment> | ||
57 | <PackageGroup Id="$(var.DotNetCoreSdkRedistId)AsPrereq"> | ||
58 | <PackageGroupRef Id="$(var.DotNetCoreSdkRedistId)" /> | ||
59 | </PackageGroup> | ||
60 | |||
61 | <bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.DotNetCoreSdkRedistId)" LicenseUrl="$(var.NetCoreEulaLink)" /> | ||
62 | </Fragment> | ||
49 | </Include> | 63 | </Include> |
diff --git a/src/ext/NetFx/wixext/NetFxCompiler.cs b/src/ext/NetFx/wixext/NetFxCompiler.cs index 563cd19d..7a37cf90 100644 --- a/src/ext/NetFx/wixext/NetFxCompiler.cs +++ b/src/ext/NetFx/wixext/NetFxCompiler.cs | |||
@@ -49,6 +49,12 @@ namespace WixToolset.Netfx | |||
49 | case "DotNetCoreSearchRef": | 49 | case "DotNetCoreSearchRef": |
50 | this.ParseDotNetCoreSearchRefElement(intermediate, section, element); | 50 | this.ParseDotNetCoreSearchRefElement(intermediate, section, element); |
51 | break; | 51 | break; |
52 | case "DotNetCoreSdkSearch": | ||
53 | this.ParseDotNetCoreSdkSearchElement(intermediate, section, element); | ||
54 | break; | ||
55 | case "DotNetCoreSdkSearchRef": | ||
56 | this.ParseDotNetCoreSdkSearchRefElement(intermediate, section, element); | ||
57 | break; | ||
52 | case "DotNetCompatibilityCheck": | 58 | case "DotNetCompatibilityCheck": |
53 | this.ParseDotNetCompatibilityCheckElement(intermediate, section, element); | 59 | this.ParseDotNetCompatibilityCheckElement(intermediate, section, element); |
54 | break; | 60 | break; |
@@ -69,6 +75,12 @@ namespace WixToolset.Netfx | |||
69 | case "DotNetCoreSearchRef": | 75 | case "DotNetCoreSearchRef": |
70 | this.ParseDotNetCoreSearchRefElement(intermediate, section, element); | 76 | this.ParseDotNetCoreSearchRefElement(intermediate, section, element); |
71 | break; | 77 | break; |
78 | case "DotNetCoreSdkSearch": | ||
79 | this.ParseDotNetCoreSdkSearchElement(intermediate, section, element); | ||
80 | break; | ||
81 | case "DotNetCoreSdkSearchRef": | ||
82 | this.ParseDotNetCoreSdkSearchRefElement(intermediate, section, element); | ||
83 | break; | ||
72 | default: | 84 | default: |
73 | this.ParseHelper.UnexpectedElement(parentElement, element); | 85 | this.ParseHelper.UnexpectedElement(parentElement, element); |
74 | break; | 86 | break; |
@@ -248,6 +260,137 @@ namespace WixToolset.Netfx | |||
248 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 260 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |
249 | } | 261 | } |
250 | 262 | ||
263 | private void ParseDotNetCoreSdkSearchElement(Intermediate intermediate, IntermediateSection section, XElement element) | ||
264 | { | ||
265 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | ||
266 | Identifier id = null; | ||
267 | string variable = null; | ||
268 | string condition = null; | ||
269 | string after = null; | ||
270 | NetCoreSdkSearchPlatform? platform = null; | ||
271 | string version = null; | ||
272 | |||
273 | foreach (var attrib in element.Attributes()) | ||
274 | { | ||
275 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
276 | { | ||
277 | switch (attrib.Name.LocalName) | ||
278 | { | ||
279 | case "Id": | ||
280 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); | ||
281 | break; | ||
282 | case "Variable": | ||
283 | variable = this.ParseHelper.GetAttributeBundleVariableNameValue(sourceLineNumbers, attrib); | ||
284 | break; | ||
285 | case "Condition": | ||
286 | condition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
287 | break; | ||
288 | case "After": | ||
289 | after = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
290 | break; | ||
291 | case "Platform": | ||
292 | var platformValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
293 | switch (platformValue) | ||
294 | { | ||
295 | case "arm64": | ||
296 | platform = NetCoreSdkSearchPlatform.Arm64; | ||
297 | break; | ||
298 | case "x64": | ||
299 | platform = NetCoreSdkSearchPlatform.X64; | ||
300 | break; | ||
301 | case "x86": | ||
302 | platform = NetCoreSdkSearchPlatform.X86; | ||
303 | break; | ||
304 | default: | ||
305 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Platform", platformValue, "arm64", "x64", "x86")); | ||
306 | break; | ||
307 | } | ||
308 | break; | ||
309 | case "Version": | ||
310 | // .NET Core had a different deployment strategy before .NET Core 3.0 which would require different detection logic. | ||
311 | version = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib); | ||
312 | break; | ||
313 | default: | ||
314 | this.ParseHelper.UnexpectedAttribute(element, attrib); | ||
315 | break; | ||
316 | } | ||
317 | } | ||
318 | else | ||
319 | { | ||
320 | this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); | ||
321 | } | ||
322 | } | ||
323 | |||
324 | if (id == null) | ||
325 | { | ||
326 | id = this.ParseHelper.CreateIdentifier("dncss", variable, condition, after); | ||
327 | } | ||
328 | |||
329 | if (!platform.HasValue) | ||
330 | { | ||
331 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Platform")); | ||
332 | } | ||
333 | |||
334 | |||
335 | if (String.IsNullOrEmpty(version)) | ||
336 | { | ||
337 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Version")); | ||
338 | } | ||
339 | |||
340 | var ver = Version.Parse(version); | ||
341 | if (ver.Major == 4) | ||
342 | { | ||
343 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Version", version, "3.*", "5+.*")); | ||
344 | } | ||
345 | |||
346 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | ||
347 | |||
348 | var bundleExtensionId = this.ParseHelper.CreateIdentifierValueFromPlatform("Wix4NetfxBundleExtension", this.Context.Platform, BurnPlatforms.X86 | BurnPlatforms.X64 | BurnPlatforms.ARM64); | ||
349 | if (bundleExtensionId == null) | ||
350 | { | ||
351 | this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), element.Name.LocalName)); | ||
352 | } | ||
353 | |||
354 | if (!this.Messaging.EncounteredError) | ||
355 | { | ||
356 | this.ParseHelper.CreateWixSearchSymbol(section, sourceLineNumbers, element.Name.LocalName, id, variable, condition, after, bundleExtensionId); | ||
357 | |||
358 | section.AddSymbol(new NetFxNetCoreSdkSearchSymbol(sourceLineNumbers, id) | ||
359 | { | ||
360 | Platform = platform.Value, | ||
361 | Version = version, | ||
362 | }); | ||
363 | } | ||
364 | } | ||
365 | |||
366 | private void ParseDotNetCoreSdkSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement element) | ||
367 | { | ||
368 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | ||
369 | |||
370 | foreach (var attrib in element.Attributes()) | ||
371 | { | ||
372 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
373 | { | ||
374 | switch (attrib.Name.LocalName) | ||
375 | { | ||
376 | case "Id": | ||
377 | var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
378 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, NetfxSymbolDefinitions.NetFxNetCoreSdkSearch, refId); | ||
379 | break; | ||
380 | default: | ||
381 | this.ParseHelper.UnexpectedAttribute(element, attrib); | ||
382 | break; | ||
383 | } | ||
384 | } | ||
385 | else | ||
386 | { | ||
387 | this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); | ||
388 | } | ||
389 | } | ||
390 | |||
391 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | ||
392 | } | ||
393 | |||
251 | /// <summary> | 394 | /// <summary> |
252 | /// Parses a NativeImage element. | 395 | /// Parses a NativeImage element. |
253 | /// </summary> | 396 | /// </summary> |
@@ -389,66 +532,19 @@ namespace WixToolset.Netfx | |||
389 | property = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 532 | property = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
390 | break; | 533 | break; |
391 | case "RuntimeType": | 534 | case "RuntimeType": |
392 | runtimeType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 535 | runtimeType = this.ParseRuntimeType(element, sourceLineNumbers, attrib); |
393 | switch (runtimeType.ToLower()) | ||
394 | { | ||
395 | case "aspnet": | ||
396 | runtimeType = "Microsoft.AspNetCore.App"; | ||
397 | break; | ||
398 | case "desktop": | ||
399 | runtimeType = "Microsoft.WindowsDesktop.App"; | ||
400 | break; | ||
401 | case "core": | ||
402 | runtimeType = "Microsoft.NETCore.App"; | ||
403 | break; | ||
404 | default: | ||
405 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, runtimeType, "aspnet", "desktop", "core")); | ||
406 | break; | ||
407 | } | ||
408 | break; | 536 | break; |
409 | case "Platform": | 537 | case "Platform": |
410 | platform = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 538 | platform = this.ParsePlatform(element, sourceLineNumbers, attrib); |
411 | switch (platform.ToLower()) | 539 | break; |
412 | { | 540 | case "FeatureBand": |
413 | case "x86": | 541 | platform = this.ParseFeatureBand(element, sourceLineNumbers, attrib); |
414 | case "x64": | ||
415 | case "arm64": | ||
416 | platform = platform.ToLower(); | ||
417 | break; | ||
418 | default: | ||
419 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, platform, "x86", "x64", "arm64")); | ||
420 | break; | ||
421 | } | ||
422 | break; | 542 | break; |
423 | case "Version": | 543 | case "Version": |
424 | version = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib); | 544 | version = this.ParseHelper.GetAttributeVersionValue(sourceLineNumbers, attrib); |
425 | break; | 545 | break; |
426 | case "RollForward": | 546 | case "RollForward": |
427 | rollForward = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 547 | rollForward = this.ParseRollForward(element, sourceLineNumbers, attrib); |
428 | switch (rollForward.ToLowerInvariant()) | ||
429 | { | ||
430 | case "latestmajor": | ||
431 | rollForward = "LatestMajor"; | ||
432 | break; | ||
433 | case "major": | ||
434 | rollForward = "Major"; | ||
435 | break; | ||
436 | case "latestminor": | ||
437 | rollForward = "LatestMinor"; | ||
438 | break; | ||
439 | case "minor": | ||
440 | rollForward = "Minor"; | ||
441 | break; | ||
442 | case "latestpatch": | ||
443 | rollForward = "LatestPatch"; | ||
444 | break; | ||
445 | case "disable": | ||
446 | rollForward = "Disable"; | ||
447 | break; | ||
448 | default: | ||
449 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, rollForward, "latestmajor", "major", "latestminor", "minor", "latestpatch", "disable")); | ||
450 | break; | ||
451 | } | ||
452 | break; | 548 | break; |
453 | default: | 549 | default: |
454 | this.ParseHelper.UnexpectedAttribute(element, attrib); | 550 | this.ParseHelper.UnexpectedAttribute(element, attrib); |
@@ -503,6 +599,97 @@ namespace WixToolset.Netfx | |||
503 | } | 599 | } |
504 | } | 600 | } |
505 | 601 | ||
602 | private string ParseRollForward(XElement element, SourceLineNumber sourceLineNumbers, XAttribute attrib) | ||
603 | { | ||
604 | string rollForward; | ||
605 | rollForward = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
606 | switch (rollForward.ToLowerInvariant()) | ||
607 | { | ||
608 | case "latestmajor": | ||
609 | rollForward = "LatestMajor"; | ||
610 | break; | ||
611 | case "major": | ||
612 | rollForward = "Major"; | ||
613 | break; | ||
614 | case "latestminor": | ||
615 | rollForward = "LatestMinor"; | ||
616 | break; | ||
617 | case "minor": | ||
618 | rollForward = "Minor"; | ||
619 | break; | ||
620 | case "latestpatch": | ||
621 | rollForward = "LatestPatch"; | ||
622 | break; | ||
623 | case "disable": | ||
624 | rollForward = "Disable"; | ||
625 | break; | ||
626 | default: | ||
627 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, | ||
628 | attrib.Name.LocalName, rollForward, "latestmajor", "major", "latestminor", "minor", "latestpatch", "disable")); | ||
629 | break; | ||
630 | } | ||
631 | |||
632 | return rollForward; | ||
633 | } | ||
634 | |||
635 | private string ParsePlatform(XElement element, SourceLineNumber sourceLineNumbers, XAttribute attrib) | ||
636 | { | ||
637 | string platform; | ||
638 | platform = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
639 | switch (platform.ToLower()) | ||
640 | { | ||
641 | case "x86": | ||
642 | case "x64": | ||
643 | case "arm64": | ||
644 | platform = platform.ToLower(); | ||
645 | break; | ||
646 | default: | ||
647 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, | ||
648 | attrib.Name.LocalName, platform, "x86", "x64", "arm64")); | ||
649 | break; | ||
650 | } | ||
651 | |||
652 | return platform; | ||
653 | } | ||
654 | |||
655 | private string ParseFeatureBand(XElement element, SourceLineNumber sourceLineNumbers, XAttribute attrib) | ||
656 | { | ||
657 | string featureBand = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
658 | |||
659 | if (!Int32.TryParse(featureBand, out var intFeatureBand) || (100 > intFeatureBand) || (intFeatureBand > 999)) | ||
660 | { | ||
661 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, | ||
662 | attrib.Name.LocalName, featureBand, "An integer in the range [100 - 999]")); | ||
663 | |||
664 | } | ||
665 | |||
666 | return featureBand; | ||
667 | } | ||
668 | |||
669 | private string ParseRuntimeType(XElement element, SourceLineNumber sourceLineNumbers, XAttribute attrib) | ||
670 | { | ||
671 | var runtimeType = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
672 | switch (runtimeType.ToLower()) | ||
673 | { | ||
674 | case "aspnet": | ||
675 | runtimeType = "Microsoft.AspNetCore.App"; | ||
676 | break; | ||
677 | case "desktop": | ||
678 | runtimeType = "Microsoft.WindowsDesktop.App"; | ||
679 | break; | ||
680 | case "core": | ||
681 | runtimeType = "Microsoft.NETCore.App"; | ||
682 | break; | ||
683 | default: | ||
684 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, | ||
685 | attrib.Name.LocalName, runtimeType, "aspnet", "desktop", "core")); | ||
686 | break; | ||
687 | } | ||
688 | |||
689 | return runtimeType; | ||
690 | } | ||
691 | |||
692 | |||
506 | /// <summary> | 693 | /// <summary> |
507 | /// Parses a DotNetCompatibilityCheckRef element. | 694 | /// Parses a DotNetCompatibilityCheckRef element. |
508 | /// </summary> | 695 | /// </summary> |
diff --git a/src/ext/NetFx/wixext/NetfxTableDefinitions.cs b/src/ext/NetFx/wixext/NetfxTableDefinitions.cs index 6be1abe7..114275c3 100644 --- a/src/ext/NetFx/wixext/NetfxTableDefinitions.cs +++ b/src/ext/NetFx/wixext/NetfxTableDefinitions.cs | |||
@@ -40,7 +40,7 @@ namespace WixToolset.Netfx | |||
40 | public static readonly TableDefinition[] All = new[] | 40 | public static readonly TableDefinition[] All = new[] |
41 | { | 41 | { |
42 | NetFxNativeImage, | 42 | NetFxNativeImage, |
43 | NetFxDotNetCompatibilityCheck | 43 | NetFxDotNetCompatibilityCheck, |
44 | }; | 44 | }; |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs b/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs index a46cf17f..ea1b16c5 100644 --- a/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs +++ b/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs | |||
@@ -11,11 +11,11 @@ namespace WixToolset.Netfx | |||
11 | NetfxSymbolDefinitionType.NetFxDotNetCompatibilityCheck.ToString(), | 11 | NetfxSymbolDefinitionType.NetFxDotNetCompatibilityCheck.ToString(), |
12 | new[] | 12 | new[] |
13 | { | 13 | { |
14 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.RuntimeType), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbolFields.RuntimeType), IntermediateFieldType.String), |
15 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.Platform), IntermediateFieldType.String), | 15 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbolFields.Platform), IntermediateFieldType.String), |
16 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.Version), IntermediateFieldType.String), | 16 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbolFields.Version), IntermediateFieldType.String), |
17 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.RollForward), IntermediateFieldType.String), | 17 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbolFields.RollForward), IntermediateFieldType.String), |
18 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.Property), IntermediateFieldType.String), | 18 | new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbolFields.Property), IntermediateFieldType.String), |
19 | }, | 19 | }, |
20 | typeof(NetFxDotNetCompatibilityCheckSymbol)); | 20 | typeof(NetFxDotNetCompatibilityCheckSymbol)); |
21 | } | 21 | } |
@@ -25,7 +25,7 @@ namespace WixToolset.Netfx.Symbols | |||
25 | { | 25 | { |
26 | using WixToolset.Data; | 26 | using WixToolset.Data; |
27 | 27 | ||
28 | public enum NetFxDotNetCompatibilityCheckSymbollFields | 28 | public enum NetFxDotNetCompatibilityCheckSymbolFields |
29 | { | 29 | { |
30 | RuntimeType, | 30 | RuntimeType, |
31 | Platform, | 31 | Platform, |
@@ -44,36 +44,36 @@ namespace WixToolset.Netfx.Symbols | |||
44 | { | 44 | { |
45 | } | 45 | } |
46 | 46 | ||
47 | public IntermediateField this[NetFxDotNetCompatibilityCheckSymbollFields index] => this.Fields[(int)index]; | 47 | public IntermediateField this[NetFxDotNetCompatibilityCheckSymbolFields index] => this.Fields[(int)index]; |
48 | 48 | ||
49 | public string RuntimeType | 49 | public string RuntimeType |
50 | { | 50 | { |
51 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.RuntimeType].AsString(); | 51 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbolFields.RuntimeType].AsString(); |
52 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.RuntimeType, value); | 52 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbolFields.RuntimeType, value); |
53 | } | 53 | } |
54 | 54 | ||
55 | public string Platform | 55 | public string Platform |
56 | { | 56 | { |
57 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.Platform].AsString(); | 57 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbolFields.Platform].AsString(); |
58 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.Platform, value); | 58 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbolFields.Platform, value); |
59 | } | 59 | } |
60 | 60 | ||
61 | public string Version | 61 | public string Version |
62 | { | 62 | { |
63 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.Version].AsString(); | 63 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbolFields.Version].AsString(); |
64 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.Version, value); | 64 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbolFields.Version, value); |
65 | } | 65 | } |
66 | 66 | ||
67 | public string RollForward | 67 | public string RollForward |
68 | { | 68 | { |
69 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.RollForward].AsString(); | 69 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbolFields.RollForward].AsString(); |
70 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.RollForward, value); | 70 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbolFields.RollForward, value); |
71 | } | 71 | } |
72 | 72 | ||
73 | public string Property | 73 | public string Property |
74 | { | 74 | { |
75 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.Property].AsString(); | 75 | get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbolFields.Property].AsString(); |
76 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.Property, value); | 76 | set => this.Set((int)NetFxDotNetCompatibilityCheckSymbolFields.Property, value); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | } | 79 | } |
diff --git a/src/ext/NetFx/wixext/Symbols/NetFxNetCoreSearchSdkSymbol.cs b/src/ext/NetFx/wixext/Symbols/NetFxNetCoreSearchSdkSymbol.cs new file mode 100644 index 00000000..86b750ea --- /dev/null +++ b/src/ext/NetFx/wixext/Symbols/NetFxNetCoreSearchSdkSymbol.cs | |||
@@ -0,0 +1,64 @@ | |||
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 | namespace WixToolset.Netfx | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Netfx.Symbols; | ||
7 | |||
8 | public static partial class NetfxSymbolDefinitions | ||
9 | { | ||
10 | public static readonly IntermediateSymbolDefinition NetFxNetCoreSdkSearch = new IntermediateSymbolDefinition( | ||
11 | NetfxSymbolDefinitionType.NetFxNetCoreSdkSearch.ToString(), | ||
12 | new[] | ||
13 | { | ||
14 | new IntermediateFieldDefinition(nameof(NetFxNetCoreSdkSearchSymbolFields.Platform), IntermediateFieldType.Number), | ||
15 | new IntermediateFieldDefinition(nameof(NetFxNetCoreSdkSearchSymbolFields.Version), IntermediateFieldType.String), | ||
16 | }, | ||
17 | typeof(NetFxNetCoreSearchSymbol)); | ||
18 | } | ||
19 | } | ||
20 | |||
21 | namespace WixToolset.Netfx.Symbols | ||
22 | { | ||
23 | using WixToolset.Data; | ||
24 | |||
25 | |||
26 | public enum NetCoreSdkSearchPlatform | ||
27 | { | ||
28 | X86, | ||
29 | X64, | ||
30 | Arm64, | ||
31 | } | ||
32 | |||
33 | public enum NetFxNetCoreSdkSearchSymbolFields | ||
34 | { | ||
35 | Platform, | ||
36 | Version, | ||
37 | } | ||
38 | |||
39 | |||
40 | public class NetFxNetCoreSdkSearchSymbol : IntermediateSymbol | ||
41 | { | ||
42 | public NetFxNetCoreSdkSearchSymbol() : base(NetfxSymbolDefinitions.NetFxNetCoreSdkSearch, null, null) | ||
43 | { | ||
44 | } | ||
45 | |||
46 | public NetFxNetCoreSdkSearchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(NetfxSymbolDefinitions.NetFxNetCoreSdkSearch, sourceLineNumber, id) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | public IntermediateField this[NetFxNetCoreSdkSearchSymbolFields index] => this.Fields[(int)index]; | ||
51 | |||
52 | public NetCoreSdkSearchPlatform Platform | ||
53 | { | ||
54 | get => (NetCoreSdkSearchPlatform)this.Fields[(int)NetFxNetCoreSdkSearchSymbolFields.Platform].AsNumber(); | ||
55 | set => this.Set((int)NetFxNetCoreSdkSearchSymbolFields.Platform, (int)value); | ||
56 | } | ||
57 | |||
58 | public string Version | ||
59 | { | ||
60 | get => this.Fields[(int)NetFxNetCoreSdkSearchSymbolFields.Version].AsString(); | ||
61 | set => this.Set((int)NetFxNetCoreSdkSearchSymbolFields.Version, value); | ||
62 | } | ||
63 | } | ||
64 | } | ||
diff --git a/src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs b/src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs index ad729dd4..00c52f9e 100644 --- a/src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs +++ b/src/ext/NetFx/wixext/Symbols/NetfxSymbolDefinitions.cs | |||
@@ -10,7 +10,8 @@ namespace WixToolset.Netfx | |||
10 | { | 10 | { |
11 | NetFxNativeImage, | 11 | NetFxNativeImage, |
12 | NetFxNetCoreSearch, | 12 | NetFxNetCoreSearch, |
13 | NetFxDotNetCompatibilityCheck | 13 | NetFxNetCoreSdkSearch, |
14 | NetFxDotNetCompatibilityCheck, | ||
14 | } | 15 | } |
15 | 16 | ||
16 | public static partial class NetfxSymbolDefinitions | 17 | public static partial class NetfxSymbolDefinitions |
@@ -36,7 +37,10 @@ namespace WixToolset.Netfx | |||
36 | 37 | ||
37 | case NetfxSymbolDefinitionType.NetFxNetCoreSearch: | 38 | case NetfxSymbolDefinitionType.NetFxNetCoreSearch: |
38 | return NetfxSymbolDefinitions.NetFxNetCoreSearch; | 39 | return NetfxSymbolDefinitions.NetFxNetCoreSearch; |
39 | 40 | ||
41 | case NetfxSymbolDefinitionType.NetFxNetCoreSdkSearch: | ||
42 | return NetfxSymbolDefinitions.NetFxNetCoreSdkSearch; | ||
43 | |||
40 | case NetfxSymbolDefinitionType.NetFxDotNetCompatibilityCheck: | 44 | case NetfxSymbolDefinitionType.NetFxDotNetCompatibilityCheck: |
41 | return NetfxSymbolDefinitions.NetFxDotNetCompatibilityCheck; | 45 | return NetfxSymbolDefinitions.NetFxDotNetCompatibilityCheck; |
42 | 46 | ||
@@ -48,6 +52,7 @@ namespace WixToolset.Netfx | |||
48 | static NetfxSymbolDefinitions() | 52 | static NetfxSymbolDefinitions() |
49 | { | 53 | { |
50 | NetFxNetCoreSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); | 54 | NetFxNetCoreSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); |
55 | NetFxNetCoreSdkSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); | ||
51 | } | 56 | } |
52 | } | 57 | } |
53 | } | 58 | } |
diff --git a/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6.0.9_x86.wxs b/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6.0.9_x86.wxs index 6bfef872..c2232674 100644 --- a/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6.0.9_x86.wxs +++ b/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6.0.9_x86.wxs | |||
@@ -5,11 +5,15 @@ | |||
5 | <?define NetCorePlatform = x86?> | 5 | <?define NetCorePlatform = x86?> |
6 | <?define NetCoreIdVersion = 609?> | 6 | <?define NetCoreIdVersion = 609?> |
7 | <?define NetCoreVersion = 6.0.9?> | 7 | <?define NetCoreVersion = 6.0.9?> |
8 | <?define NetCoreSdkPlatform = x86?> | ||
9 | <?define NetCoreSdkIdVersion = 60403?> | ||
10 | <?define NetCoreSdkVersion = 6.0.403?> | ||
8 | <?include NetCore6_Platform.wxi?> | 11 | <?include NetCore6_Platform.wxi?> |
9 | 12 | ||
10 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/8f583028-b802-4661-b8dd-47139b0561ce/3c0cd3bdc6051759ccae40f78982c86e/aspnetcore-runtime-6.0.9-win-x86.exe?> | 13 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/8f583028-b802-4661-b8dd-47139b0561ce/3c0cd3bdc6051759ccae40f78982c86e/aspnetcore-runtime-6.0.9-win-x86.exe?> |
11 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/925f9407-2767-4341-857a-43cdfad71e17/0b84db913bdbb1dcf02db937a3cd3f63/windowsdesktop-runtime-6.0.9-win-x86.exe?> | 14 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/925f9407-2767-4341-857a-43cdfad71e17/0b84db913bdbb1dcf02db937a3cd3f63/windowsdesktop-runtime-6.0.9-win-x86.exe?> |
12 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/6020f3fc-5cf8-4e25-bc7f-dcf8744137ac/4cb5ced4e015e426fddc554b130c3052/dotnet-runtime-6.0.9-win-x86.exe?> | 15 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/6020f3fc-5cf8-4e25-bc7f-dcf8744137ac/4cb5ced4e015e426fddc554b130c3052/dotnet-runtime-6.0.9-win-x86.exe?> |
16 | <?define DotNetCoreSdkRedistLink = https://download.visualstudio.microsoft.com/download/pr/c2bf9927-2746-4126-b839-1080b360f348/17191138699683165a20fde56571f433/dotnet-sdk-6.0.403-win-x86.exe?> | ||
13 | 17 | ||
14 | <Fragment> | 18 | <Fragment> |
15 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="6" Variable="$(var.AspNetCoreId)" /> | 19 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="6" Variable="$(var.AspNetCoreId)" /> |
@@ -55,4 +59,19 @@ | |||
55 | </ExePackage> | 59 | </ExePackage> |
56 | </PackageGroup> | 60 | </PackageGroup> |
57 | </Fragment> | 61 | </Fragment> |
62 | |||
63 | <Fragment> | ||
64 | <netfx:DotNetCoreSdkSearch Id="$(var.DotNetCoreSdkId)" Platform="$(var.NetCoreSdkPlatform)" Version="6.0.200" Variable="$(var.DotNetCoreSdkId)" /> | ||
65 | |||
66 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition" Value="$(var.DotNetCoreSdkId) >= v$(var.NetCoreSdkVersion)" Overridable="yes" /> | ||
67 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition" Value="" Overridable="yes" /> | ||
68 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory" Value="redist\" Overridable="yes" /> | ||
69 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)RepairArguments" Value="" Overridable="yes" /> | ||
70 | |||
71 | <PackageGroup Id="$(var.DotNetCoreSdkRedistId)"> | ||
72 | <ExePackage CacheId="$(var.DotNetCoreSdkRedistId)_2485A7AFA98E178CB8F30C9838346B514AEA4769" InstallArguments="$(var.DotNetCoreSdkRedistInstallArguments)" PerMachine="yes" DetectCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition)" InstallCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition)" Id="$(var.DotNetCoreSdkRedistId)" Vital="yes" Permanent="yes" Protocol="burn" LogPathVariable="$(var.DotNetCoreSdkRedistLog)" Cache="remove"> | ||
73 | <ExePackagePayload Name="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory)dotnet-sdk-$(var.NetCoreSdkVersion)-win-$(var.NetCoreSdkPlatform).exe" DownloadUrl="$(var.DotNetCoreSdkRedistLink)" ProductName="Microsoft .NET 6.0 SDK - 6.0.403 (x86)" Description="Microsoft .NET SDK - 6.0.403 (x86)" CertificatePublicKey="3756E9BBF4461DCD0AA68E0D1FCFFA9CEA47AC18" CertificateThumbprint="2485A7AFA98E178CB8F30C9838346B514AEA4769" Size="194236520" Version="6.0.403" /> | ||
74 | </ExePackage> | ||
75 | </PackageGroup> | ||
76 | </Fragment> | ||
58 | </Wix> | 77 | </Wix> |
diff --git a/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6_Platform.wxi b/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6_Platform.wxi index d508bcaf..8f084b43 100644 --- a/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6_Platform.wxi +++ b/src/test/burn/TestData/TestBA/TestBAWixlib/NetCore6_Platform.wxi | |||
@@ -21,6 +21,12 @@ | |||
21 | <?define DotNetCoreRedistInstallArguments = /install /quiet /log "[$(var.DotNetCoreRedistLog)]"?> | 21 | <?define DotNetCoreRedistInstallArguments = /install /quiet /log "[$(var.DotNetCoreRedistLog)]"?> |
22 | <?define DotNetCoreRedistUninstallArguments = /uninstall /quiet /log "[$(var.DotNetCoreRedistLog)]"?> | 22 | <?define DotNetCoreRedistUninstallArguments = /uninstall /quiet /log "[$(var.DotNetCoreRedistLog)]"?> |
23 | 23 | ||
24 | <?define DotNetCoreSdkId = DOTNETCORERUNTIME6_$(var.NetCoreSdkPlatform)?> | ||
25 | <?define DotNetCoreSdkRedistId = DotNetCoreRuntime$(var.NetCoreIdVersion)Redist_$(var.NetCoreSdkPlatform)?> | ||
26 | <?define DotNetCoreSdkRedistLog = DotNetCoreRuntime$(var.NetCoreSdkIdVersion)RedistLog?> | ||
27 | <?define DotNetCoreSdkRedistInstallArguments = /install /quiet /log "[$(var.DotNetCoreSdkRedistLog)]"?> | ||
28 | <?define DotNetCoreSdkRedistUninstallArguments = /uninstall /quiet /log "[$(var.DotNetCoreSdkRedistLog)]"?> | ||
29 | |||
24 | <?define NetCoreEulaLink = https://go.microsoft.com/fwlink/?LinkId=329770?> | 30 | <?define NetCoreEulaLink = https://go.microsoft.com/fwlink/?LinkId=329770?> |
25 | 31 | ||
26 | <Fragment> | 32 | <Fragment> |
@@ -46,4 +52,12 @@ | |||
46 | 52 | ||
47 | <bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.DotNetCoreRedistId)" LicenseUrl="$(var.NetCoreEulaLink)" /> | 53 | <bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.DotNetCoreRedistId)" LicenseUrl="$(var.NetCoreEulaLink)" /> |
48 | </Fragment> | 54 | </Fragment> |
55 | |||
56 | <Fragment> | ||
57 | <PackageGroup Id="$(var.DotNetCoreSdkRedistId)AsPrereq"> | ||
58 | <PackageGroupRef Id="$(var.DotNetCoreSdkRedistId)" /> | ||
59 | </PackageGroup> | ||
60 | |||
61 | <bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.DotNetCoreSdkRedistId)" LicenseUrl="$(var.NetCoreEulaLink)" /> | ||
62 | </Fragment> | ||
49 | </Include> | 63 | </Include> |
diff --git a/src/test/burn/TestData/TestBA/TestBAWixlib_x64/NetCore6.0.9_x64.wxs b/src/test/burn/TestData/TestBA/TestBAWixlib_x64/NetCore6.0.9_x64.wxs index f2345693..e9ccdc51 100644 --- a/src/test/burn/TestData/TestBA/TestBAWixlib_x64/NetCore6.0.9_x64.wxs +++ b/src/test/burn/TestData/TestBA/TestBAWixlib_x64/NetCore6.0.9_x64.wxs | |||
@@ -5,11 +5,15 @@ | |||
5 | <?define NetCorePlatform = x64?> | 5 | <?define NetCorePlatform = x64?> |
6 | <?define NetCoreIdVersion = 609?> | 6 | <?define NetCoreIdVersion = 609?> |
7 | <?define NetCoreVersion = 6.0.9?> | 7 | <?define NetCoreVersion = 6.0.9?> |
8 | <?define NetCoreSdkPlatform = x64?> | ||
9 | <?define NetCoreSdkIdVersion = 60403?> | ||
10 | <?define NetCoreSdkVersion = 6.0.403?> | ||
8 | <?include ..\TestBAWixlib\NetCore6_Platform.wxi?> | 11 | <?include ..\TestBAWixlib\NetCore6_Platform.wxi?> |
9 | 12 | ||
10 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/98dbe241-8b77-4be0-b130-a5fb6af8d724/27b655adce6250da42be9440abe847a2/aspnetcore-runtime-6.0.9-win-x64.exe?> | 13 | <?define AspNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/98dbe241-8b77-4be0-b130-a5fb6af8d724/27b655adce6250da42be9440abe847a2/aspnetcore-runtime-6.0.9-win-x64.exe?> |
11 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/fe8415d4-8a35-4af9-80a5-51306a96282d/05f9b2a1b4884238e69468e49b3a5453/windowsdesktop-runtime-6.0.9-win-x64.exe?> | 14 | <?define DesktopNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/fe8415d4-8a35-4af9-80a5-51306a96282d/05f9b2a1b4884238e69468e49b3a5453/windowsdesktop-runtime-6.0.9-win-x64.exe?> |
12 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/9dc77a6b-0276-4ad5-9bfa-d84b546686ef/f01bbcf2dc0e7f5dbd0a7d337fd4cd43/dotnet-runtime-6.0.9-win-x64.exe?> | 15 | <?define DotNetCoreRedistLink = https://download.visualstudio.microsoft.com/download/pr/9dc77a6b-0276-4ad5-9bfa-d84b546686ef/f01bbcf2dc0e7f5dbd0a7d337fd4cd43/dotnet-runtime-6.0.9-win-x64.exe?> |
16 | <?define DotNetCoreSdkRedistLink = https://download.visualstudio.microsoft.com/download/pr/08ada4db-1e64-4829-b36d-5beb71f67bff/b77050cf7e0c71d3b95418651db1a9b8/dotnet-sdk-6.0.403-win-x64.exe?> | ||
13 | 17 | ||
14 | <Fragment> | 18 | <Fragment> |
15 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="6" Variable="$(var.AspNetCoreId)" /> | 19 | <netfx:DotNetCoreSearch Id="$(var.AspNetCoreId)" RuntimeType="aspnet" Platform="$(var.NetCorePlatform)" MajorVersion="6" Variable="$(var.AspNetCoreId)" /> |
@@ -55,4 +59,19 @@ | |||
55 | </ExePackage> | 59 | </ExePackage> |
56 | </PackageGroup> | 60 | </PackageGroup> |
57 | </Fragment> | 61 | </Fragment> |
62 | |||
63 | <Fragment> | ||
64 | <netfx:DotNetCoreSdkSearch Id="$(var.DotNetCoreSdkId)" Platform="$(var.NetCoreSdkPlatform)" Version="6.0.200" Variable="$(var.DotNetCoreSdkId)" /> | ||
65 | |||
66 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition" Value="$(var.DotNetCoreSdkId) >= v$(var.NetCoreSdkVersion)" Overridable="yes" /> | ||
67 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition" Value="" Overridable="yes" /> | ||
68 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory" Value="redist\" Overridable="yes" /> | ||
69 | <WixVariable Id="DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)RepairArguments" Value="" Overridable="yes" /> | ||
70 | |||
71 | <PackageGroup Id="$(var.DotNetCoreSdkRedistId)"> | ||
72 | <ExePackage CacheId="$(var.DotNetCoreSdkRedistId)_2485A7AFA98E178CB8F30C9838346B514AEA4769" InstallArguments="$(var.DotNetCoreSdkRedistInstallArguments)" PerMachine="yes" DetectCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)DetectCondition)" InstallCondition="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)InstallCondition)" Id="$(var.DotNetCoreSdkRedistId)" Vital="yes" Permanent="yes" Protocol="burn" LogPathVariable="$(var.DotNetCoreSdkRedistLog)" Cache="remove"> | ||
73 | <ExePackagePayload Name="!(wix.DotNetCoreSdk$(var.NetCoreSdkIdVersion)Redist$(var.NetCoreSdkPlatform)PackageDirectory)dotnet-sdk-$(var.NetCoreSdkVersion)-win-$(var.NetCoreSdkPlatform).exe" DownloadUrl="$(var.DotNetCoreSdkRedistLink)" ProductName="Microsoft .NET 6.0 SDK - 6.0.403 (x64)" Description="Microsoft .NET SDK - 6.0.403 (x64)" CertificatePublicKey="3756E9BBF4461DCD0AA68E0D1FCFFA9CEA47AC18" CertificateThumbprint="2485A7AFA98E178CB8F30C9838346B514AEA4769" Size="205722192" Version="6.0.403" /> | ||
74 | </ExePackage> | ||
75 | </PackageGroup> | ||
76 | </Fragment> | ||
58 | </Wix> | 77 | </Wix> |