aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2022-11-15 18:04:38 -0500
committerBob Arnson <github@bobs.org>2022-11-16 17:06:22 -0500
commit83d390b8fa44c9d064afa5a79c429505da34f834 (patch)
tree8121cf54967cc5436dad57a8e0f556d481cbc398
parentd14c02d4ca6ee820b7111b789d9f904e0fd52804 (diff)
downloadwix-83d390b8fa44c9d064afa5a79c429505da34f834.tar.gz
wix-83d390b8fa44c9d064afa5a79c429505da34f834.tar.bz2
wix-83d390b8fa44c9d064afa5a79c429505da34f834.zip
Go back to separate .wixlibs for DifxApp.
Fixes https://github.com/wixtoolset/issues/issues/7015.
-rw-r--r--src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs21
-rw-r--r--src/ext/DifxApp/wixext/DifxAppCompiler.cs10
-rw-r--r--src/ext/DifxApp/wixext/DifxAppExtensionData.cs5
-rw-r--r--src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj10
-rw-r--r--src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets1
-rw-r--r--src/ext/DifxApp/wixlib/DifxAppExtension.wxs20
-rw-r--r--src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi22
-rw-r--r--src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs8
-rw-r--r--src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs8
-rw-r--r--src/ext/DifxApp/wixlib/caSuffix.wxi28
-rw-r--r--src/ext/DifxApp/wixlib/difxapp.wixproj1
-rw-r--r--src/wix/WixToolset.Sdk/tools/wix.targets3
12 files changed, 46 insertions, 91 deletions
diff --git a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs
index 7bdd039b..d132952f 100644
--- a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs
+++ b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs
@@ -2,6 +2,8 @@
2 2
3namespace WixToolsetTest.DifxApp 3namespace WixToolsetTest.DifxApp
4{ 4{
5 using System;
6 using System.IO;
5 using System.Linq; 7 using System.Linq;
6 using WixInternal.TestSupport; 8 using WixInternal.TestSupport;
7 using WixInternal.Core.TestPackage; 9 using WixInternal.Core.TestPackage;
@@ -19,17 +21,24 @@ namespace WixToolsetTest.DifxApp
19 var results = build.BuildAndQuery(Build, "CustomAction"); 21 var results = build.BuildAndQuery(Build, "CustomAction");
20 WixAssert.CompareLineByLine(new[] 22 WixAssert.CompareLineByLine(new[]
21 { 23 {
22 "CustomAction:MsiCleanupOnSuccess\t1\tDIFxApp.dll\tCleanupOnSuccess\t", 24 "CustomAction:MsiCleanupOnSuccess\t1\tDIFxAppx64\tCleanupOnSuccess\t",
23 "CustomAction:MsiInstallDrivers\t3073\tDIFxAppA.dll\tInstallDriverPackages\t", 25 "CustomAction:MsiInstallDrivers\t3073\tDIFxAppAx64\tInstallDriverPackages\t",
24 "CustomAction:MsiProcessDrivers\t1\tDIFxApp.dll\tProcessDriverPackages\t", 26 "CustomAction:MsiProcessDrivers\t1\tDIFxAppx64\tProcessDriverPackages\t",
25 "CustomAction:MsiRollbackInstall\t3329\tDIFxAppA.dll\tRollbackInstall\t", 27 "CustomAction:MsiRollbackInstall\t3329\tDIFxAppAx64\tRollbackInstall\t",
26 "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppA.dll\tUninstallDriverPackages\t", 28 "CustomAction:MsiUninstallDrivers\t3073\tDIFxAppAx64\tUninstallDriverPackages\t",
27 }, results); 29 }, results);
28 } 30 }
29 31
30 private static void Build(string[] args) 32 private static void Build(string[] args)
31 { 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();
33 42
34 Assert.Single(result.Messages.Where(m => m.Id == (int)WixToolset.Data.WarningMessages.Ids.DeprecatedElement)); 43 Assert.Single(result.Messages.Where(m => m.Id == (int)WixToolset.Data.WarningMessages.Ids.DeprecatedElement));
35 } 44 }
diff --git a/src/ext/DifxApp/wixext/DifxAppCompiler.cs b/src/ext/DifxApp/wixext/DifxAppCompiler.cs
index 7d000f67..6f32a60b 100644
--- a/src/ext/DifxApp/wixext/DifxAppCompiler.cs
+++ b/src/ext/DifxApp/wixext/DifxAppCompiler.cs
@@ -137,15 +137,7 @@ namespace WixToolset.DifxApp
137 137
138 if (!this.Messaging.EncounteredError) 138 if (!this.Messaging.EncounteredError)
139 { 139 {
140 switch (this.Context.Platform) 140 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.CustomAction, "MsiProcessDrivers");
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 }
149 141
150 var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers) 142 var symbol = section.AddSymbol(new MsiDriverPackagesSymbol(sourceLineNumbers)
151 { 143 {
diff --git a/src/ext/DifxApp/wixext/DifxAppExtensionData.cs b/src/ext/DifxApp/wixext/DifxAppExtensionData.cs
index 31a95b8e..5552717c 100644
--- a/src/ext/DifxApp/wixext/DifxAppExtensionData.cs
+++ b/src/ext/DifxApp/wixext/DifxAppExtensionData.cs
@@ -14,10 +14,5 @@ namespace WixToolset.DifxApp
14 symbolDefinition = DifxAppSymbolDefinitions.ByName(name); 14 symbolDefinition = DifxAppSymbolDefinitions.ByName(name);
15 return symbolDefinition != null; 15 return symbolDefinition != null;
16 } 16 }
17
18 public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions)
19 {
20 return Intermediate.Load(typeof(DifxAppExtensionData).Assembly, "WixToolset.DifxApp.difxapp.wixlib", symbolDefinitions);
21 }
22 } 17 }
23} 18}
diff --git a/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj b/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj
index ec52e897..75ea81ec 100644
--- a/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj
+++ b/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.csproj
@@ -12,11 +12,13 @@
12 12
13 <Import Project="..\..\WixExt.props" /> 13 <Import Project="..\..\WixExt.props" />
14 14
15 <ItemGroup> 15 <ItemGroup Condition=" '$(NCrunch)'=='' ">
16 <EmbeddedResource Include="$(OutputPath)..\difxapp.wixlib" /> 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" />
17 </ItemGroup> 18 </ItemGroup>
18 19
19 <ItemGroup Condition=" '$(NCrunch)'=='' "> 20 <ItemGroup>
20 <ProjectReference Include="..\wixlib\difxapp.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" /> 21 <Content Include="$(OutDir)..\difxapp_x86.wixlib" PackagePath="wixext4\" />
22 <Content Include="$(OutDir)..\difxapp_x64.wixlib" PackagePath="wixext4\" />
21 </ItemGroup> 23 </ItemGroup>
22</Project> 24</Project>
diff --git a/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets b/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets
index bf6df083..87fce8f5 100644
--- a/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets
+++ b/src/ext/DifxApp/wixext/WixToolset.DifxApp.wixext.targets
@@ -7,5 +7,6 @@
7 Condition=" Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> 7 Condition=" Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " />
8 <UnsupportedWixExtension Include="$(MSBuildThisFileName)" 8 <UnsupportedWixExtension Include="$(MSBuildThisFileName)"
9 Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " /> 9 Condition=" !Exists('$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\$(MSBuildThisFileName).dll') " />
10 <WixLibrary Include="$(MSBuildThisFileDirectory)..\$(WixToolsetExtensionPackageFolder)\difxapp_$(InstallerPlatform).wixlib" />
10 </ItemGroup> 11 </ItemGroup>
11</Project> 12</Project>
diff --git a/src/ext/DifxApp/wixlib/DifxAppExtension.wxs b/src/ext/DifxApp/wixlib/DifxAppExtension.wxs
new file mode 100644
index 00000000..430c604b
--- /dev/null
+++ b/src/ext/DifxApp/wixlib/DifxAppExtension.wxs
@@ -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 &gt; 400" />
8 <Custom Action="MsiCleanupOnSuccess" After="InstallFinalize" Condition="VersionNT &gt; 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>
diff --git a/src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi b/src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi
deleted file mode 100644
index b8d613c9..00000000
--- a/src/ext/DifxApp/wixlib/DifxAppExtension_Platform.wxi
+++ /dev/null
@@ -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 &gt; 400" />
10 <Custom Action="MsiCleanupOnSuccess" After="InstallFinalize" Condition="VersionNT &gt; 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>
diff --git a/src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs b/src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs
deleted file mode 100644
index 3c534363..00000000
--- a/src/ext/DifxApp/wixlib/DifxAppExtension_x64.wxs
+++ /dev/null
@@ -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>
diff --git a/src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs b/src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs
deleted file mode 100644
index d352a272..00000000
--- a/src/ext/DifxApp/wixlib/DifxAppExtension_x86.wxs
+++ /dev/null
@@ -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>
diff --git a/src/ext/DifxApp/wixlib/caSuffix.wxi b/src/ext/DifxApp/wixlib/caSuffix.wxi
deleted file mode 100644
index a56a2393..00000000
--- a/src/ext/DifxApp/wixlib/caSuffix.wxi
+++ /dev/null
@@ -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>
diff --git a/src/ext/DifxApp/wixlib/difxapp.wixproj b/src/ext/DifxApp/wixlib/difxapp.wixproj
index 62e7cb3e..b32ceac5 100644
--- a/src/ext/DifxApp/wixlib/difxapp.wixproj
+++ b/src/ext/DifxApp/wixlib/difxapp.wixproj
@@ -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. --> 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"> 2<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup> 3 <PropertyGroup>
4 <OutputName>difxapp_$(Platform)</OutputName>
4 <OutputType>Library</OutputType> 5 <OutputType>Library</OutputType>
5 <BindFiles>true</BindFiles> 6 <BindFiles>true</BindFiles>
6 <Cultures>en-us</Cultures> 7 <Cultures>en-us</Cultures>
diff --git a/src/wix/WixToolset.Sdk/tools/wix.targets b/src/wix/WixToolset.Sdk/tools/wix.targets
index d13152a1..067fa412 100644
--- a/src/wix/WixToolset.Sdk/tools/wix.targets
+++ b/src/wix/WixToolset.Sdk/tools/wix.targets
@@ -160,7 +160,8 @@
160 160
161 <!-- Default Compiler properties. --> 161 <!-- Default Compiler properties. -->
162 <PropertyGroup> 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>
164 </PropertyGroup> 165 </PropertyGroup>
165 166
166 <!-- Convert legacy BindInputPaths and LinkerBindInputPaths (in the project or passed in via the command line) into the new BindPath items --> 167 <!-- Convert legacy BindInputPaths and LinkerBindInputPaths (in the project or passed in via the command line) into the new BindPath items -->