aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-07-10 18:01:40 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-07-10 22:10:26 +1000
commitaf43f098d7d7cc0fe21c7d7b0fe991763e9cae07 (patch)
treec7c03081845e570482d2e78647637c793fc991c1
parent7f7545f382bb9b885c9bfe894c51e66b443cef25 (diff)
downloadwix-af43f098d7d7cc0fe21c7d7b0fe991763e9cae07.tar.gz
wix-af43f098d7d7cc0fe21c7d7b0fe991763e9cae07.tar.bz2
wix-af43f098d7d7cc0fe21c7d7b0fe991763e9cae07.zip
Add x64 and ARM64 versions of UtilBundleExtension.
-rw-r--r--global.json2
-rw-r--r--src/be/UtilBundleExtension.h2
-rw-r--r--src/be/beDecor.h13
-rw-r--r--src/be/precomp.h1
-rw-r--r--src/be/utilbe.vcxproj25
-rw-r--r--src/test/WixToolsetTest.Util/UtilExtensionFixture.cs8
-rw-r--r--src/wixext/UtilCompiler.cs13
-rw-r--r--src/wixext/UtilConstants.cs2
-rw-r--r--src/wixlib/UtilBundleExtension_Platform.wxi10
-rw-r--r--src/wixlib/UtilBundleExtension_arm64.wxs7
-rw-r--r--src/wixlib/UtilBundleExtension_x64.wxs7
-rw-r--r--src/wixlib/UtilBundleExtension_x86.wxs7
-rw-r--r--src/wixlib/util.wixproj4
13 files changed, 88 insertions, 13 deletions
diff --git a/global.json b/global.json
index 7a995d0a..32c1b11f 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
1{ 1{
2 "msbuild-sdks": { 2 "msbuild-sdks": {
3 "WixToolset.Sdk": "4.0.0-build-0143" 3 "WixToolset.Sdk": "4.0.0-build-0145"
4 } 4 }
5} 5}
diff --git a/src/be/UtilBundleExtension.h b/src/be/UtilBundleExtension.h
index 16c5b346..c55d6b85 100644
--- a/src/be/UtilBundleExtension.h
+++ b/src/be/UtilBundleExtension.h
@@ -4,7 +4,7 @@
4 4
5// constants 5// constants
6 6
7#define UTIL_BUNDLE_EXTENSION_ID L"WixUtilBundleExtension" 7#define UTIL_BUNDLE_EXTENSION_ID BUNDLE_EXTENSION_DECORATION(L"UtilBundleExtension")
8 8
9 9
10// function declarations 10// function declarations
diff --git a/src/be/beDecor.h b/src/be/beDecor.h
new file mode 100644
index 00000000..2c6a8818
--- /dev/null
+++ b/src/be/beDecor.h
@@ -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
diff --git a/src/be/precomp.h b/src/be/precomp.h
index a4ab7abf..76d24c7b 100644
--- a/src/be/precomp.h
+++ b/src/be/precomp.h
@@ -31,6 +31,7 @@
31#include <bextutil.h> 31#include <bextutil.h>
32#include <BextBundleExtensionEngine.h> 32#include <BextBundleExtensionEngine.h>
33 33
34#include "beDecor.h"
34#include "utilsearch.h" 35#include "utilsearch.h"
35#include "detectsha2support.h" 36#include "detectsha2support.h"
36#include "UtilBundleExtension.h" 37#include "UtilBundleExtension.h"
diff --git a/src/be/utilbe.vcxproj b/src/be/utilbe.vcxproj
index b60fcf9f..3675ccc0 100644
--- a/src/be/utilbe.vcxproj
+++ b/src/be/utilbe.vcxproj
@@ -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')" /> 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')" /> 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"> 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>
11 <ProjectConfiguration Include="Debug|Win32"> 35 <ProjectConfiguration Include="Debug|Win32">
12 <Configuration>Debug</Configuration> 36 <Configuration>Debug</Configuration>
13 <Platform>Win32</Platform> 37 <Platform>Win32</Platform>
@@ -41,6 +65,7 @@
41 <ClCompile Include="utilsearch.cpp" /> 65 <ClCompile Include="utilsearch.cpp" />
42 </ItemGroup> 66 </ItemGroup>
43 <ItemGroup> 67 <ItemGroup>
68 <ClInclude Include="beDecor.h" />
44 <ClInclude Include="detectsha2support.h" /> 69 <ClInclude Include="detectsha2support.h" />
45 <ClInclude Include="precomp.h" /> 70 <ClInclude Include="precomp.h" />
46 <ClInclude Include="UtilBundleExtension.h" /> 71 <ClInclude Include="UtilBundleExtension.h" />
diff --git a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs
index 9c83209b..aa03d068 100644
--- a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs
+++ b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs
@@ -85,7 +85,7 @@ namespace WixToolsetTest.Util
85 "CustomAction:Wix4CreateInternetShortcuts_X64\t3073\tWix4UtilCA_X64\tWixCreateInternetShortcuts\t", 85 "CustomAction:Wix4CreateInternetShortcuts_X64\t3073\tWix4UtilCA_X64\tWixCreateInternetShortcuts\t",
86 "CustomAction:Wix4RollbackInternetShortcuts_X64\t3329\tWix4UtilCA_X64\tWixRollbackInternetShortcuts\t", 86 "CustomAction:Wix4RollbackInternetShortcuts_X64\t3329\tWix4UtilCA_X64\tWixRollbackInternetShortcuts\t",
87 "CustomAction:Wix4SchedInternetShortcuts_X64\t1\tWix4UtilCA_X64\tWixSchedInternetShortcuts\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", 89 "Wix4InternetShortcut:wixshortcut\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tINSTALLFOLDER\tWiX Toolset.lnk\thttps://wixtoolset.org\t0\t\t0",
90 }, results.OrderBy(s => s).ToArray()); 90 }, results.OrderBy(s => s).ToArray());
91 } 91 }
@@ -169,16 +169,16 @@ namespace WixToolsetTest.Util
169 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); 169 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
170 extractResult.AssertSuccess(); 170 extractResult.AssertSuccess();
171 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); 173 Assert.Equal(1, bundleExtensionDatas.Count);
174 Assert.Equal("<BundleExtension Id='WixUtilBundleExtension'>" + 174 Assert.Equal("<BundleExtension Id='Wix4UtilBundleExtension_X86'>" +
175 "<WixDetectSHA2Support Id='DetectSHA2SupportId' />" + 175 "<WixDetectSHA2Support Id='DetectSHA2SupportId' />" +
176 "</BundleExtension>", bundleExtensionDatas[0].GetTestXml()); 176 "</BundleExtension>", bundleExtensionDatas[0].GetTestXml());
177 177
178 var utilSearches = extractResult.SelectManifestNodes("/burn:BurnManifest/*[self::burn:ExtensionSearch or self::burn:FileSearch or self::burn:MsiProductSearch or self::burn:RegistrySearch]"); 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); 179 Assert.Equal(4, utilSearches.Count);
180 Assert.Equal("<ExtensionSearch Id='DetectSHA2SupportId' Variable='IsSHA2Supported' " + 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' " + 182 Assert.Equal("<FileSearch Id='FileSearchId' Variable='FileSearchVariable' " +
183 $@"Path='%windir%\System32\mscoree.dll' Type='exists' />", utilSearches[1].GetTestXml()); 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' " + 184 Assert.Equal("<MsiProductSearch Id='ProductSearchId' Variable='ProductSearchVariable' Condition='1 &amp; 2 &lt; 3' " +
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs
index acd96e15..a5745b6c 100644
--- a/src/wixext/UtilCompiler.cs
+++ b/src/wixext/UtilCompiler.cs
@@ -549,7 +549,13 @@ namespace WixToolset.Util
549 549
550 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); 550 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
551 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);
553 559
554 if (!this.Messaging.EncounteredError) 560 if (!this.Messaging.EncounteredError)
555 { 561 {
@@ -1498,10 +1504,9 @@ namespace WixToolset.Util
1498 section.AddSymbol(new RemoveFileSymbol(sourceLineNumbers, shortcutId) 1504 section.AddSymbol(new RemoveFileSymbol(sourceLineNumbers, shortcutId)
1499 { 1505 {
1500 ComponentRef = componentId, 1506 ComponentRef = componentId,
1501 DirProperty = directoryId, 1507 DirPropertyRef = directoryId,
1502 OnUninstall = true, 1508 OnUninstall = true,
1503 // TODO: A better way? 1509 FileName = name,
1504 FileName = this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name),
1505 }); 1510 });
1506 } 1511 }
1507 1512
diff --git a/src/wixext/UtilConstants.cs b/src/wixext/UtilConstants.cs
index d9ad460f..28ff368f 100644
--- a/src/wixext/UtilConstants.cs
+++ b/src/wixext/UtilConstants.cs
@@ -13,7 +13,5 @@ namespace WixToolset.Util
13 internal static readonly string[] RegistryPermissions = { "Read", "Write", "CreateSubkeys", "EnumerateSubkeys", "Notify", "CreateLink" }; 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" }; 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" }; 15 internal static readonly string[] StandardPermissions = { "Delete", "ReadPermission", "ChangePermission", "TakeOwnership", "Synchronize" };
16
17 internal const string UtilBundleExtensionId = "WixUtilBundleExtension";
18 } 16 }
19} 17}
diff --git a/src/wixlib/UtilBundleExtension_Platform.wxi b/src/wixlib/UtilBundleExtension_Platform.wxi
new file mode 100644
index 00000000..379c8f57
--- /dev/null
+++ b/src/wixlib/UtilBundleExtension_Platform.wxi
@@ -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>
diff --git a/src/wixlib/UtilBundleExtension_arm64.wxs b/src/wixlib/UtilBundleExtension_arm64.wxs
new file mode 100644
index 00000000..b17be031
--- /dev/null
+++ b/src/wixlib/UtilBundleExtension_arm64.wxs
@@ -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>
diff --git a/src/wixlib/UtilBundleExtension_x64.wxs b/src/wixlib/UtilBundleExtension_x64.wxs
new file mode 100644
index 00000000..96c85a5b
--- /dev/null
+++ b/src/wixlib/UtilBundleExtension_x64.wxs
@@ -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>
diff --git a/src/wixlib/UtilBundleExtension_x86.wxs b/src/wixlib/UtilBundleExtension_x86.wxs
new file mode 100644
index 00000000..3b458687
--- /dev/null
+++ b/src/wixlib/UtilBundleExtension_x86.wxs
@@ -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>
diff --git a/src/wixlib/util.wixproj b/src/wixlib/util.wixproj
index a4d7d16f..21fcdb7b 100644
--- a/src/wixlib/util.wixproj
+++ b/src/wixlib/util.wixproj
@@ -14,7 +14,9 @@
14 </ItemGroup> 14 </ItemGroup>
15 15
16 <ItemGroup> 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" />
18 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=ARM" /> 20 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=ARM" />
19 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=ARM64" /> 21 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=ARM64" />
20 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=x86" /> 22 <ProjectReference Include="..\ca\utilca.vcxproj" Properties="Platform=x86" />