Version extension ids.
Partial fix for wixtoolset/issues#5933.
Bob Arnson committed
Mar 9, 2020 at 13:47 UTC
1e63f31a2b8caf3a81f619d0786efddb0173ab05
10 files changed
+85
-50
src/ca/caDecor.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 CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_A64"
7
+#elif defined(_M_AMD64)
8
+#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X64"
9
+#elif defined(_M_ARM)
10
+#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_ARM"
11
+#else
12
+#define CUSTOM_ACTION_DECORATION(f) L"Wix4" f L"_X86"
13
+#endif
src/ca/precomp.h
+1
@@ -10,4 +10,5 @@
10
#include "strutil.h"
11
#include "pathutil.h"
12
13
+#include "caDecor.h"
14
#include "cost.h"
src/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs
+2
-2
@@ -16,10 +16,10 @@ namespace WixToolsetTest.Netfx
16
var folder = TestData.Get(@"TestData\UsingNativeImage");
17
var build = new Builder(folder, typeof(NetfxExtensionFactory), new[] { folder });
18
19
- var results = build.BuildAndQuery(Build, "NetFxNativeImage");
19
+ var results = build.BuildAndQuery(Build, "Wix4NetFxNativeImage");
20
Assert.Equal(new[]
21
{
22
- "NetFxNativeImage:ExampleNgen\tfil6349_KNDJhqShNzVdHX3ihhvA6Y\t3\t8\t\t",
22
+ "Wix4NetFxNativeImage:ExampleNgen\tfil6349_KNDJhqShNzVdHX3ihhvA6Y\t3\t8\t\t",
23
}, results.OrderBy(s => s).ToArray());
24
}
25
src/wixext/NetFxCompiler.cs
+2
-1
@@ -7,6 +7,7 @@ namespace WixToolset.Netfx
7
using System.Xml.Linq;
8
using WixToolset.Data;
9
using WixToolset.Extensibility;
10
+ using WixToolset.Extensibility.Data;
11
using WixToolset.Netfx.Tuples;
12
13
/// <summary>
@@ -144,7 +145,7 @@ namespace WixToolset.Netfx
145
146
this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
147
147
- this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "NetFxScheduleNativeImage");
148
+ this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "NetFxScheduleNativeImage", this.Context.Platform, CustomActionPlatforms.X86);
149
150
if (!this.Messaging.EncounteredError)
151
{
src/wixext/NetfxWindowsInstallerBackendExtension.cs
+8
-1
@@ -11,10 +11,11 @@ namespace WixToolset.Netfx
11
{
12
private static readonly TableDefinition[] Tables = new[] {
13
new TableDefinition(
14
+ "Wix4NetFxNativeImage",
15
"NetFxNativeImage",
16
new[]
17
{
17
- new ColumnDefinition("NetFxNativeImage", ColumnType.String, 72, true, false, ColumnCategory.Identifier, description: "The primary key, a non-localized token."),
18
+ new ColumnDefinition("Wix4NetFxNativeImage", ColumnType.String, 72, true, false, ColumnCategory.Identifier, description: "The primary key, a non-localized token."),
19
new ColumnDefinition("File_", ColumnType.String, 0, false, false, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "The assembly for which a native image will be generated."),
20
new ColumnDefinition("Priority", ColumnType.Number, 2, false, false, ColumnCategory.Integer, maxValue: 3, description: "The priority for generating this native image: 0 is syncronous, 1-3 represent various levels of queued generation."),
21
new ColumnDefinition("Attributes", ColumnType.Number, 4, false, false, ColumnCategory.Integer, maxValue: 2147483647, description: "Integer containing bit flags representing native image attributes."),
@@ -25,5 +26,11 @@ namespace WixToolset.Netfx
26
};
27
28
public override IEnumerable<TableDefinition> TableDefinitions { get => Tables; }
29
+
30
+ public override bool TryAddTupleToOutput(IntermediateTuple tuple, WindowsInstallerData output)
31
+ {
32
+ var columnZeroIsId = tuple.Id != null;
33
+ return this.BackendHelper.TryAddTupleToOutputMatchingTableDefinitions(tuple, output, this.TableDefinitions, columnZeroIsId);
34
+ }
35
}
36
}
src/wixlib/NetFxExtension_Platform.wxi
+13
-12
@@ -4,25 +4,26 @@
4
5
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
6
7
- <?include caSuffix.wxi ?>
7
+ <?include caDecor.wxi ?>
8
+
9
<Fragment>
9
- <CustomAction Id="NetFxScheduleNativeImage$(var.Suffix)" BinaryKey="NetFxCA$(var.Suffix)" DllEntry="SchedNetFx" Execute="immediate" Return="check" SuppressModularization="yes" />
10
- <CustomAction Id="NetFxExecuteNativeImageInstall$(var.DeferredSuffix)" BinaryKey="NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="deferred" Impersonate="no" Return="ignore" SuppressModularization="yes" />
11
- <CustomAction Id="NetFxExecuteNativeImageCommitInstall$(var.DeferredSuffix)" BinaryKey="NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="commit" Impersonate="no" Return="ignore" SuppressModularization="yes" />
12
- <CustomAction Id="NetFxExecuteNativeImageUninstall$(var.DeferredSuffix)" BinaryKey="NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="deferred" Impersonate="no" Return="ignore" SuppressModularization="yes" />
13
- <CustomAction Id="NetFxExecuteNativeImageCommitUninstall$(var.DeferredSuffix)" BinaryKey="NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="commit" Impersonate="no" Return="ignore" SuppressModularization="yes" />
10
+ <CustomAction Id="$(var.Prefix)NetFxScheduleNativeImage$(var.Suffix)" BinaryKey="$(var.Prefix)NetFxCA$(var.Suffix)" DllEntry="SchedNetFx" Execute="immediate" Return="check" SuppressModularization="yes" />
11
+ <CustomAction Id="$(var.Prefix)NetFxExecuteNativeImageInstall$(var.Suffix)" BinaryKey="$(var.Prefix)NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="deferred" Impersonate="no" Return="ignore" SuppressModularization="yes" />
12
+ <CustomAction Id="$(var.Prefix)NetFxExecuteNativeImageCommitInstall$(var.Suffix)" BinaryKey="$(var.Prefix)NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="commit" Impersonate="no" Return="ignore" SuppressModularization="yes" />
13
+ <CustomAction Id="$(var.Prefix)NetFxExecuteNativeImageUninstall$(var.Suffix)" BinaryKey="$(var.Prefix)NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="deferred" Impersonate="no" Return="ignore" SuppressModularization="yes" />
14
+ <CustomAction Id="$(var.Prefix)NetFxExecuteNativeImageCommitUninstall$(var.Suffix)" BinaryKey="$(var.Prefix)NetFxCA$(var.Suffix)" DllEntry="ExecNetFx" Execute="commit" Impersonate="no" Return="ignore" SuppressModularization="yes" />
15
16
<InstallExecuteSequence>
16
- <Custom Action="NetFxScheduleNativeImage$(var.Suffix)" Before="InstallFiles" Overridable="yes" />
17
- <Custom Action="NetFxExecuteNativeImageCommitUninstall$(var.DeferredSuffix)" After="MsiPublishAssemblies" Overridable="yes">RollbackDisabled <> 1</Custom>
18
- <Custom Action="NetFxExecuteNativeImageUninstall$(var.DeferredSuffix)" After="NetFxExecuteNativeImageCommitUninstall$(var.DeferredSuffix)" Overridable="yes">RollbackDisabled = 1</Custom>
19
- <Custom Action="NetFxExecuteNativeImageCommitInstall$(var.DeferredSuffix)" After="NetFxExecuteNativeImageUninstall$(var.DeferredSuffix)" Overridable="yes">RollbackDisabled <> 1</Custom>
20
- <Custom Action="NetFxExecuteNativeImageInstall$(var.DeferredSuffix)" After="NetFxExecuteNativeImageCommitInstall$(var.DeferredSuffix)" Overridable="yes">RollbackDisabled = 1</Custom>
17
+ <Custom Action="$(var.Prefix)NetFxScheduleNativeImage$(var.Suffix)" Before="InstallFiles" Overridable="yes" />
18
+ <Custom Action="$(var.Prefix)NetFxExecuteNativeImageCommitUninstall$(var.Suffix)" After="MsiPublishAssemblies" Overridable="yes">RollbackDisabled <> 1</Custom>
19
+ <Custom Action="$(var.Prefix)NetFxExecuteNativeImageUninstall$(var.Suffix)" After="$(var.Prefix)NetFxExecuteNativeImageCommitUninstall$(var.Suffix)" Overridable="yes">RollbackDisabled = 1</Custom>
20
+ <Custom Action="$(var.Prefix)NetFxExecuteNativeImageCommitInstall$(var.Suffix)" After="$(var.Prefix)NetFxExecuteNativeImageUninstall$(var.Suffix)" Overridable="yes">RollbackDisabled <> 1</Custom>
21
+ <Custom Action="$(var.Prefix)NetFxExecuteNativeImageInstall$(var.Suffix)" After="$(var.Prefix)NetFxExecuteNativeImageCommitInstall$(var.Suffix)" Overridable="yes">RollbackDisabled = 1</Custom>
22
</InstallExecuteSequence>
23
</Fragment>
24
25
<!-- NetFx Custom Action DLL Definitions -->
26
<Fragment>
26
- <Binary Id="NetFxCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))netfxca.dll" />
27
+ <Binary Id="$(var.Prefix)NetFxCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))netfxca.dll" />
28
</Fragment>
29
</Include>
src/wixlib/caDecor.wxi
new
+40
@@ -0,0 +1,40 @@
1
+<?xml version="1.0" encoding="utf-8"?>
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
+<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
6
+ <?ifdef Prefix ?>
7
+ <?undef Prefix ?>
8
+ <?endif ?>
9
+
10
+ <?define Prefix="Wix4" ?>
11
+
12
+ <?ifndef platform ?>
13
+ <?define platform="x86" ?>
14
+ <?endif ?>
15
+
16
+ <?if $(var.platform)="" ?>
17
+ <?undef platform ?>
18
+ <?define platform="x86" ?>
19
+ <?endif ?>
20
+
21
+ <?ifdef Suffix ?>
22
+ <?undef Suffix ?>
23
+ <?endif ?>
24
+
25
+ <?if $(var.platform)~="x86" ?>
26
+ <?define Suffix="_X86" ?>
27
+ <?endif ?>
28
+
29
+ <?if $(var.platform)~="x64" ?>
30
+ <?define Suffix="_X64" ?>
31
+ <?endif ?>
32
+
33
+ <?if $(var.platform)~="arm" ?>
34
+ <?define Suffix="_A32" ?>
35
+ <?endif ?>
36
+
37
+ <?if $(var.platform)~="arm64" ?>
38
+ <?define Suffix="_A64" ?>
39
+ <?endif ?>
40
+</Include>
src/wixlib/caSuffix.wxi
deleted
-28
@@ -1,28 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
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
-<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
5
- <?ifndef platform ?>
6
- <?error Required value "platform" not defined in include caSuffix.wxi ?>
7
- <?endif ?>
8
-
9
- <?ifdef Suffix ?>
10
- <?undef Suffix ?>
11
- <?undef DeferredSuffix ?>
12
- <?endif ?>
13
-
14
- <?if $(var.platform)="x86" ?>
15
- <?define Suffix="" ?>
16
- <?define DeferredSuffix="" ?>
17
- <?endif ?>
18
-
19
- <?if $(var.platform)="x64" ?>
20
- <?define Suffix="_x64" ?>
21
- <?define DeferredSuffix="_64" ?>
22
- <?endif ?>
23
-
24
- <?if $(var.platform)="arm" ?>
25
- <?define Suffix="_ARM" ?>
26
- <?define DeferredSuffix="_ARM" ?>
27
- <?endif ?>
28
-</Include>
src/wixlib/netfx.wixproj
+4
-4
@@ -1,7 +1,7 @@
1
<?xml version="1.0" encoding="utf-8"?>
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
<Project DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
4
- <Import Project="..\..\packages\WixToolset.MSBuild.4.0.0-build-0063\build\WixToolset.MSBuild.props" Condition="Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0063\build\WixToolset.MSBuild.props')" />
4
+ <Import Project="..\..\packages\WixToolset.MSBuild.4.0.0-build-0073\build\WixToolset.MSBuild.props" Condition="Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0073\build\WixToolset.MSBuild.props')" />
5
<Import Project="..\FindLocalWix.props" />
6
<PropertyGroup>
7
<ProjectGuid>{45e4a6ac-3190-4e17-83f0-9935ffa5dc2b}</ProjectGuid>
@@ -45,9 +45,9 @@
45
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
46
</PropertyGroup>
47
<Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
48
- <Error Condition="!Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0063\build\WixToolset.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.MSBuild.4.0.0-build-0063\build\WixToolset.MSBuild.props'))" />
49
- <Error Condition="!Exists('..\..\packages\WixToolset.Util.wixext.4.0.16\build\WixToolset.Util.wixext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.Util.wixext.4.0.16\build\WixToolset.Util.wixext.targets'))" />
48
+ <Error Condition="!Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0073\build\WixToolset.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.MSBuild.4.0.0-build-0073\build\WixToolset.MSBuild.props'))" />
49
+ <Error Condition="!Exists('..\..\packages\WixToolset.Util.wixext.4.0.22\build\WixToolset.Util.wixext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.Util.wixext.4.0.22\build\WixToolset.Util.wixext.targets'))" />
50
</Target>
51
<Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
52
- <Import Project="..\..\packages\WixToolset.Util.wixext.4.0.16\build\WixToolset.Util.wixext.targets" Condition="Exists('..\..\packages\WixToolset.Util.wixext.4.0.16\build\WixToolset.Util.wixext.targets')" />
52
+ <Import Project="..\..\packages\WixToolset.Util.wixext.4.0.22\build\WixToolset.Util.wixext.targets" Condition="Exists('..\..\packages\WixToolset.Util.wixext.4.0.22\build\WixToolset.Util.wixext.targets')" />
53
</Project>
\ No newline at end of file
src/wixlib/packages.config
+2
-2
@@ -1,6 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<packages>
3
<package id="Nerdbank.GitVersioning" version="2.1.65" developmentDependency="true" targetFramework="net40" />
4
- <package id="WixToolset.MSBuild" version="4.0.0-build-0063" developmentDependency="true" targetFramework="net40" />
5
- <package id="WixToolset.Util.wixext" version="4.0.16" targetFramework="net40" />
4
+ <package id="WixToolset.MSBuild" version="4.0.0-build-0073" developmentDependency="true" targetFramework="net40" />
5
+ <package id="WixToolset.Util.wixext" version="4.0.22" targetFramework="net40" />
6
</packages>
\ No newline at end of file