Go back to separate .wixlibs for DifxApp.
Fixes https://github.com/wixtoolset/issues/issues/7015.
Bob Arnson committed
Nov 15, 2022 at 18:04 UTC
83d390b8fa44c9d064afa5a79c429505da34f834
12 files changed
+46
-91
src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs
+15
-6
@@ -2,6 +2,8 @@
2
3
namespace WixToolsetTest.DifxApp
4
{
5
+ using System;
6
+ using System.IO;
7
using System.Linq;
8
using WixInternal.TestSupport;
9
using WixInternal.Core.TestPackage;
@@ -19,17 +21,24 @@ namespace WixToolsetTest.DifxApp
21
var results = build.BuildAndQuery(Build, "CustomAction");
22
WixAssert.CompareLineByLine(new[]
23
{
22
- "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t",
23
- "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t",
24
- "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t",
25
- "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t",
26
- "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t",
24
+ "CustomAction:MsiCleanupOnSuccess\t1\tDIFxAppx64\tCleanupOnSuccess\t",
25
+ "CustomAction:MsiInstallDrivers\t3073\tDIFxAppAx64\tInstallDriverPackages\t",
26
+ "CustomAction:MsiProcessDrivers\t1\tDIFxAppx64\tProcessDriverPackages\t",
27
+ "CustomAction:MsiRollbackInstall\t3329\tDIFxAppAx64\tRollbackInstall\t",
28
+ "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppAx64\tUninstallDriverPackages\t",
29
}, results);
30
}
31
32
private static void Build(string[] args)
33
{
32
- var result = WixRunner.Execute(warningsAsErrors: false, args).AssertSuccess();
34
+ var newArgs = args.ToList();
35
+ newArgs.Add("-platform");
36
+ newArgs.Add("x64");
37
+
38
+ var extDir = Path.GetDirectoryName(new Uri(typeof(DifxAppExtensionFactory).Assembly.CodeBase).LocalPath);
39
+ newArgs.Add(Path.Combine(extDir, "..", "difxapp_x64.wixlib"));
40
+
41
+ var result = WixRunner.Execute(warningsAsErrors: false, newArgs.ToArray()).AssertSuccess();
42
43
Assert.Single(result.Messages.Where(m => m.Id == (int)WixToolset.Data.WarningMessages.Ids.DeprecatedElement));
44
}
src/ext/DifxApp/wixext/DifxAppCompiler.cs
+1
-9
@@ -137,15 +137,7 @@ namespace WixToolset.DifxApp
137
138
if (!this.Messaging.EncounteredError)
139
{
140
- switch (this.Context.Platform)
141
- {
142
- case Platform.X86:
143
- this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers");
144
- break;
145
- case Platform.X64:
146
- this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers_x64");
147
- break;
148
- }
140
+ this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers");
141
142
var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers)
143
{
src/ext/DifxApp/wixext/DifxAppExtensionData.cs
-5
@@ -14,10 +14,5 @@ namespace WixToolset.DifxApp
14
symbolDefinition = DifxAppSymbolDefinitions.ByName(name);
15
return symbolDefinition != null;
16
}
17
-
18
- public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions)
19
- {
20
- return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", symbolDefinitions);
21
- }
17
}
18
}
src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj
+6
-4
@@ -12,11 +12,13 @@
12
13
<Import Project="..\..\WixExt.props" />
14
15
- <ItemGroup>
16
- <EmbeddedResource Include="$(OutputPath)..\difxapp.wixlib" />
15
+ <ItemGroup Condition=" '$(NCrunch)'=='' ">
16
+ <ProjectReference Include="..\wixlib\difxapp.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Properties="Platform=x86" />
17
+ <ProjectReference Include="..\wixlib\difxapp.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" Properties="Platform=x64" />
18
</ItemGroup>
19
19
- <ItemGroup Condition=" '$(NCrunch)'=='' ">
20
- <ProjectReference Include="..\wixlib\difxapp.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
20
+ <ItemGroup>
21
+ <Content Include="$(OutDir)..\difxapp_x86.wixlib" PackagePath="wixext4\" />
22
+ <Content Include="$(OutDir)..\difxapp_x64.wixlib" PackagePath="wixext4\" />
23
</ItemGroup>
24
</Project>
src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets
+1
@@ -7,5 +7,6 @@
7
Condition=" Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " />
8
<UnsupportedWixExtension Include="$(MSBuildThisFileName)"
9
Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " />
10
+ <WixLibrary Include="$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\difxapp_$(InstallerPlatform).wixlib" />
11
</ItemGroup>
12
</Project>
src/ext/DifxApp/wixlib/DifxAppExtension.wxs
new
+20
@@ -0,0 +1,20 @@
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
+ <Fragment>
6
+ <InstallExecuteSequence>
7
+ <Custom Action="MsiProcessDrivers" After="InstallFiles" Condition="VersionNT > 400" />
8
+ <Custom Action="MsiCleanupOnSuccess" After="InstallFinalize" Condition="VersionNT > 400" />
9
+ </InstallExecuteSequence>
10
+
11
+ <Binary Id="DIFxApp$(var.Platform)" SourceFile="$(var.Platform)\DIFxApp.dll" />
12
+ <Binary Id="DIFxAppA$(var.Platform)" SourceFile="$(var.Platform)\DIFxAppA.dll" />
13
+
14
+ <CustomAction Id="MsiProcessDrivers" DllEntry="ProcessDriverPackages" SuppressModularization="yes" Execute="immediate" BinaryRef="DIFxApp$(var.Platform)" />
15
+ <CustomAction Id="MsiInstallDrivers" DllEntry="InstallDriverPackages" SuppressModularization="yes" Execute="deferred" Impersonate="no" BinaryRef="DIFxAppA$(var.Platform)" />
16
+ <CustomAction Id="MsiUninstallDrivers" DllEntry="UninstallDriverPackages" SuppressModularization="yes" Execute="deferred" Impersonate="no" BinaryRef="DIFxAppA$(var.Platform)" />
17
+ <CustomAction Id="MsiRollbackInstall" DllEntry="RollbackInstall" SuppressModularization="yes" Execute="rollback" Impersonate="no" BinaryRef="DIFxAppA$(var.Platform)" />
18
+ <CustomAction Id="MsiCleanupOnSuccess" DllEntry="CleanupOnSuccess" SuppressModularization="yes" Execute="immediate" BinaryRef="DIFxApp$(var.Platform)" />
19
+ </Fragment>
20
+</Wix>
src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi
deleted
-22
@@ -1,22 +0,0 @@
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 caSuffix.wxi ?>
6
-
7
- <Fragment>
8
- <InstallExecuteSequence>
9
- <Custom Action="MsiProcessDrivers" After="InstallFiles" Condition="VersionNT > 400" />
10
- <Custom Action="MsiCleanupOnSuccess" After="InstallFinalize" Condition="VersionNT > 400" />
11
- </InstallExecuteSequence>
12
-
13
- <Binary Id="DIFxApp.dll$(var.Suffix)" SourceFile="$(var.platform)\DIFxApp.dll" />
14
- <Binary Id="DIFxAppA.dll$(var.Suffix)" SourceFile="$(var.platform)\DIFxAppA.dll" />
15
-
16
- <CustomAction Id="MsiProcessDrivers$(var.Suffix)" DllEntry="ProcessDriverPackages" SuppressModularization="yes" Execute="immediate" BinaryRef="DIFxApp.dll$(var.Suffix)" />
17
- <CustomAction Id="MsiInstallDrivers$(var.Suffix)" DllEntry="InstallDriverPackages" SuppressModularization="yes" Execute="deferred" Impersonate="no" BinaryRef="DIFxAppA.dll$(var.Suffix)" />
18
- <CustomAction Id="MsiUninstallDrivers$(var.Suffix)" DllEntry="UninstallDriverPackages" SuppressModularization="yes" Execute="deferred" Impersonate="no" BinaryRef="DIFxAppA.dll$(var.Suffix)" />
19
- <CustomAction Id="MsiRollbackInstall$(var.Suffix)" DllEntry="RollbackInstall" SuppressModularization="yes" Execute="rollback" Impersonate="no" BinaryRef="DIFxAppA.dll$(var.Suffix)" />
20
- <CustomAction Id="MsiCleanupOnSuccess$(var.Suffix)" DllEntry="CleanupOnSuccess" SuppressModularization="yes" Execute="immediate" BinaryRef="DIFxApp.dll$(var.Suffix)" />
21
- </Fragment>
22
-</Include>
src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs
deleted
-8
@@ -1,8 +0,0 @@
1
-<?xml version="1.0"?>
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
-<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6
- <?define platform=x64 ?>
7
- <?include DifxAppExtension_Platform.wxi ?>
8
-</Wix>
src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs
deleted
-8
@@ -1,8 +0,0 @@
1
-<?xml version="1.0"?>
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
-<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6
- <?define platform=x86 ?>
7
- <?include DifxAppExtension_Platform.wxi ?>
8
-</Wix>
src/ext/DifxApp/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/ext/DifxApp/wixlib/difxapp.wixproj
+1
@@ -1,6 +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
<Project Sdk="WixToolset.Sdk">
3
<PropertyGroup>
4
+ <OutputName>difxapp_$(Platform)</OutputName>
5
<OutputType>Library</OutputType>
6
<BindFiles>true</BindFiles>
7
<Cultures>en-us</Cultures>
src/wix/WixToolset.Sdk/tools/wix.targets
+2
-1
@@ -160,7 +160,8 @@
160
161
<!-- Default Compiler properties. -->
162
<PropertyGroup>
163
- <InstallerPlatform Condition=" '$(InstallerPlatform)' == '' and '$(Platform)' != 'AnyCPU' and '$(Platform)' != 'Any CPU' ">$(Platform)</InstallerPlatform>
163
+ <InstallerPlatform Condition=" '$(InstallerPlatform)' == '' and ('$(Platform)' == '' or '$(Platform)' == 'Win32' or '$(Platform)' == 'AnyCPU' or '$(Platform)' == 'Any CPU') ">x86</InstallerPlatform>
164
+ <InstallerPlatform Condition=" '$(InstallerPlatform)' == '' ">$(Platform)</InstallerPlatform>
165
</PropertyGroup>
166
167
<!-- Convert legacy BindInputPaths and LinkerBindInputPaths (in the project or passed in via the command line) into the new BindPath items -->