@joebigelow / wix / commits / af43f098

Add x64 and ARM64 versions of UtilBundleExtension.

Sean Hall committed Jul 10, 2020 at 18:01 UTC af43f098d7d7cc0fe21c7d7b0fe991763e9cae07
13 files changed +88 -13
global.json
+1 -1
@@ -1,5 +1,5 @@
1 {
2 "msbuild-sdks": {
3 - "WixToolset.Sdk": "4.0.0-build-0143"
3 + "WixToolset.Sdk": "4.0.0-build-0145"
4 }
5 }
src/be/UtilBundleExtension.h
+1 -1
@@ -4,7 +4,7 @@
4
5 // constants
6
7 -#define UTIL_BUNDLE_EXTENSION_ID L"WixUtilBundleExtension"
7 +#define UTIL_BUNDLE_EXTENSION_ID BUNDLE_EXTENSION_DECORATION(L"UtilBundleExtension")
8
9
10 // function declarations
src/be/beDecor.h new
+13
@@ -0,0 +1,13 @@
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 +#if defined(_M_ARM64)
6 +#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_A64"
7 +#elif defined(_M_AMD64)
8 +#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_X64"
9 +#elif defined(_M_ARM)
10 +#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_ARM"
11 +#else
12 +#define BUNDLE_EXTENSION_DECORATION(f) L"Wix4" f L"_X86"
13 +#endif
src/be/precomp.h
+1
@@ -31,6 +31,7 @@
31 #include <bextutil.h>
32 #include <BextBundleExtensionEngine.h>
33
34 +#include "beDecor.h"
35 #include "utilsearch.h"
36 #include "detectsha2support.h"
37 #include "UtilBundleExtension.h"
src/be/utilbe.vcxproj
+25
@@ -8,6 +8,30 @@
8 <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.16\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.16\build\WixToolset.BootstrapperCore.Native.props')" />
9 <Import Project="..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.30\build\WixToolset.DUtil.props')" />
10 <ItemGroup Label="ProjectConfigurations">
11 + <ProjectConfiguration Include="Debug|ARM">
12 + <Configuration>Debug</Configuration>
13 + <Platform>ARM</Platform>
14 + </ProjectConfiguration>
15 + <ProjectConfiguration Include="Release|ARM">
16 + <Configuration>Release</Configuration>
17 + <Platform>ARM</Platform>
18 + </ProjectConfiguration>
19 + <ProjectConfiguration Include="Debug|ARM64">
20 + <Configuration>Debug</Configuration>
21 + <Platform>ARM64</Platform>
22 + </ProjectConfiguration>
23 + <ProjectConfiguration Include="Release|ARM64">
24 + <Configuration>Release</Configuration>
25 + <Platform>ARM64</Platform>
26 + </ProjectConfiguration>
27 + <ProjectConfiguration Include="Debug|X64">
28 + <Configuration>Debug</Configuration>
29 + <Platform>X64</Platform>
30 + </ProjectConfiguration>
31 + <ProjectConfiguration Include="Release|X64">
32 + <Configuration>Release</Configuration>
33 + <Platform>X64</Platform>
34 + </ProjectConfiguration>
35 <ProjectConfiguration Include="Debug|Win32">
36 <Configuration>Debug</Configuration>
37 <Platform>Win32</Platform>
@@ -41,6 +65,7 @@
65 <ClCompile Include="utilsearch.cpp" />
66 </ItemGroup>
67 <ItemGroup>
68 + <ClInclude Include="beDecor.h" />
69 <ClInclude Include="detectsha2support.h" />
70 <ClInclude Include="precomp.h" />
71 <ClInclude Include="UtilBundleExtension.h" />
src/test/WixToolsetTest.Util/UtilExtensionFixture.cs
+4 -4
@@ -85,7 +85,7 @@ namespace WixToolsetTest.Util
85 "CustomAction:Wix4CreateInternetShortcuts_X64\t3073\tWix4UtilCA_X64\tWixCreateInternetShortcuts\t",
86 "CustomAction:Wix4RollbackInternetShortcuts_X64\t3329\tWix4UtilCA_X64\tWixRollbackInternetShortcuts\t",
87 "CustomAction:Wix4SchedInternetShortcuts_X64\t1\tWix4UtilCA_X64\tWixSchedInternetShortcuts\t",
88 - "RemoveFile:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tvtpzs3bw.lnk|WiX Toolset.lnk\tINSTALLFOLDER\t2",
88 + "RemoveFile:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tzf9nskwi.lnk|WiX Toolset.lnk\tINSTALLFOLDER\t2",
89 "Wix4InternetShortcut:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tINSTALLFOLDER\tWiX Toolset.lnk\thttps://wixtoolset.org\t0\t\t0",
90 }, results.OrderBy(s => s).ToArray());
91 }
@@ -169,16 +169,16 @@ namespace WixToolsetTest.Util
169 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
170 extractResult.AssertSuccess();
171
172 - var bundleExtensionDatas = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='WixUtilBundleExtension']");
172 + var bundleExtensionDatas = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='Wix4UtilBundleExtension_X86']");
173 Assert.Equal(1, bundleExtensionDatas.Count);
174 - Assert.Equal("<BundleExtension Id='WixUtilBundleExtension'>" +
174 + Assert.Equal("<BundleExtension Id='Wix4UtilBundleExtension_X86'>" +
175 "<WixDetectSHA2Support Id='DetectSHA2SupportId' />" +
176 "</BundleExtension>", bundleExtensionDatas[0].GetTestXml());
177
178 var utilSearches = extractResult.SelectManifestNodes("/burn:BurnManifest/*[self::burn:ExtensionSearch or self::burn:FileSearch or self::burn:MsiProductSearch or self::burn:RegistrySearch]");
179 Assert.Equal(4, utilSearches.Count);
180 Assert.Equal("<ExtensionSearch Id='DetectSHA2SupportId' Variable='IsSHA2Supported' " +
181 - "ExtensionId='WixUtilBundleExtension' />", utilSearches[0].GetTestXml());
181 + "ExtensionId='Wix4UtilBundleExtension_X86' />", utilSearches[0].GetTestXml());
182 Assert.Equal("<FileSearch Id='FileSearchId' Variable='FileSearchVariable' " +
183 $@"Path='%windir%\System32\mscoree.dll' Type='exists' />", utilSearches[1].GetTestXml());
184 Assert.Equal("<MsiProductSearch Id='ProductSearchId' Variable='ProductSearchVariable' Condition='1 &amp; 2 &lt; 3' " +
src/wixext/UtilCompiler.cs
+9 -4
@@ -549,7 +549,13 @@ namespace WixToolset.Util
549
550 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
551
552 - this.ParseHelper.CreateWixSearchSymbol(section, sourceLineNumbers, element.Name.LocalName, id, variable, condition, after, UtilConstants.UtilBundleExtensionId);
552 + var bundleExtensionId = this.ParseHelper.CreateIdentifierValueFromPlatform("Wix4UtilBundleExtension", this.Context.Platform, BurnPlatforms.X86 | BurnPlatforms.X64 | BurnPlatforms.ARM64);
553 + if (bundleExtensionId == null)
554 + {
555 + this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), element.Name.LocalName));
556 + }
557 +
558 + this.ParseHelper.CreateWixSearchSymbol(section, sourceLineNumbers, element.Name.LocalName, id, variable, condition, after, bundleExtensionId);
559
560 if (!this.Messaging.EncounteredError)
561 {
@@ -1498,10 +1504,9 @@ namespace WixToolset.Util
1504 section.AddSymbol(new RemoveFileSymbol(sourceLineNumbers, shortcutId)
1505 {
1506 ComponentRef = componentId,
1501 - DirProperty = directoryId,
1507 + DirPropertyRef = directoryId,
1508 OnUninstall = true,
1503 - // TODO: A better way?
1504 - FileName = this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name),
1509 + FileName = name,
1510 });
1511 }
1512
src/wixext/UtilConstants.cs
-2
@@ -13,7 +13,5 @@ namespace WixToolset.Util
13 internal static readonly string[] RegistryPermissions = { "Read", "Write", "CreateSubkeys", "EnumerateSubkeys", "Notify", "CreateLink" };
14 internal static readonly string[] ServicePermissions = { "ServiceQueryConfig", "ServiceChangeConfig", "ServiceQueryStatus", "ServiceEnumerateDependents", "ServiceStart", "ServiceStop", "ServicePauseContinue", "ServiceInterrogate", "ServiceUserDefinedControl" };
15 internal static readonly string[] StandardPermissions = { "Delete", "ReadPermission", "ChangePermission", "TakeOwnership", "Synchronize" };
16 -
17 - internal const string UtilBundleExtensionId = "WixUtilBundleExtension";
16 }
17 }
src/wixlib/UtilBundleExtension_Platform.wxi new
+10
@@ -0,0 +1,10 @@
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 +
4 +<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 + <?include caDecor.wxi ?>
6 +
7 + <Fragment>
8 + <BundleExtension Id="$(var.Prefix)UtilBundleExtension$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))utilbe.dll" Name="$(var.Prefix)UtilBundleExtension$(var.Suffix)\utilbe.dll" />
9 + </Fragment>
10 +</Include>
src/wixlib/UtilBundleExtension_arm64.wxs new
+7
@@ -0,0 +1,7 @@
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 +
4 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 + <?define platform=arm64 ?>
6 + <?include UtilBundleExtension_Platform.wxi ?>
7 +</Wix>
src/wixlib/UtilBundleExtension_x64.wxs new
+7
@@ -0,0 +1,7 @@
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 +
4 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 + <?define platform=x64 ?>
6 + <?include UtilBundleExtension_Platform.wxi ?>
7 +</Wix>
src/wixlib/UtilBundleExtension_x86.wxs new
+7
@@ -0,0 +1,7 @@
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 +
4 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 + <?define platform=x86 ?>
6 + <?include UtilBundleExtension_Platform.wxi ?>
7 +</Wix>
src/wixlib/util.wixproj
+3 -1
@@ -14,7 +14,9 @@
14 </ItemGroup>
15
16 <ItemGroup>
17 - <ProjectReference Include="..\be\utilbe.vcxproj" />
17 + <ProjectReference Include="..\be\utilbe.vcxproj" Properties="Platform=ARM64" />
18 + <ProjectReference Include="..\be\utilbe.vcxproj" Properties="Platform=x86" />
19 + <ProjectReference Include="..\be\utilbe.vcxproj" Properties="Platform=x64" />
20 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=ARM" />
21 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=ARM64" />
22 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=x86" />