diff options
55 files changed, 178 insertions, 150 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index cf4504b2..8846cc83 100644 --- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | |||
@@ -14,6 +14,7 @@ namespace WixToolset.Core.Burn | |||
14 | using WixToolset.Data; | 14 | using WixToolset.Data; |
15 | using WixToolset.Data.Bind; | 15 | using WixToolset.Data.Bind; |
16 | using WixToolset.Extensibility; | 16 | using WixToolset.Extensibility; |
17 | using WixToolset.Extensibility.Data; | ||
17 | using WixToolset.Extensibility.Services; | 18 | using WixToolset.Extensibility.Services; |
18 | 19 | ||
19 | // TODO: (4.0) Refactor so that these don't need to be copied. | 20 | // TODO: (4.0) Refactor so that these don't need to be copied. |
diff --git a/src/WixToolset.Core.Burn/BundleBackend.cs b/src/WixToolset.Core.Burn/BundleBackend.cs index 83d33c8a..63504df2 100644 --- a/src/WixToolset.Core.Burn/BundleBackend.cs +++ b/src/WixToolset.Core.Burn/BundleBackend.cs | |||
@@ -7,8 +7,8 @@ namespace WixToolset.Core.Burn | |||
7 | using WixToolset.Core.Burn.Bundles; | 7 | using WixToolset.Core.Burn.Bundles; |
8 | using WixToolset.Core.Burn.Inscribe; | 8 | using WixToolset.Core.Burn.Inscribe; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Bind; | ||
11 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility; |
11 | using WixToolset.Extensibility.Data; | ||
12 | 12 | ||
13 | internal class BundleBackend : IBackend | 13 | internal class BundleBackend : IBackend |
14 | { | 14 | { |
diff --git a/src/WixToolset.Core.Burn/BurnBackendFactory.cs b/src/WixToolset.Core.Burn/BurnBackendFactory.cs index 5da3a0cb..5f98ada9 100644 --- a/src/WixToolset.Core.Burn/BurnBackendFactory.cs +++ b/src/WixToolset.Core.Burn/BurnBackendFactory.cs | |||
@@ -5,11 +5,11 @@ namespace WixToolset.Core.Burn | |||
5 | using System; | 5 | using System; |
6 | using System.IO; | 6 | using System.IO; |
7 | using WixToolset.Extensibility; | 7 | using WixToolset.Extensibility; |
8 | using WixToolset.Extensibility.Services; | 8 | using WixToolset.Extensibility.Data; |
9 | 9 | ||
10 | internal class BurnBackendFactory : IBackendFactory | 10 | internal class BurnBackendFactory : IBackendFactory |
11 | { | 11 | { |
12 | public bool TryCreateBackend(string outputType, string outputFile, WixToolset.Extensibility.IBindContext context, out IBackend backend) | 12 | public bool TryCreateBackend(string outputType, string outputFile, IBindContext context, out IBackend backend) |
13 | { | 13 | { |
14 | if (String.IsNullOrEmpty(outputType)) | 14 | if (String.IsNullOrEmpty(outputType)) |
15 | { | 15 | { |
diff --git a/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs b/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs index 0dea8b1d..e87f4360 100644 --- a/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs | |||
@@ -5,16 +5,22 @@ namespace WixToolset.Core.Burn.Inscribe | |||
5 | using System.IO; | 5 | using System.IO; |
6 | using WixToolset.Core.Burn.Bundles; | 6 | using WixToolset.Core.Burn.Bundles; |
7 | using WixToolset.Extensibility; | 7 | using WixToolset.Extensibility; |
8 | using WixToolset.Extensibility.Data; | ||
9 | using WixToolset.Extensibility.Services; | ||
8 | 10 | ||
9 | internal class InscribeBundleCommand | 11 | internal class InscribeBundleCommand |
10 | { | 12 | { |
11 | public InscribeBundleCommand(IInscribeContext context) | 13 | public InscribeBundleCommand(IInscribeContext context) |
12 | { | 14 | { |
13 | this.Context = context; | 15 | this.Context = context; |
14 | } | ||
15 | 16 | ||
17 | this.Messaging = context.ServiceProvider.GetService<IMessaging>(); | ||
18 | } | ||
19 | |||
16 | private IInscribeContext Context { get; } | 20 | private IInscribeContext Context { get; } |
17 | 21 | ||
22 | public IMessaging Messaging { get; } | ||
23 | |||
18 | public bool Execute() | 24 | public bool Execute() |
19 | { | 25 | { |
20 | bool inscribed = false; | 26 | bool inscribed = false; |
@@ -29,7 +35,7 @@ namespace WixToolset.Core.Burn.Inscribe | |||
29 | { | 35 | { |
30 | reader.Stream.Seek(reader.AttachedContainerAddress, SeekOrigin.Begin); | 36 | reader.Stream.Seek(reader.AttachedContainerAddress, SeekOrigin.Begin); |
31 | 37 | ||
32 | using (BurnWriter writer = BurnWriter.Open(this.Context.Messaging, tempFile)) | 38 | using (BurnWriter writer = BurnWriter.Open(this.Messaging, tempFile)) |
33 | { | 39 | { |
34 | writer.RememberThenResetSignature(); | 40 | writer.RememberThenResetSignature(); |
35 | writer.AppendContainer(reader.Stream, reader.AttachedContainerSize, BurnCommon.Container.Attached); | 41 | writer.AppendContainer(reader.Stream, reader.AttachedContainerSize, BurnCommon.Container.Attached); |
diff --git a/src/WixToolset.Core.Burn/Inscribe/InscribeBundleEngineCommand.cs b/src/WixToolset.Core.Burn/Inscribe/InscribeBundleEngineCommand.cs index 26af056b..37f64312 100644 --- a/src/WixToolset.Core.Burn/Inscribe/InscribeBundleEngineCommand.cs +++ b/src/WixToolset.Core.Burn/Inscribe/InscribeBundleEngineCommand.cs | |||
@@ -5,7 +5,7 @@ namespace WixToolset.Core.Burn.Inscribe | |||
5 | using System; | 5 | using System; |
6 | using System.IO; | 6 | using System.IO; |
7 | using WixToolset.Core.Burn.Bundles; | 7 | using WixToolset.Core.Burn.Bundles; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility.Data; |
9 | 9 | ||
10 | internal class InscribeBundleEngineCommand | 10 | internal class InscribeBundleEngineCommand |
11 | { | 11 | { |
diff --git a/src/WixToolset.Core.TestPackage/WixRunner.cs b/src/WixToolset.Core.TestPackage/WixRunner.cs index 45c7ab3d..62502ecc 100644 --- a/src/WixToolset.Core.TestPackage/WixRunner.cs +++ b/src/WixToolset.Core.TestPackage/WixRunner.cs | |||
@@ -6,6 +6,7 @@ namespace WixToolset.Core.TestPackage | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Data; | ||
9 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
10 | 11 | ||
11 | public static class WixRunner | 12 | public static class WixRunner |
@@ -24,13 +25,10 @@ namespace WixToolset.Core.TestPackage | |||
24 | var arguments = serviceProvider.GetService<ICommandLineArguments>(); | 25 | var arguments = serviceProvider.GetService<ICommandLineArguments>(); |
25 | arguments.Populate(args); | 26 | arguments.Populate(args); |
26 | 27 | ||
27 | var context = serviceProvider.GetService<ICommandLineContext>(); | 28 | var commandLine = serviceProvider.GetService<ICommandLineParser>(); |
28 | context.Messaging = messaging; | 29 | commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); |
29 | context.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); | 30 | commandLine.Arguments = arguments; |
30 | context.Arguments = arguments; | 31 | var command = commandLine.ParseStandardCommandLine(); |
31 | |||
32 | var commandLine = serviceProvider.GetService<ICommandLine>(); | ||
33 | var command = commandLine.ParseStandardCommandLine(context); | ||
34 | return command?.Execute() ?? 1; | 32 | return command?.Execute() ?? 1; |
35 | } | 33 | } |
36 | 34 | ||
diff --git a/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj b/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj index 6cdd8762..3632b064 100644 --- a/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj +++ b/src/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | <Project Sdk="Microsoft.NET.Sdk"> | 4 | <Project Sdk="Microsoft.NET.Sdk"> |
5 | <PropertyGroup> | 5 | <PropertyGroup> |
6 | <TargetFramework>netcoreapp2.1</TargetFramework> | 6 | <TargetFramework>netstandard2.0</TargetFramework> |
7 | <Description>Internal WiX Toolset Test Package</Description> | 7 | <Description>Internal WiX Toolset Test Package</Description> |
8 | <DebugType>embedded</DebugType> | 8 | <DebugType>embedded</DebugType> |
9 | <PublishRepositoryUrl>true</PublishRepositoryUrl> | 9 | <PublishRepositoryUrl>true</PublishRepositoryUrl> |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 2e4b4827..119cbd55 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
@@ -8,10 +8,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
8 | using System.Linq; | 8 | using System.Linq; |
9 | using WixToolset.Core.Bind; | 9 | using WixToolset.Core.Bind; |
10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
11 | using WixToolset.Data.Bind; | ||
12 | using WixToolset.Data.Tuples; | 11 | using WixToolset.Data.Tuples; |
13 | using WixToolset.Data.WindowsInstaller; | 12 | using WixToolset.Data.WindowsInstaller; |
14 | using WixToolset.Extensibility; | 13 | using WixToolset.Extensibility; |
14 | using WixToolset.Extensibility.Data; | ||
15 | using WixToolset.Extensibility.Services; | 15 | using WixToolset.Extensibility.Services; |
16 | 16 | ||
17 | /// <summary> | 17 | /// <summary> |
@@ -24,6 +24,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
24 | 24 | ||
25 | public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendExtension> backendExtension, Validator validator) | 25 | public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendExtension> backendExtension, Validator validator) |
26 | { | 26 | { |
27 | this.Messaging = context.ServiceProvider.GetService<IMessaging>(); | ||
28 | |||
27 | this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); | 29 | this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); |
28 | 30 | ||
29 | this.CabbingThreadCount = context.CabbingThreadCount; | 31 | this.CabbingThreadCount = context.CabbingThreadCount; |
@@ -34,7 +36,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
34 | this.ExpectedEmbeddedFiles = context.ExpectedEmbeddedFiles; | 36 | this.ExpectedEmbeddedFiles = context.ExpectedEmbeddedFiles; |
35 | this.FileSystemExtensions = context.FileSystemExtensions; | 37 | this.FileSystemExtensions = context.FileSystemExtensions; |
36 | this.Intermediate = context.IntermediateRepresentation; | 38 | this.Intermediate = context.IntermediateRepresentation; |
37 | this.Messaging = context.Messaging; | ||
38 | this.OutputPath = context.OutputPath; | 39 | this.OutputPath = context.OutputPath; |
39 | this.IntermediateFolder = context.IntermediateFolder; | 40 | this.IntermediateFolder = context.IntermediateFolder; |
40 | this.Validator = validator; | 41 | this.Validator = validator; |
@@ -76,7 +77,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
76 | 77 | ||
77 | private Validator Validator { get; } | 78 | private Validator Validator { get; } |
78 | 79 | ||
79 | |||
80 | public IEnumerable<FileTransfer> FileTransfers { get; private set; } | 80 | public IEnumerable<FileTransfer> FileTransfers { get; private set; } |
81 | 81 | ||
82 | public IEnumerable<string> ContentFilePaths { get; private set; } | 82 | public IEnumerable<string> ContentFilePaths { get; private set; } |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs index cf8eb338..759fa586 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs | |||
@@ -10,6 +10,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
10 | using WixToolset.Core.Native; | 10 | using WixToolset.Core.Native; |
11 | using WixToolset.Data; | 11 | using WixToolset.Data; |
12 | using WixToolset.Extensibility; | 12 | using WixToolset.Extensibility; |
13 | using WixToolset.Extensibility.Data; | ||
13 | 14 | ||
14 | public class CabinetResolver | 15 | public class CabinetResolver |
15 | { | 16 | { |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs index 997ffa09..328bb082 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs | |||
@@ -11,11 +11,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
11 | using System.Threading; | 11 | using System.Threading; |
12 | using WixToolset.Core.Bind; | 12 | using WixToolset.Core.Bind; |
13 | using WixToolset.Data; | 13 | using WixToolset.Data; |
14 | using WixToolset.Data.Bind; | ||
15 | using WixToolset.Data.Tuples; | 14 | using WixToolset.Data.Tuples; |
16 | using WixToolset.Data.WindowsInstaller; | 15 | using WixToolset.Data.WindowsInstaller; |
17 | using WixToolset.Data.WindowsInstaller.Rows; | 16 | using WixToolset.Data.WindowsInstaller.Rows; |
18 | using WixToolset.Extensibility; | 17 | using WixToolset.Extensibility; |
18 | using WixToolset.Extensibility.Data; | ||
19 | using WixToolset.Extensibility.Services; | 19 | using WixToolset.Extensibility.Services; |
20 | 20 | ||
21 | /// <summary> | 21 | /// <summary> |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs index 56c86b11..4b143ead 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs | |||
@@ -9,8 +9,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
9 | using WixToolset.Core.Bind; | 9 | using WixToolset.Core.Bind; |
10 | using WixToolset.Core.Native; | 10 | using WixToolset.Core.Native; |
11 | using WixToolset.Data; | 11 | using WixToolset.Data; |
12 | using WixToolset.Data.Bind; | ||
13 | using WixToolset.Data.Tuples; | 12 | using WixToolset.Data.Tuples; |
13 | using WixToolset.Extensibility.Data; | ||
14 | using WixToolset.Msi; | 14 | using WixToolset.Msi; |
15 | 15 | ||
16 | /// <summary> | 16 | /// <summary> |
diff --git a/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs b/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs index 93dd9d3b..f3028fbe 100644 --- a/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs | |||
@@ -12,7 +12,8 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
12 | using WixToolset.Core.WindowsInstaller.Bind; | 12 | using WixToolset.Core.WindowsInstaller.Bind; |
13 | using WixToolset.Data; | 13 | using WixToolset.Data; |
14 | using WixToolset.Data.WindowsInstaller; | 14 | using WixToolset.Data.WindowsInstaller; |
15 | using WixToolset.Extensibility; | 15 | using WixToolset.Extensibility.Data; |
16 | using WixToolset.Extensibility.Services; | ||
16 | using WixToolset.Msi; | 17 | using WixToolset.Msi; |
17 | 18 | ||
18 | internal class InscribeMsiPackageCommand | 19 | internal class InscribeMsiPackageCommand |
@@ -20,11 +21,14 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
20 | public InscribeMsiPackageCommand(IInscribeContext context) | 21 | public InscribeMsiPackageCommand(IInscribeContext context) |
21 | { | 22 | { |
22 | this.Context = context; | 23 | this.Context = context; |
24 | this.Messaging = context.ServiceProvider.GetService<IMessaging>(); | ||
23 | this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); | 25 | this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); |
24 | } | 26 | } |
25 | 27 | ||
26 | private IInscribeContext Context { get; } | 28 | private IInscribeContext Context { get; } |
27 | 29 | ||
30 | private IMessaging Messaging { get; } | ||
31 | |||
28 | private TableDefinitionCollection TableDefinitions { get; } | 32 | private TableDefinitionCollection TableDefinitions { get; } |
29 | 33 | ||
30 | public bool Execute() | 34 | public bool Execute() |
@@ -36,7 +40,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
36 | FileAttributes attributes = File.GetAttributes(this.Context.InputFilePath); | 40 | FileAttributes attributes = File.GetAttributes(this.Context.InputFilePath); |
37 | if (FileAttributes.ReadOnly == (attributes & FileAttributes.ReadOnly)) | 41 | if (FileAttributes.ReadOnly == (attributes & FileAttributes.ReadOnly)) |
38 | { | 42 | { |
39 | this.Context.Messaging.Write(ErrorMessages.ReadOnlyOutputFile(this.Context.InputFilePath)); | 43 | this.Messaging.Write(ErrorMessages.ReadOnlyOutputFile(this.Context.InputFilePath)); |
40 | return shouldCommit; | 44 | return shouldCommit; |
41 | } | 45 | } |
42 | 46 | ||
@@ -179,7 +183,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
179 | // If the cabs aren't there, throw an error but continue to catch the other errors | 183 | // If the cabs aren't there, throw an error but continue to catch the other errors |
180 | if (!File.Exists(cabPath)) | 184 | if (!File.Exists(cabPath)) |
181 | { | 185 | { |
182 | this.Context.Messaging.Write(ErrorMessages.WixFileNotFound(cabPath)); | 186 | this.Messaging.Write(ErrorMessages.WixFileNotFound(cabPath)); |
183 | continue; | 187 | continue; |
184 | } | 188 | } |
185 | 189 | ||
@@ -205,11 +209,11 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
205 | if ((5 == Environment.OSVersion.Version.Major && 2 == Environment.OSVersion.Version.Minor) || // W2K3 | 209 | if ((5 == Environment.OSVersion.Version.Major && 2 == Environment.OSVersion.Version.Minor) || // W2K3 |
206 | (5 == Environment.OSVersion.Version.Major && 1 == Environment.OSVersion.Version.Minor)) // XP | 210 | (5 == Environment.OSVersion.Version.Major && 1 == Environment.OSVersion.Version.Minor)) // XP |
207 | { | 211 | { |
208 | this.Context.Messaging.Write(ErrorMessages.UnableToGetAuthenticodeCertOfFileDownlevelOS(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); | 212 | this.Messaging.Write(ErrorMessages.UnableToGetAuthenticodeCertOfFileDownlevelOS(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); |
209 | } | 213 | } |
210 | else // otherwise, generic error | 214 | else // otherwise, generic error |
211 | { | 215 | { |
212 | this.Context.Messaging.Write(ErrorMessages.UnableToGetAuthenticodeCertOfFile(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); | 216 | this.Messaging.Write(ErrorMessages.UnableToGetAuthenticodeCertOfFile(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); |
213 | } | 217 | } |
214 | } | 218 | } |
215 | 219 | ||
@@ -252,7 +256,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
252 | 256 | ||
253 | if (digitalCertificateTable.Rows.Count > 0) | 257 | if (digitalCertificateTable.Rows.Count > 0) |
254 | { | 258 | { |
255 | var command = new CreateIdtFileCommand(this.Context.Messaging, digitalCertificateTable, codepage, this.Context.IntermediateFolder, true); | 259 | var command = new CreateIdtFileCommand(this.Messaging, digitalCertificateTable, codepage, this.Context.IntermediateFolder, true); |
256 | command.Execute(); | 260 | command.Execute(); |
257 | 261 | ||
258 | database.Import(command.IdtPath); | 262 | database.Import(command.IdtPath); |
@@ -261,7 +265,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
261 | 265 | ||
262 | if (digitalSignatureTable.Rows.Count > 0) | 266 | if (digitalSignatureTable.Rows.Count > 0) |
263 | { | 267 | { |
264 | var command = new CreateIdtFileCommand(this.Context.Messaging, digitalSignatureTable, codepage, this.Context.IntermediateFolder, true); | 268 | var command = new CreateIdtFileCommand(this.Messaging, digitalSignatureTable, codepage, this.Context.IntermediateFolder, true); |
265 | command.Execute(); | 269 | command.Execute(); |
266 | 270 | ||
267 | database.Import(command.IdtPath); | 271 | database.Import(command.IdtPath); |
@@ -275,7 +279,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe | |||
275 | // If we did find external cabs but none of them were signed, give a warning | 279 | // If we did find external cabs but none of them were signed, give a warning |
276 | if (foundUnsignedExternals) | 280 | if (foundUnsignedExternals) |
277 | { | 281 | { |
278 | this.Context.Messaging.Write(WarningMessages.ExternalCabsAreNotSigned(this.Context.InputFilePath)); | 282 | this.Messaging.Write(WarningMessages.ExternalCabsAreNotSigned(this.Context.InputFilePath)); |
279 | } | 283 | } |
280 | 284 | ||
281 | if (shouldCommit) | 285 | if (shouldCommit) |
diff --git a/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs b/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs index 11198b2b..f72a7c66 100644 --- a/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs | |||
@@ -7,8 +7,8 @@ namespace WixToolset.Core.WindowsInstaller | |||
7 | using WixToolset.Core.WindowsInstaller.Inscribe; | 7 | using WixToolset.Core.WindowsInstaller.Inscribe; |
8 | using WixToolset.Core.WindowsInstaller.Unbind; | 8 | using WixToolset.Core.WindowsInstaller.Unbind; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Bind; | ||
11 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility; |
11 | using WixToolset.Extensibility.Data; | ||
12 | using WixToolset.Extensibility.Services; | 12 | using WixToolset.Extensibility.Services; |
13 | 13 | ||
14 | internal class MsiBackend : IBackend | 14 | internal class MsiBackend : IBackend |
diff --git a/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs b/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs index 4076da66..91377b48 100644 --- a/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MsmBackend.cs | |||
@@ -6,13 +6,13 @@ namespace WixToolset.Core.WindowsInstaller | |||
6 | using WixToolset.Core.WindowsInstaller.Bind; | 6 | using WixToolset.Core.WindowsInstaller.Bind; |
7 | using WixToolset.Core.WindowsInstaller.Unbind; | 7 | using WixToolset.Core.WindowsInstaller.Unbind; |
8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolset.Data.Bind; | ||
10 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
10 | using WixToolset.Extensibility.Data; | ||
11 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
12 | 12 | ||
13 | internal class MsmBackend : IBackend | 13 | internal class MsmBackend : IBackend |
14 | { | 14 | { |
15 | public BindResult Bind(WixToolset.Extensibility.IBindContext context) | 15 | public BindResult Bind(IBindContext context) |
16 | { | 16 | { |
17 | var extensionManager = context.ServiceProvider.GetService<IExtensionManager>(); | 17 | var extensionManager = context.ServiceProvider.GetService<IExtensionManager>(); |
18 | 18 | ||
diff --git a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs index 5dbed241..a47802bb 100644 --- a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs | |||
@@ -10,13 +10,13 @@ namespace WixToolset.Core.WindowsInstaller | |||
10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
11 | using WixToolset.Data.Bind; | 11 | using WixToolset.Data.Bind; |
12 | using WixToolset.Extensibility; | 12 | using WixToolset.Extensibility; |
13 | using WixToolset.Extensibility.Services; | 13 | using WixToolset.Extensibility.Data; |
14 | using WixToolset.Msi; | 14 | using WixToolset.Msi; |
15 | using WixToolset.Ole32; | 15 | using WixToolset.Ole32; |
16 | 16 | ||
17 | internal class MspBackend : IBackend | 17 | internal class MspBackend : IBackend |
18 | { | 18 | { |
19 | public BindResult Bind(WixToolset.Extensibility.IBindContext context) | 19 | public BindResult Bind(IBindContext context) |
20 | { | 20 | { |
21 | throw new NotImplementedException(); | 21 | throw new NotImplementedException(); |
22 | } | 22 | } |
diff --git a/src/WixToolset.Core.WindowsInstaller/MstBackend.cs b/src/WixToolset.Core.WindowsInstaller/MstBackend.cs index 4eb0901c..fa696d55 100644 --- a/src/WixToolset.Core.WindowsInstaller/MstBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MstBackend.cs | |||
@@ -5,8 +5,8 @@ namespace WixToolset.Core.WindowsInstaller | |||
5 | using System; | 5 | using System; |
6 | using WixToolset.Core.WindowsInstaller.Unbind; | 6 | using WixToolset.Core.WindowsInstaller.Unbind; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Data.Bind; | ||
9 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Data; | ||
10 | 10 | ||
11 | internal class MstBackend : IBackend | 11 | internal class MstBackend : IBackend |
12 | { | 12 | { |
diff --git a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindMsiOrMsmCommand.cs b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindMsiOrMsmCommand.cs index ce3f1ff6..2cea9cfb 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindMsiOrMsmCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindMsiOrMsmCommand.cs | |||
@@ -6,7 +6,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind | |||
6 | using System.ComponentModel; | 6 | using System.ComponentModel; |
7 | using WixToolset.Core.Native; | 7 | using WixToolset.Core.Native; |
8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility.Data; |
10 | using WixToolset.Msi; | 10 | using WixToolset.Msi; |
11 | 11 | ||
12 | internal class UnbindMsiOrMsmCommand | 12 | internal class UnbindMsiOrMsmCommand |
diff --git a/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs b/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs index ff71bea4..2bc4516d 100644 --- a/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs +++ b/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs | |||
@@ -3,15 +3,12 @@ | |||
3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility; | 6 | using WixToolset.Extensibility.Data; |
7 | using WixToolset.Extensibility.Services; | ||
8 | 7 | ||
9 | internal class UnbindContext : IUnbindContext | 8 | internal class UnbindContext : IUnbindContext |
10 | { | 9 | { |
11 | public IServiceProvider ServiceProvider { get; } | 10 | public IServiceProvider ServiceProvider { get; } |
12 | 11 | ||
13 | public IMessaging Messaging { get; set; } | ||
14 | |||
15 | public string ExportBasePath { get; set; } | 12 | public string ExportBasePath { get; set; } |
16 | 13 | ||
17 | public string InputFilePath { get; set; } | 14 | public string InputFilePath { get; set; } |
diff --git a/src/WixToolset.Core.WindowsInstaller/Validator.cs b/src/WixToolset.Core.WindowsInstaller/Validator.cs index 5f41e88d..cbe489be 100644 --- a/src/WixToolset.Core.WindowsInstaller/Validator.cs +++ b/src/WixToolset.Core.WindowsInstaller/Validator.cs | |||
@@ -16,6 +16,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
16 | using WixToolset.Data; | 16 | using WixToolset.Data; |
17 | using WixToolset.Data.WindowsInstaller; | 17 | using WixToolset.Data.WindowsInstaller; |
18 | using WixToolset.Extensibility; | 18 | using WixToolset.Extensibility; |
19 | using WixToolset.Extensibility.Data; | ||
19 | using WixToolset.Extensibility.Services; | 20 | using WixToolset.Extensibility.Services; |
20 | using WixToolset.Msi; | 21 | using WixToolset.Msi; |
21 | 22 | ||
@@ -324,14 +325,15 @@ namespace WixToolset.Core.WindowsInstaller | |||
324 | } | 325 | } |
325 | } | 326 | } |
326 | 327 | ||
327 | public static Validator CreateFromContext(WixToolset.Extensibility.IBindContext context, string cubeFilename) | 328 | public static Validator CreateFromContext(IBindContext context, string cubeFilename) |
328 | { | 329 | { |
329 | Validator validator = null; | 330 | Validator validator = null; |
331 | var messaging = context.ServiceProvider.GetService<IMessaging>(); | ||
330 | 332 | ||
331 | // Tell the binder about the validator if validation isn't suppressed | 333 | // Tell the binder about the validator if validation isn't suppressed |
332 | if (!context.SuppressValidation) | 334 | if (!context.SuppressValidation) |
333 | { | 335 | { |
334 | validator = new Validator(context.Messaging); | 336 | validator = new Validator(messaging); |
335 | validator.IntermediateFolder = Path.Combine(context.IntermediateFolder, "validate"); | 337 | validator.IntermediateFolder = Path.Combine(context.IntermediateFolder, "validate"); |
336 | 338 | ||
337 | // set the default cube file | 339 | // set the default cube file |
diff --git a/src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs index b66a4617..8ffa1a03 100644 --- a/src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs +++ b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs | |||
@@ -5,6 +5,7 @@ namespace WixToolset.Core.WindowsInstaller | |||
5 | using System; | 5 | using System; |
6 | using System.IO; | 6 | using System.IO; |
7 | using WixToolset.Extensibility; | 7 | using WixToolset.Extensibility; |
8 | using WixToolset.Extensibility.Data; | ||
8 | 9 | ||
9 | internal class WindowsInstallerBackendFactory : IBackendFactory | 10 | internal class WindowsInstallerBackendFactory : IBackendFactory |
10 | { | 11 | { |
diff --git a/src/WixToolset.Core/Bind/DelayedField.cs b/src/WixToolset.Core/Bind/DelayedField.cs index 8b761b94..7d0045e6 100644 --- a/src/WixToolset.Core/Bind/DelayedField.cs +++ b/src/WixToolset.Core/Bind/DelayedField.cs | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace WixToolset.Core.Bind | 3 | namespace WixToolset.Core.Bind |
4 | { | 4 | { |
5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
6 | using WixToolset.Extensibility; | 6 | using WixToolset.Extensibility.Data; |
7 | 7 | ||
8 | /// <summary> | 8 | /// <summary> |
9 | /// Structure used to hold a row and field that contain binder variables, which need to be resolved | 9 | /// Structure used to hold a row and field that contain binder variables, which need to be resolved |
diff --git a/src/WixToolset.Core/Bind/ExpectedExtractFile.cs b/src/WixToolset.Core/Bind/ExpectedExtractFile.cs index fc2b43c7..afad12fc 100644 --- a/src/WixToolset.Core/Bind/ExpectedExtractFile.cs +++ b/src/WixToolset.Core/Bind/ExpectedExtractFile.cs | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace WixToolset.Core.Bind | 3 | namespace WixToolset.Core.Bind |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility; | 6 | using WixToolset.Extensibility.Data; |
7 | 7 | ||
8 | internal class ExpectedExtractFile : IExpectedExtractFile | 8 | internal class ExpectedExtractFile : IExpectedExtractFile |
9 | { | 9 | { |
diff --git a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs index 7e7c21b1..d82609db 100644 --- a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs +++ b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Core.Bind | |||
7 | using System.Linq; | 7 | using System.Linq; |
8 | using System.Reflection; | 8 | using System.Reflection; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility.Data; |
11 | 11 | ||
12 | public class ExtractEmbeddedFilesCommand | 12 | public class ExtractEmbeddedFilesCommand |
13 | { | 13 | { |
diff --git a/src/WixToolset.Core/Bind/FileResolver.cs b/src/WixToolset.Core/Bind/FileResolver.cs index a20d3f34..86075e46 100644 --- a/src/WixToolset.Core/Bind/FileResolver.cs +++ b/src/WixToolset.Core/Bind/FileResolver.cs | |||
@@ -7,8 +7,8 @@ namespace WixToolset.Core.Bind | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using System.Linq; | 8 | using System.Linq; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Bind; | ||
11 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility; |
11 | using WixToolset.Extensibility.Data; | ||
12 | 12 | ||
13 | internal class FileResolver | 13 | internal class FileResolver |
14 | { | 14 | { |
diff --git a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs index 6f8da9ec..bec03907 100644 --- a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs +++ b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Core.Bind | |||
7 | using System.Globalization; | 7 | using System.Globalization; |
8 | using System.Text; | 8 | using System.Text; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility.Data; |
11 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
12 | 12 | ||
13 | /// <summary> | 13 | /// <summary> |
diff --git a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs index 744f022c..0d5c3142 100644 --- a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs +++ b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs | |||
@@ -5,8 +5,8 @@ namespace WixToolset.Core.Bind | |||
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Data.Bind; | ||
9 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Data; | ||
10 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
11 | 11 | ||
12 | /// <summary> | 12 | /// <summary> |
diff --git a/src/WixToolset.Core/Bind/TransferFilesCommand.cs b/src/WixToolset.Core/Bind/TransferFilesCommand.cs index 6230a4f5..79f0cd81 100644 --- a/src/WixToolset.Core/Bind/TransferFilesCommand.cs +++ b/src/WixToolset.Core/Bind/TransferFilesCommand.cs | |||
@@ -7,8 +7,8 @@ namespace WixToolset.Core.Bind | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using System.Security.AccessControl; | 8 | using System.Security.AccessControl; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Bind; | ||
11 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility; |
11 | using WixToolset.Extensibility.Data; | ||
12 | using WixToolset.Extensibility.Services; | 12 | using WixToolset.Extensibility.Services; |
13 | 13 | ||
14 | internal class TransferFilesCommand | 14 | internal class TransferFilesCommand |
diff --git a/src/WixToolset.Core/BindContext.cs b/src/WixToolset.Core/BindContext.cs index f423b731..12719f51 100644 --- a/src/WixToolset.Core/BindContext.cs +++ b/src/WixToolset.Core/BindContext.cs | |||
@@ -6,7 +6,7 @@ namespace WixToolset.Core | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Services; | 9 | using WixToolset.Extensibility.Data; |
10 | 10 | ||
11 | public class BindContext : IBindContext | 11 | public class BindContext : IBindContext |
12 | { | 12 | { |
@@ -17,8 +17,6 @@ namespace WixToolset.Core | |||
17 | 17 | ||
18 | public IServiceProvider ServiceProvider { get; } | 18 | public IServiceProvider ServiceProvider { get; } |
19 | 19 | ||
20 | public IMessaging Messaging { get; set; } | ||
21 | |||
22 | public IEnumerable<BindPath> BindPaths { get; set; } | 20 | public IEnumerable<BindPath> BindPaths { get; set; } |
23 | 21 | ||
24 | public int CabbingThreadCount { get; set; } | 22 | public int CabbingThreadCount { get; set; } |
diff --git a/src/WixToolset.Core/Binder.cs b/src/WixToolset.Core/Binder.cs index f112a214..23f1ba21 100644 --- a/src/WixToolset.Core/Binder.cs +++ b/src/WixToolset.Core/Binder.cs | |||
@@ -11,6 +11,7 @@ namespace WixToolset.Core | |||
11 | using WixToolset.Data.Bind; | 11 | using WixToolset.Data.Bind; |
12 | using WixToolset.Data.Tuples; | 12 | using WixToolset.Data.Tuples; |
13 | using WixToolset.Extensibility; | 13 | using WixToolset.Extensibility; |
14 | using WixToolset.Extensibility.Data; | ||
14 | using WixToolset.Extensibility.Services; | 15 | using WixToolset.Extensibility.Services; |
15 | 16 | ||
16 | /// <summary> | 17 | /// <summary> |
@@ -56,7 +57,6 @@ namespace WixToolset.Core | |||
56 | public BindResult Execute() | 57 | public BindResult Execute() |
57 | { | 58 | { |
58 | var context = this.ServiceProvider.GetService<IBindContext>(); | 59 | var context = this.ServiceProvider.GetService<IBindContext>(); |
59 | context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
60 | context.CabbingThreadCount = this.CabbingThreadCount; | 60 | context.CabbingThreadCount = this.CabbingThreadCount; |
61 | context.CabCachePath = this.CabCachePath; | 61 | context.CabCachePath = this.CabCachePath; |
62 | context.Codepage = this.Codepage; | 62 | context.Codepage = this.Codepage; |
@@ -72,7 +72,6 @@ namespace WixToolset.Core | |||
72 | context.SuppressIces = this.SuppressIces; | 72 | context.SuppressIces = this.SuppressIces; |
73 | context.SuppressValidation = this.SuppressValidation; | 73 | context.SuppressValidation = this.SuppressValidation; |
74 | 74 | ||
75 | |||
76 | // Prebind. | 75 | // Prebind. |
77 | // | 76 | // |
78 | foreach (var extension in context.Extensions) | 77 | foreach (var extension in context.Extensions) |
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 7b605da1..d8327b7a 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs | |||
@@ -7,8 +7,7 @@ namespace WixToolset.Core.CommandLine | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using System.Linq; | 8 | using System.Linq; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Bind; | 10 | using WixToolset.Extensibility.Data; |
11 | using WixToolset.Extensibility; | ||
12 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
13 | 12 | ||
14 | internal class BuildCommand : ICommandLineCommand | 13 | internal class BuildCommand : ICommandLineCommand |
diff --git a/src/WixToolset.Core/CommandLine/CommandLineArguments.cs b/src/WixToolset.Core/CommandLine/CommandLineArguments.cs index 37adcfd3..2f8226df 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineArguments.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineArguments.cs | |||
@@ -7,6 +7,7 @@ namespace WixToolset.Core.CommandLine | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using System.Text; | 8 | using System.Text; |
9 | using System.Text.RegularExpressions; | 9 | using System.Text.RegularExpressions; |
10 | using WixToolset.Extensibility.Data; | ||
10 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
11 | 12 | ||
12 | internal class CommandLineArguments : ICommandLineArguments | 13 | internal class CommandLineArguments : ICommandLineArguments |
diff --git a/src/WixToolset.Core/CommandLine/CommandLineContext.cs b/src/WixToolset.Core/CommandLine/CommandLineContext.cs index c589222d..ea0cf3d4 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineContext.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineContext.cs | |||
@@ -3,6 +3,7 @@ | |||
3 | namespace WixToolset.Core.CommandLine | 3 | namespace WixToolset.Core.CommandLine |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility.Data; | ||
6 | using WixToolset.Extensibility.Services; | 7 | using WixToolset.Extensibility.Services; |
7 | 8 | ||
8 | internal class CommandLineContext : ICommandLineContext | 9 | internal class CommandLineContext : ICommandLineContext |
@@ -14,8 +15,6 @@ namespace WixToolset.Core.CommandLine | |||
14 | 15 | ||
15 | public IServiceProvider ServiceProvider { get; } | 16 | public IServiceProvider ServiceProvider { get; } |
16 | 17 | ||
17 | public IMessaging Messaging { get; set; } | ||
18 | |||
19 | public IExtensionManager ExtensionManager { get; set; } | 18 | public IExtensionManager ExtensionManager { get; set; } |
20 | 19 | ||
21 | public ICommandLineArguments Arguments { get; set; } | 20 | public ICommandLineArguments Arguments { get; set; } |
diff --git a/src/WixToolset.Core/CommandLine/CommandLineParser.cs b/src/WixToolset.Core/CommandLine/CommandLineParser.cs index 65aea1fc..92944ab2 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineParser.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineParser.cs | |||
@@ -7,6 +7,7 @@ namespace WixToolset.Core.CommandLine | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
10 | using WixToolset.Extensibility.Data; | ||
10 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
11 | 12 | ||
12 | internal enum Commands | 13 | internal enum Commands |
@@ -19,27 +20,34 @@ namespace WixToolset.Core.CommandLine | |||
19 | Bind, | 20 | Bind, |
20 | } | 21 | } |
21 | 22 | ||
22 | internal class CommandLineParser : ICommandLine | 23 | internal class CommandLineParser : ICommandLineParser |
23 | { | 24 | { |
24 | private IServiceProvider ServiceProvider { get; set; } | 25 | public CommandLineParser(IServiceProvider serviceProvider) |
26 | { | ||
27 | this.ServiceProvider = serviceProvider; | ||
28 | |||
29 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
30 | } | ||
31 | |||
32 | private IServiceProvider ServiceProvider { get; } | ||
25 | 33 | ||
26 | private IMessaging Messaging { get; set; } | 34 | private IMessaging Messaging { get; set; } |
27 | 35 | ||
36 | public IExtensionManager ExtensionManager { get; set; } | ||
37 | |||
38 | public ICommandLineArguments Arguments { get; set; } | ||
39 | |||
28 | public static string ExpectedArgument { get; } = "expected argument"; | 40 | public static string ExpectedArgument { get; } = "expected argument"; |
29 | 41 | ||
30 | public string ActiveCommand { get; private set; } | 42 | public string ActiveCommand { get; private set; } |
31 | 43 | ||
32 | public IExtensionManager ExtensionManager { get; private set; } | 44 | public bool ShowHelp { get; private set; } |
33 | |||
34 | public bool ShowHelp { get; set; } | ||
35 | 45 | ||
36 | public ICommandLineCommand ParseStandardCommandLine(ICommandLineContext context) | 46 | public ICommandLineCommand ParseStandardCommandLine() |
37 | { | 47 | { |
38 | this.ServiceProvider = context.ServiceProvider; | 48 | var context = this.ServiceProvider.GetService<ICommandLineContext>(); |
39 | 49 | context.ExtensionManager = this.ExtensionManager ?? this.ServiceProvider.GetService<IExtensionManager>(); | |
40 | this.Messaging = context.Messaging ?? this.ServiceProvider.GetService<IMessaging>(); | 50 | context.Arguments = this.Arguments; |
41 | |||
42 | this.ExtensionManager = context.ExtensionManager ?? this.ServiceProvider.GetService<IExtensionManager>(); | ||
43 | 51 | ||
44 | var next = String.Empty; | 52 | var next = String.Empty; |
45 | 53 | ||
@@ -277,7 +285,7 @@ namespace WixToolset.Core.CommandLine | |||
277 | return OutputType.Unknown; | 285 | return OutputType.Unknown; |
278 | } | 286 | } |
279 | 287 | ||
280 | private ICommandLine Parse(ICommandLineContext context, Func<CommandLineParser, string, bool> parseCommand, Func<CommandLineParser, IParseCommandLine, string, bool> parseArgument) | 288 | private ICommandLineParser Parse(ICommandLineContext context, Func<CommandLineParser, string, bool> parseCommand, Func<CommandLineParser, IParseCommandLine, string, bool> parseArgument) |
281 | { | 289 | { |
282 | var extensions = this.ExtensionManager.Create<IExtensionCommandLine>(); | 290 | var extensions = this.ExtensionManager.Create<IExtensionCommandLine>(); |
283 | 291 | ||
diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs index 123318f5..6bd0f25a 100644 --- a/src/WixToolset.Core/CommandLine/CompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs | |||
@@ -5,8 +5,7 @@ namespace WixToolset.Core.CommandLine | |||
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility.Data; |
9 | using WixToolset.Extensibility.Services; | ||
10 | 9 | ||
11 | internal class CompileCommand : ICommandLineCommand | 10 | internal class CompileCommand : ICommandLineCommand |
12 | { | 11 | { |
diff --git a/src/WixToolset.Core/CommandLine/HelpCommand.cs b/src/WixToolset.Core/CommandLine/HelpCommand.cs index 6e547d60..b1298e46 100644 --- a/src/WixToolset.Core/CommandLine/HelpCommand.cs +++ b/src/WixToolset.Core/CommandLine/HelpCommand.cs | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace WixToolset.Core.CommandLine | 3 | namespace WixToolset.Core.CommandLine |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility.Services; | 6 | using WixToolset.Extensibility.Data; |
7 | 7 | ||
8 | internal class HelpCommand : ICommandLineCommand | 8 | internal class HelpCommand : ICommandLineCommand |
9 | { | 9 | { |
diff --git a/src/WixToolset.Core/CommandLine/VersionCommand.cs b/src/WixToolset.Core/CommandLine/VersionCommand.cs index a04aac31..e67aafb8 100644 --- a/src/WixToolset.Core/CommandLine/VersionCommand.cs +++ b/src/WixToolset.Core/CommandLine/VersionCommand.cs | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace WixToolset.Core.CommandLine | 3 | namespace WixToolset.Core.CommandLine |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility.Services; | 6 | using WixToolset.Extensibility.Data; |
7 | 7 | ||
8 | internal class VersionCommand : ICommandLineCommand | 8 | internal class VersionCommand : ICommandLineCommand |
9 | { | 9 | { |
diff --git a/src/WixToolset.Core/CompileContext.cs b/src/WixToolset.Core/CompileContext.cs index fcca94d8..6f19961f 100644 --- a/src/WixToolset.Core/CompileContext.cs +++ b/src/WixToolset.Core/CompileContext.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Core | |||
7 | using System.Xml.Linq; | 7 | using System.Xml.Linq; |
8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
10 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Data; |
11 | 11 | ||
12 | public class CompileContext : ICompileContext | 12 | public class CompileContext : ICompileContext |
13 | { | 13 | { |
@@ -18,8 +18,6 @@ namespace WixToolset.Core | |||
18 | 18 | ||
19 | public IServiceProvider ServiceProvider { get; } | 19 | public IServiceProvider ServiceProvider { get; } |
20 | 20 | ||
21 | public IMessaging Messaging { get; set; } | ||
22 | |||
23 | public string CompilationId { get; set; } | 21 | public string CompilationId { get; set; } |
24 | 22 | ||
25 | public IEnumerable<ICompilerExtension> Extensions { get; set; } | 23 | public IEnumerable<ICompilerExtension> Extensions { get; set; } |
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index cd51fed6..06f477c1 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
@@ -15,6 +15,7 @@ namespace WixToolset.Core | |||
15 | using WixToolset.Data; | 15 | using WixToolset.Data; |
16 | using WixToolset.Data.Tuples; | 16 | using WixToolset.Data.Tuples; |
17 | using WixToolset.Extensibility; | 17 | using WixToolset.Extensibility; |
18 | using WixToolset.Extensibility.Data; | ||
18 | using WixToolset.Extensibility.Services; | 19 | using WixToolset.Extensibility.Services; |
19 | using Wix = WixToolset.Data.Serialize; | 20 | using Wix = WixToolset.Data.Serialize; |
20 | 21 | ||
@@ -71,10 +72,14 @@ namespace WixToolset.Core | |||
71 | public Compiler(IServiceProvider serviceProvider) | 72 | public Compiler(IServiceProvider serviceProvider) |
72 | { | 73 | { |
73 | this.ServiceProvider = serviceProvider; | 74 | this.ServiceProvider = serviceProvider; |
75 | |||
76 | this.Messaging = serviceProvider.GetService<IMessaging>(); | ||
74 | } | 77 | } |
75 | 78 | ||
76 | private IServiceProvider ServiceProvider { get; } | 79 | private IServiceProvider ServiceProvider { get; } |
77 | 80 | ||
81 | public IMessaging Messaging { get; } | ||
82 | |||
78 | private ICompileContext Context { get; set; } | 83 | private ICompileContext Context { get; set; } |
79 | 84 | ||
80 | private CompilerCore Core { get; set; } | 85 | private CompilerCore Core { get; set; } |
@@ -107,7 +112,6 @@ namespace WixToolset.Core | |||
107 | public Intermediate Execute() | 112 | public Intermediate Execute() |
108 | { | 113 | { |
109 | this.Context = this.ServiceProvider.GetService<ICompileContext>(); | 114 | this.Context = this.ServiceProvider.GetService<ICompileContext>(); |
110 | this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
111 | this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ICompilerExtension>(); | 115 | this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ICompilerExtension>(); |
112 | this.Context.CompilationId = this.CompliationId; | 116 | this.Context.CompilationId = this.CompliationId; |
113 | this.Context.OutputPath = this.OutputPath; | 117 | this.Context.OutputPath = this.OutputPath; |
@@ -131,7 +135,7 @@ namespace WixToolset.Core | |||
131 | } | 135 | } |
132 | else | 136 | else |
133 | { | 137 | { |
134 | this.Context.Messaging.Write(ErrorMessages.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString())); | 138 | this.Messaging.Write(ErrorMessages.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString())); |
135 | } | 139 | } |
136 | 140 | ||
137 | extension.PreCompile(this.Context); | 141 | extension.PreCompile(this.Context); |
@@ -142,9 +146,9 @@ namespace WixToolset.Core | |||
142 | { | 146 | { |
143 | var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>(); | 147 | var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>(); |
144 | 148 | ||
145 | this.Core = new CompilerCore(target, this.Context.Messaging, parseHelper, extensionsByNamespace); | 149 | this.Core = new CompilerCore(target, this.Messaging, parseHelper, extensionsByNamespace); |
146 | this.Core.ShowPedanticMessages = this.ShowPedanticMessages; | 150 | this.Core.ShowPedanticMessages = this.ShowPedanticMessages; |
147 | this.componentIdPlaceholdersResolver = new WixVariableResolver(this.Context.Messaging); | 151 | this.componentIdPlaceholdersResolver = new WixVariableResolver(this.Messaging); |
148 | 152 | ||
149 | // parse the document | 153 | // parse the document |
150 | var source = this.Context.Source; | 154 | var source = this.Context.Source; |
@@ -185,7 +189,7 @@ namespace WixToolset.Core | |||
185 | this.Core = null; | 189 | this.Core = null; |
186 | } | 190 | } |
187 | 191 | ||
188 | return this.Context.Messaging.EncounteredError ? null : target; | 192 | return this.Messaging.EncounteredError ? null : target; |
189 | } | 193 | } |
190 | 194 | ||
191 | private void ResolveComponentIdPlaceholders(Intermediate target) | 195 | private void ResolveComponentIdPlaceholders(Intermediate target) |
diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index 651c80a3..c9165b52 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs | |||
@@ -14,6 +14,7 @@ namespace WixToolset.Core | |||
14 | using System.Xml.Linq; | 14 | using System.Xml.Linq; |
15 | using WixToolset.Data; | 15 | using WixToolset.Data; |
16 | using WixToolset.Extensibility; | 16 | using WixToolset.Extensibility; |
17 | using WixToolset.Extensibility.Data; | ||
17 | using WixToolset.Extensibility.Services; | 18 | using WixToolset.Extensibility.Services; |
18 | using Wix = WixToolset.Data.Serialize; | 19 | using Wix = WixToolset.Data.Serialize; |
19 | 20 | ||
diff --git a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs index b65abdfb..f62f8f10 100644 --- a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs | |||
@@ -12,10 +12,11 @@ namespace WixToolset.Core.ExtensibilityServices | |||
12 | using System.Text.RegularExpressions; | 12 | using System.Text.RegularExpressions; |
13 | using System.Xml.Linq; | 13 | using System.Xml.Linq; |
14 | using WixToolset.Data; | 14 | using WixToolset.Data; |
15 | using Wix = WixToolset.Data.Serialize; | ||
16 | using WixToolset.Data.Tuples; | 15 | using WixToolset.Data.Tuples; |
17 | using WixToolset.Extensibility; | 16 | using WixToolset.Extensibility; |
17 | using WixToolset.Extensibility.Data; | ||
18 | using WixToolset.Extensibility.Services; | 18 | using WixToolset.Extensibility.Services; |
19 | using Wix = WixToolset.Data.Serialize; | ||
19 | 20 | ||
20 | internal class ParseHelper : IParseHelper | 21 | internal class ParseHelper : IParseHelper |
21 | { | 22 | { |
diff --git a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs index 0331c815..0e4bba51 100644 --- a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs | |||
@@ -9,6 +9,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
9 | using System.Xml.Linq; | 9 | using System.Xml.Linq; |
10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
11 | using WixToolset.Extensibility; | 11 | using WixToolset.Extensibility; |
12 | using WixToolset.Extensibility.Data; | ||
12 | using WixToolset.Extensibility.Services; | 13 | using WixToolset.Extensibility.Services; |
13 | 14 | ||
14 | internal class PreprocessHelper : IPreprocessHelper | 15 | internal class PreprocessHelper : IPreprocessHelper |
@@ -19,10 +20,14 @@ namespace WixToolset.Core.ExtensibilityServices | |||
19 | public PreprocessHelper(IServiceProvider serviceProvider) | 20 | public PreprocessHelper(IServiceProvider serviceProvider) |
20 | { | 21 | { |
21 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
23 | |||
24 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
22 | } | 25 | } |
23 | 26 | ||
24 | private IServiceProvider ServiceProvider { get; } | 27 | private IServiceProvider ServiceProvider { get; } |
25 | 28 | ||
29 | private IMessaging Messaging { get; } | ||
30 | |||
26 | private Dictionary<string, IPreprocessorExtension> ExtensionsByPrefix { get; set; } | 31 | private Dictionary<string, IPreprocessorExtension> ExtensionsByPrefix { get; set; } |
27 | 32 | ||
28 | public void AddVariable(IPreprocessContext context, string name, string value) | 33 | public void AddVariable(IPreprocessContext context, string name, string value) |
@@ -42,7 +47,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
42 | { | 47 | { |
43 | if (showWarning) | 48 | if (showWarning) |
44 | { | 49 | { |
45 | context.Messaging.Write(WarningMessages.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue)); | 50 | this.Messaging.Write(WarningMessages.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue)); |
46 | } | 51 | } |
47 | 52 | ||
48 | context.Variables[name] = value; | 53 | context.Variables[name] = value; |
@@ -220,7 +225,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
220 | return context.CurrentSourceLineNumber.FileName; | 225 | return context.CurrentSourceLineNumber.FileName; |
221 | 226 | ||
222 | case "PLATFORM": | 227 | case "PLATFORM": |
223 | context.Messaging.Write(WarningMessages.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)")); | 228 | this.Messaging.Write(WarningMessages.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)")); |
224 | 229 | ||
225 | goto case "BUILDARCH"; | 230 | goto case "BUILDARCH"; |
226 | 231 | ||
@@ -295,7 +300,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
295 | { | 300 | { |
296 | // Add any core defined pragmas here | 301 | // Add any core defined pragmas here |
297 | default: | 302 | default: |
298 | context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); | 303 | this.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); |
299 | break; | 304 | break; |
300 | } | 305 | } |
301 | break; | 306 | break; |
@@ -306,7 +311,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
306 | { | 311 | { |
307 | if (!extension.ProcessPragma(prefix, pragma, args, parent)) | 312 | if (!extension.ProcessPragma(prefix, pragma, args, parent)) |
308 | { | 313 | { |
309 | context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); | 314 | this.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); |
310 | } | 315 | } |
311 | } | 316 | } |
312 | break; | 317 | break; |
@@ -339,7 +344,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
339 | currentPosition = remainder.IndexOf(')'); | 344 | currentPosition = remainder.IndexOf(')'); |
340 | if (-1 == currentPosition) | 345 | if (-1 == currentPosition) |
341 | { | 346 | { |
342 | context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); | 347 | this.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); |
343 | break; | 348 | break; |
344 | } | 349 | } |
345 | 350 | ||
@@ -385,12 +390,12 @@ namespace WixToolset.Core.ExtensibilityServices | |||
385 | { | 390 | { |
386 | if (isFunction) | 391 | if (isFunction) |
387 | { | 392 | { |
388 | context.Messaging.Write(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder)); | 393 | this.Messaging.Write(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder)); |
389 | break; | 394 | break; |
390 | } | 395 | } |
391 | else | 396 | else |
392 | { | 397 | { |
393 | context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); | 398 | this.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); |
394 | break; | 399 | break; |
395 | } | 400 | } |
396 | } | 401 | } |
@@ -410,12 +415,12 @@ namespace WixToolset.Core.ExtensibilityServices | |||
410 | { | 415 | { |
411 | if (isFunction) | 416 | if (isFunction) |
412 | { | 417 | { |
413 | context.Messaging.Write(ErrorMessages.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString)); | 418 | this.Messaging.Write(ErrorMessages.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString)); |
414 | break; | 419 | break; |
415 | } | 420 | } |
416 | else | 421 | else |
417 | { | 422 | { |
418 | context.Messaging.Write(ErrorMessages.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString)); | 423 | this.Messaging.Write(ErrorMessages.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString)); |
419 | break; | 424 | break; |
420 | } | 425 | } |
421 | } | 426 | } |
@@ -448,7 +453,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
448 | { | 453 | { |
449 | if (!context.Variables.Remove(name)) | 454 | if (!context.Variables.Remove(name)) |
450 | { | 455 | { |
451 | context.Messaging.Write(ErrorMessages.CannotReundefineVariable(context.CurrentSourceLineNumber, name)); | 456 | this.Messaging.Write(ErrorMessages.CannotReundefineVariable(context.CurrentSourceLineNumber, name)); |
452 | } | 457 | } |
453 | } | 458 | } |
454 | 459 | ||
diff --git a/src/WixToolset.Core/IncribeContext.cs b/src/WixToolset.Core/IncribeContext.cs index 9e4e3602..9a002d68 100644 --- a/src/WixToolset.Core/IncribeContext.cs +++ b/src/WixToolset.Core/IncribeContext.cs | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility; | 6 | using WixToolset.Extensibility.Data; |
7 | using WixToolset.Extensibility.Services; | 7 | using WixToolset.Extensibility.Services; |
8 | 8 | ||
9 | internal class InscribeContext : IInscribeContext | 9 | internal class InscribeContext : IInscribeContext |
@@ -15,8 +15,6 @@ namespace WixToolset.Core | |||
15 | 15 | ||
16 | public IServiceProvider ServiceProvider { get; } | 16 | public IServiceProvider ServiceProvider { get; } |
17 | 17 | ||
18 | public IMessaging Messaging { get; set; } | ||
19 | |||
20 | public string IntermediateFolder { get; set; } | 18 | public string IntermediateFolder { get; set; } |
21 | 19 | ||
22 | public string InputFilePath { get; set; } | 20 | public string InputFilePath { get; set; } |
diff --git a/src/WixToolset.Core/Layout.cs b/src/WixToolset.Core/Layout.cs index d62335fb..a44c212d 100644 --- a/src/WixToolset.Core/Layout.cs +++ b/src/WixToolset.Core/Layout.cs | |||
@@ -8,8 +8,8 @@ namespace WixToolset.Core | |||
8 | using System.Linq; | 8 | using System.Linq; |
9 | using WixToolset.Core.Bind; | 9 | using WixToolset.Core.Bind; |
10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
11 | using WixToolset.Data.Bind; | ||
12 | using WixToolset.Extensibility; | 11 | using WixToolset.Extensibility; |
12 | using WixToolset.Extensibility.Data; | ||
13 | using WixToolset.Extensibility.Services; | 13 | using WixToolset.Extensibility.Services; |
14 | 14 | ||
15 | /// <summary> | 15 | /// <summary> |
@@ -20,10 +20,14 @@ namespace WixToolset.Core | |||
20 | public Layout(IServiceProvider serviceProvider) | 20 | public Layout(IServiceProvider serviceProvider) |
21 | { | 21 | { |
22 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
23 | |||
24 | this.Messaging = serviceProvider.GetService<IMessaging>(); | ||
23 | } | 25 | } |
24 | 26 | ||
25 | private IServiceProvider ServiceProvider { get; } | 27 | private IServiceProvider ServiceProvider { get; } |
26 | 28 | ||
29 | private IMessaging Messaging { get; } | ||
30 | |||
27 | public IEnumerable<FileTransfer> FileTransfers { get; set; } | 31 | public IEnumerable<FileTransfer> FileTransfers { get; set; } |
28 | 32 | ||
29 | public IEnumerable<string> ContentFilePaths { get; set; } | 33 | public IEnumerable<string> ContentFilePaths { get; set; } |
@@ -36,21 +40,16 @@ namespace WixToolset.Core | |||
36 | 40 | ||
37 | public bool SuppressAclReset { get; set; } | 41 | public bool SuppressAclReset { get; set; } |
38 | 42 | ||
39 | private IMessaging Messaging { get; set; } | ||
40 | |||
41 | public void Execute() | 43 | public void Execute() |
42 | { | 44 | { |
43 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
44 | |||
45 | var extensionManager = this.ServiceProvider.GetService<IExtensionManager>(); | 45 | var extensionManager = this.ServiceProvider.GetService<IExtensionManager>(); |
46 | 46 | ||
47 | var context = this.ServiceProvider.GetService<ILayoutContext>(); | 47 | var context = this.ServiceProvider.GetService<ILayoutContext>(); |
48 | context.Messaging = this.Messaging; | ||
49 | context.Extensions = extensionManager.Create<ILayoutExtension>(); | 48 | context.Extensions = extensionManager.Create<ILayoutExtension>(); |
50 | context.FileTransfers = this.FileTransfers; | 49 | context.FileTransfers = this.FileTransfers; |
51 | context.ContentFilePaths = this.ContentFilePaths; | 50 | context.ContentFilePaths = this.ContentFilePaths; |
52 | context.ContentsFile = this.ContentsFile; | 51 | context.ContentsFile = this.ContentsFile; |
53 | context.OutputPdbPath = this.OutputsFile; | 52 | context.OutputsFile = this.OutputsFile; |
54 | context.BuiltOutputsFile = this.BuiltOutputsFile; | 53 | context.BuiltOutputsFile = this.BuiltOutputsFile; |
55 | context.SuppressAclReset = this.SuppressAclReset; | 54 | context.SuppressAclReset = this.SuppressAclReset; |
56 | 55 | ||
@@ -69,7 +68,7 @@ namespace WixToolset.Core | |||
69 | { | 68 | { |
70 | this.Messaging.Write(VerboseMessages.LayingOutMedia()); | 69 | this.Messaging.Write(VerboseMessages.LayingOutMedia()); |
71 | 70 | ||
72 | var command = new TransferFilesCommand(context.Messaging, context.Extensions, context.FileTransfers, context.SuppressAclReset); | 71 | var command = new TransferFilesCommand(this.Messaging, context.Extensions, context.FileTransfers, context.SuppressAclReset); |
73 | command.Execute(); | 72 | command.Execute(); |
74 | } | 73 | } |
75 | } | 74 | } |
diff --git a/src/WixToolset.Core/LayoutContext.cs b/src/WixToolset.Core/LayoutContext.cs index 24f171a9..af0df518 100644 --- a/src/WixToolset.Core/LayoutContext.cs +++ b/src/WixToolset.Core/LayoutContext.cs | |||
@@ -4,9 +4,8 @@ namespace WixToolset.Core | |||
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data.Bind; | ||
8 | using WixToolset.Extensibility; | 7 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Services; | 8 | using WixToolset.Extensibility.Data; |
10 | 9 | ||
11 | public class LayoutContext : ILayoutContext | 10 | public class LayoutContext : ILayoutContext |
12 | { | 11 | { |
@@ -17,8 +16,6 @@ namespace WixToolset.Core | |||
17 | 16 | ||
18 | public IServiceProvider ServiceProvider { get; } | 17 | public IServiceProvider ServiceProvider { get; } |
19 | 18 | ||
20 | public IMessaging Messaging { get; set; } | ||
21 | |||
22 | public IEnumerable<ILayoutExtension> Extensions { get; set; } | 19 | public IEnumerable<ILayoutExtension> Extensions { get; set; } |
23 | 20 | ||
24 | public IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; } | 21 | public IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; } |
diff --git a/src/WixToolset.Core/Librarian.cs b/src/WixToolset.Core/Librarian.cs index c42356ac..15efcfcc 100644 --- a/src/WixToolset.Core/Librarian.cs +++ b/src/WixToolset.Core/Librarian.cs | |||
@@ -9,6 +9,7 @@ namespace WixToolset.Core | |||
9 | using WixToolset.Core.Link; | 9 | using WixToolset.Core.Link; |
10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
11 | using WixToolset.Extensibility; | 11 | using WixToolset.Extensibility; |
12 | using WixToolset.Extensibility.Data; | ||
12 | using WixToolset.Extensibility.Services; | 13 | using WixToolset.Extensibility.Services; |
13 | 14 | ||
14 | /// <summary> | 15 | /// <summary> |
@@ -19,10 +20,14 @@ namespace WixToolset.Core | |||
19 | public Librarian(IServiceProvider serviceProvider) | 20 | public Librarian(IServiceProvider serviceProvider) |
20 | { | 21 | { |
21 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
23 | |||
24 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
22 | } | 25 | } |
23 | 26 | ||
24 | private IServiceProvider ServiceProvider { get; } | 27 | private IServiceProvider ServiceProvider { get; } |
25 | 28 | ||
29 | private IMessaging Messaging { get; } | ||
30 | |||
26 | private ILibraryContext Context { get; set; } | 31 | private ILibraryContext Context { get; set; } |
27 | 32 | ||
28 | public bool BindFiles { get; set; } | 33 | public bool BindFiles { get; set; } |
@@ -41,7 +46,6 @@ namespace WixToolset.Core | |||
41 | public Intermediate Execute() | 46 | public Intermediate Execute() |
42 | { | 47 | { |
43 | this.Context = new LibraryContext(this.ServiceProvider); | 48 | this.Context = new LibraryContext(this.ServiceProvider); |
44 | this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
45 | this.Context.BindFiles = this.BindFiles; | 49 | this.Context.BindFiles = this.BindFiles; |
46 | this.Context.BindPaths = this.BindPaths; | 50 | this.Context.BindPaths = this.BindPaths; |
47 | this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ILibrarianExtension>(); | 51 | this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ILibrarianExtension>(); |
@@ -59,10 +63,10 @@ namespace WixToolset.Core | |||
59 | { | 63 | { |
60 | var sections = this.Context.Intermediates.SelectMany(i => i.Sections).ToList(); | 64 | var sections = this.Context.Intermediates.SelectMany(i => i.Sections).ToList(); |
61 | 65 | ||
62 | var collate = new CollateLocalizationsCommand(this.Context.Messaging, this.Context.Localizations); | 66 | var collate = new CollateLocalizationsCommand(this.Messaging, this.Context.Localizations); |
63 | var localizationsByCulture = collate.Execute(); | 67 | var localizationsByCulture = collate.Execute(); |
64 | 68 | ||
65 | if (this.Context.Messaging.EncounteredError) | 69 | if (this.Messaging.EncounteredError) |
66 | { | 70 | { |
67 | return null; | 71 | return null; |
68 | } | 72 | } |
@@ -86,7 +90,7 @@ namespace WixToolset.Core | |||
86 | } | 90 | } |
87 | } | 91 | } |
88 | 92 | ||
89 | return this.Context.Messaging.EncounteredError ? null : library; | 93 | return this.Messaging.EncounteredError ? null : library; |
90 | } | 94 | } |
91 | 95 | ||
92 | /// <summary> | 96 | /// <summary> |
@@ -95,7 +99,7 @@ namespace WixToolset.Core | |||
95 | /// <param name="library">Library to validate.</param> | 99 | /// <param name="library">Library to validate.</param> |
96 | private void Validate(Intermediate library) | 100 | private void Validate(Intermediate library) |
97 | { | 101 | { |
98 | FindEntrySectionAndLoadSymbolsCommand find = new FindEntrySectionAndLoadSymbolsCommand(this.Context.Messaging, library.Sections); | 102 | FindEntrySectionAndLoadSymbolsCommand find = new FindEntrySectionAndLoadSymbolsCommand(this.Messaging, library.Sections); |
99 | find.Execute(); | 103 | find.Execute(); |
100 | 104 | ||
101 | // TODO: Consider bringing this sort of verification back. | 105 | // TODO: Consider bringing this sort of verification back. |
@@ -116,7 +120,7 @@ namespace WixToolset.Core | |||
116 | // Resolve paths to files that are to be embedded in the library. | 120 | // Resolve paths to files that are to be embedded in the library. |
117 | if (this.Context.BindFiles) | 121 | if (this.Context.BindFiles) |
118 | { | 122 | { |
119 | var variableResolver = new WixVariableResolver(this.Context.Messaging); | 123 | var variableResolver = new WixVariableResolver(this.Messaging); |
120 | 124 | ||
121 | var fileResolver = new FileResolver(this.Context.BindPaths, this.Context.Extensions); | 125 | var fileResolver = new FileResolver(this.Context.BindPaths, this.Context.Extensions); |
122 | 126 | ||
@@ -141,7 +145,7 @@ namespace WixToolset.Core | |||
141 | } | 145 | } |
142 | else | 146 | else |
143 | { | 147 | { |
144 | this.Context.Messaging.Write(ErrorMessages.FileNotFound(tuple.SourceLineNumbers, pathField.Path, tuple.Definition.Name)); | 148 | this.Messaging.Write(ErrorMessages.FileNotFound(tuple.SourceLineNumbers, pathField.Path, tuple.Definition.Name)); |
145 | } | 149 | } |
146 | } | 150 | } |
147 | } | 151 | } |
diff --git a/src/WixToolset.Core/LibraryContext.cs b/src/WixToolset.Core/LibraryContext.cs index 56a9389f..0b09aa93 100644 --- a/src/WixToolset.Core/LibraryContext.cs +++ b/src/WixToolset.Core/LibraryContext.cs | |||
@@ -6,6 +6,7 @@ namespace WixToolset.Core | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Data; | ||
9 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
10 | 11 | ||
11 | public class LibraryContext : ILibraryContext | 12 | public class LibraryContext : ILibraryContext |
diff --git a/src/WixToolset.Core/LinkContext.cs b/src/WixToolset.Core/LinkContext.cs index b4474ec5..7576ca3f 100644 --- a/src/WixToolset.Core/LinkContext.cs +++ b/src/WixToolset.Core/LinkContext.cs | |||
@@ -6,7 +6,7 @@ namespace WixToolset.Core | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Services; | 9 | using WixToolset.Extensibility.Data; |
10 | 10 | ||
11 | public class LinkContext : ILinkContext | 11 | public class LinkContext : ILinkContext |
12 | { | 12 | { |
@@ -17,8 +17,6 @@ namespace WixToolset.Core | |||
17 | 17 | ||
18 | public IServiceProvider ServiceProvider { get; } | 18 | public IServiceProvider ServiceProvider { get; } |
19 | 19 | ||
20 | public IMessaging Messaging { get; set; } | ||
21 | |||
22 | public IEnumerable<ILinkerExtension> Extensions { get; set; } | 20 | public IEnumerable<ILinkerExtension> Extensions { get; set; } |
23 | 21 | ||
24 | public IEnumerable<IExtensionData> ExtensionData { get; set; } | 22 | public IEnumerable<IExtensionData> ExtensionData { get; set; } |
diff --git a/src/WixToolset.Core/Linker.cs b/src/WixToolset.Core/Linker.cs index db2514fb..4d1a6965 100644 --- a/src/WixToolset.Core/Linker.cs +++ b/src/WixToolset.Core/Linker.cs | |||
@@ -12,6 +12,7 @@ namespace WixToolset.Core | |||
12 | using WixToolset.Data; | 12 | using WixToolset.Data; |
13 | using WixToolset.Data.Tuples; | 13 | using WixToolset.Data.Tuples; |
14 | using WixToolset.Extensibility; | 14 | using WixToolset.Extensibility; |
15 | using WixToolset.Extensibility.Data; | ||
15 | using WixToolset.Extensibility.Services; | 16 | using WixToolset.Extensibility.Services; |
16 | using WixToolset.Link; | 17 | using WixToolset.Link; |
17 | 18 | ||
@@ -31,11 +32,14 @@ namespace WixToolset.Core | |||
31 | public Linker(IServiceProvider serviceProvider) | 32 | public Linker(IServiceProvider serviceProvider) |
32 | { | 33 | { |
33 | this.ServiceProvider = serviceProvider; | 34 | this.ServiceProvider = serviceProvider; |
35 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
34 | this.sectionIdOnRows = true; // TODO: what is the correct value for this? | 36 | this.sectionIdOnRows = true; // TODO: what is the correct value for this? |
35 | } | 37 | } |
36 | 38 | ||
37 | private IServiceProvider ServiceProvider { get; } | 39 | private IServiceProvider ServiceProvider { get; } |
38 | 40 | ||
41 | private IMessaging Messaging { get; } | ||
42 | |||
39 | private ILinkContext Context { get; set; } | 43 | private ILinkContext Context { get; set; } |
40 | 44 | ||
41 | /// <summary> | 45 | /// <summary> |
@@ -71,7 +75,6 @@ namespace WixToolset.Core | |||
71 | var creator = this.TupleDefinitionCreator ?? this.ServiceProvider.GetService<ITupleDefinitionCreator>(); | 75 | var creator = this.TupleDefinitionCreator ?? this.ServiceProvider.GetService<ITupleDefinitionCreator>(); |
72 | 76 | ||
73 | this.Context = this.ServiceProvider.GetService<ILinkContext>(); | 77 | this.Context = this.ServiceProvider.GetService<ILinkContext>(); |
74 | this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
75 | this.Context.Extensions = extensionManager.Create<ILinkerExtension>(); | 78 | this.Context.Extensions = extensionManager.Create<ILinkerExtension>(); |
76 | this.Context.ExtensionData = extensionManager.Create<IExtensionData>(); | 79 | this.Context.ExtensionData = extensionManager.Create<IExtensionData>(); |
77 | this.Context.ExpectedOutputType = this.OutputType; | 80 | this.Context.ExpectedOutputType = this.OutputType; |
@@ -151,7 +154,7 @@ namespace WixToolset.Core | |||
151 | 154 | ||
152 | // First find the entry section and while processing all sections load all the symbols from all of the sections. | 155 | // First find the entry section and while processing all sections load all the symbols from all of the sections. |
153 | // sections.FindEntrySectionAndLoadSymbols(false, this, expectedOutputType, out entrySection, out allSymbols); | 156 | // sections.FindEntrySectionAndLoadSymbols(false, this, expectedOutputType, out entrySection, out allSymbols); |
154 | var find = new FindEntrySectionAndLoadSymbolsCommand(this.Context.Messaging, sections); | 157 | var find = new FindEntrySectionAndLoadSymbolsCommand(this.Messaging, sections); |
155 | find.ExpectedOutputType = this.Context.ExpectedOutputType; | 158 | find.ExpectedOutputType = this.Context.ExpectedOutputType; |
156 | find.Execute(); | 159 | find.Execute(); |
157 | 160 | ||
@@ -166,12 +169,12 @@ namespace WixToolset.Core | |||
166 | 169 | ||
167 | // Resolve the symbol references to find the set of sections we care about for linking. | 170 | // Resolve the symbol references to find the set of sections we care about for linking. |
168 | // Of course, we start with the entry section (that's how it got its name after all). | 171 | // Of course, we start with the entry section (that's how it got its name after all). |
169 | var resolve = new ResolveReferencesCommand(this.Context.Messaging, find.EntrySection, find.Symbols); | 172 | var resolve = new ResolveReferencesCommand(this.Messaging, find.EntrySection, find.Symbols); |
170 | resolve.BuildingMergeModule = (SectionType.Module == find.EntrySection.Type); | 173 | resolve.BuildingMergeModule = (SectionType.Module == find.EntrySection.Type); |
171 | 174 | ||
172 | resolve.Execute(); | 175 | resolve.Execute(); |
173 | 176 | ||
174 | if (this.Context.Messaging.EncounteredError) | 177 | if (this.Messaging.EncounteredError) |
175 | { | 178 | { |
176 | return null; | 179 | return null; |
177 | } | 180 | } |
@@ -185,7 +188,7 @@ namespace WixToolset.Core | |||
185 | 188 | ||
186 | this.FlattenSectionsComplexReferences(sections); | 189 | this.FlattenSectionsComplexReferences(sections); |
187 | 190 | ||
188 | if (this.Context.Messaging.EncounteredError) | 191 | if (this.Messaging.EncounteredError) |
189 | { | 192 | { |
190 | return null; | 193 | return null; |
191 | } | 194 | } |
@@ -197,7 +200,7 @@ namespace WixToolset.Core | |||
197 | var modulesToFeatures = new ConnectToFeatureCollection(); | 200 | var modulesToFeatures = new ConnectToFeatureCollection(); |
198 | this.ProcessComplexReferences(find.EntrySection, sections, referencedComponents, componentsToFeatures, featuresToFeatures, modulesToFeatures); | 201 | this.ProcessComplexReferences(find.EntrySection, sections, referencedComponents, componentsToFeatures, featuresToFeatures, modulesToFeatures); |
199 | 202 | ||
200 | if (this.Context.Messaging.EncounteredError) | 203 | if (this.Messaging.EncounteredError) |
201 | { | 204 | { |
202 | return null; | 205 | return null; |
203 | } | 206 | } |
@@ -212,10 +215,10 @@ namespace WixToolset.Core | |||
212 | } | 215 | } |
213 | 216 | ||
214 | // Report duplicates that would ultimately end up being primary key collisions. | 217 | // Report duplicates that would ultimately end up being primary key collisions. |
215 | var reportDupes = new ReportConflictingSymbolsCommand(this.Context.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections); | 218 | var reportDupes = new ReportConflictingSymbolsCommand(this.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections); |
216 | reportDupes.Execute(); | 219 | reportDupes.Execute(); |
217 | 220 | ||
218 | if (this.Context.Messaging.EncounteredError) | 221 | if (this.Messaging.EncounteredError) |
219 | { | 222 | { |
220 | return null; | 223 | return null; |
221 | } | 224 | } |
@@ -716,12 +719,12 @@ namespace WixToolset.Core | |||
716 | // Bundles have groups of data that must be flattened in a way different from other types. | 719 | // Bundles have groups of data that must be flattened in a way different from other types. |
717 | this.FlattenBundleTables(resolvedSection); | 720 | this.FlattenBundleTables(resolvedSection); |
718 | 721 | ||
719 | if (this.Context.Messaging.EncounteredError) | 722 | if (this.Messaging.EncounteredError) |
720 | { | 723 | { |
721 | return null; | 724 | return null; |
722 | } | 725 | } |
723 | 726 | ||
724 | var collate = new CollateLocalizationsCommand(this.Context.Messaging, localizations); | 727 | var collate = new CollateLocalizationsCommand(this.Messaging, localizations); |
725 | var localizationsByCulture = collate.Execute(); | 728 | var localizationsByCulture = collate.Execute(); |
726 | 729 | ||
727 | intermediate = new Intermediate(resolvedSection.Id, new[] { resolvedSection }, localizationsByCulture, null); | 730 | intermediate = new Intermediate(resolvedSection.Id, new[] { resolvedSection }, localizationsByCulture, null); |
@@ -738,7 +741,7 @@ namespace WixToolset.Core | |||
738 | } | 741 | } |
739 | } | 742 | } |
740 | 743 | ||
741 | return this.Context.Messaging.EncounteredError ? null : intermediate; | 744 | return this.Messaging.EncounteredError ? null : intermediate; |
742 | } | 745 | } |
743 | 746 | ||
744 | #if SOLVE_CUSTOM_TABLE | 747 | #if SOLVE_CUSTOM_TABLE |
@@ -1118,7 +1121,7 @@ namespace WixToolset.Core | |||
1118 | /// <param name="message">Message event arguments.</param> | 1121 | /// <param name="message">Message event arguments.</param> |
1119 | public void OnMessage(Message message) | 1122 | public void OnMessage(Message message) |
1120 | { | 1123 | { |
1121 | this.Context.Messaging.Write(message); | 1124 | this.Messaging.Write(message); |
1122 | } | 1125 | } |
1123 | 1126 | ||
1124 | /// <summary> | 1127 | /// <summary> |
@@ -1616,7 +1619,7 @@ namespace WixToolset.Core | |||
1616 | // will hold Payloads under UX, ChainPackages (references?) under Chain, | 1619 | // will hold Payloads under UX, ChainPackages (references?) under Chain, |
1617 | // and ChainPackages/Payloads under the attached and any detatched | 1620 | // and ChainPackages/Payloads under the attached and any detatched |
1618 | // Containers. | 1621 | // Containers. |
1619 | var groups = new WixGroupingOrdering(entrySection, this.Context.Messaging); | 1622 | var groups = new WixGroupingOrdering(entrySection, this.Messaging); |
1620 | 1623 | ||
1621 | // Create UX payloads and Package payloads | 1624 | // Create UX payloads and Package payloads |
1622 | groups.UseTypes(new string[] { "Container", "Layout", "PackageGroup", "PayloadGroup", "Package" }, new string[] { "PackageGroup", "Package", "PayloadGroup", "Payload" }); | 1625 | groups.UseTypes(new string[] { "Container", "Layout", "PackageGroup", "PayloadGroup", "Package" }, new string[] { "PackageGroup", "Package", "PayloadGroup", "Payload" }); |
diff --git a/src/WixToolset.Core/PreprocessContext.cs b/src/WixToolset.Core/PreprocessContext.cs index a6085b81..151506e2 100644 --- a/src/WixToolset.Core/PreprocessContext.cs +++ b/src/WixToolset.Core/PreprocessContext.cs | |||
@@ -6,7 +6,7 @@ namespace WixToolset.Core | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Services; | 9 | using WixToolset.Extensibility.Data; |
10 | 10 | ||
11 | internal class PreprocessContext : IPreprocessContext | 11 | internal class PreprocessContext : IPreprocessContext |
12 | { | 12 | { |
@@ -17,8 +17,6 @@ namespace WixToolset.Core | |||
17 | 17 | ||
18 | public IServiceProvider ServiceProvider { get; } | 18 | public IServiceProvider ServiceProvider { get; } |
19 | 19 | ||
20 | public IMessaging Messaging { get; set; } | ||
21 | |||
22 | public IEnumerable<IPreprocessorExtension> Extensions { get; set; } | 20 | public IEnumerable<IPreprocessorExtension> Extensions { get; set; } |
23 | 21 | ||
24 | public Platform Platform { get; set; } | 22 | public Platform Platform { get; set; } |
diff --git a/src/WixToolset.Core/Preprocessor.cs b/src/WixToolset.Core/Preprocessor.cs index 23d3f205..ac8cefe3 100644 --- a/src/WixToolset.Core/Preprocessor.cs +++ b/src/WixToolset.Core/Preprocessor.cs | |||
@@ -6,15 +6,16 @@ namespace WixToolset.Core | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using System.Globalization; | 7 | using System.Globalization; |
8 | using System.IO; | 8 | using System.IO; |
9 | using System.Linq; | ||
9 | using System.Text; | 10 | using System.Text; |
10 | using System.Text.RegularExpressions; | 11 | using System.Text.RegularExpressions; |
11 | using System.Xml; | 12 | using System.Xml; |
12 | using System.Xml.Linq; | 13 | using System.Xml.Linq; |
14 | using WixToolset.Core.Preprocess; | ||
13 | using WixToolset.Data; | 15 | using WixToolset.Data; |
14 | using WixToolset.Extensibility; | 16 | using WixToolset.Extensibility; |
15 | using WixToolset.Core.Preprocess; | 17 | using WixToolset.Extensibility.Data; |
16 | using WixToolset.Extensibility.Services; | 18 | using WixToolset.Extensibility.Services; |
17 | using System.Linq; | ||
18 | 19 | ||
19 | /// <summary> | 20 | /// <summary> |
20 | /// Preprocessor object | 21 | /// Preprocessor object |
@@ -39,6 +40,8 @@ namespace WixToolset.Core | |||
39 | public Preprocessor(IServiceProvider serviceProvider) | 40 | public Preprocessor(IServiceProvider serviceProvider) |
40 | { | 41 | { |
41 | this.ServiceProvider = serviceProvider; | 42 | this.ServiceProvider = serviceProvider; |
43 | |||
44 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
42 | } | 45 | } |
43 | 46 | ||
44 | public IEnumerable<string> IncludeSearchPaths { get; set; } | 47 | public IEnumerable<string> IncludeSearchPaths { get; set; } |
@@ -51,6 +54,8 @@ namespace WixToolset.Core | |||
51 | 54 | ||
52 | private IServiceProvider ServiceProvider { get; } | 55 | private IServiceProvider ServiceProvider { get; } |
53 | 56 | ||
57 | private IMessaging Messaging { get; } | ||
58 | |||
54 | private IPreprocessContext Context { get; set; } | 59 | private IPreprocessContext Context { get; set; } |
55 | 60 | ||
56 | private Stack<string> CurrentFileStack { get; } = new Stack<string>(); | 61 | private Stack<string> CurrentFileStack { get; } = new Stack<string>(); |
@@ -169,7 +174,7 @@ namespace WixToolset.Core | |||
169 | throw new WixException(ErrorMessages.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message)); | 174 | throw new WixException(ErrorMessages.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message)); |
170 | } | 175 | } |
171 | 176 | ||
172 | return this.Context.Messaging.EncounteredError ? null : output; | 177 | return this.Messaging.EncounteredError ? null : output; |
173 | } | 178 | } |
174 | 179 | ||
175 | /// <summary> | 180 | /// <summary> |
@@ -482,7 +487,7 @@ namespace WixToolset.Core | |||
482 | { | 487 | { |
483 | if ("Include" != reader.LocalName) | 488 | if ("Include" != reader.LocalName) |
484 | { | 489 | { |
485 | this.Context.Messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, reader.Name, "include", "Include")); | 490 | this.Messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, reader.Name, "include", "Include")); |
486 | } | 491 | } |
487 | 492 | ||
488 | this.IncludeNextStack.Pop(); | 493 | this.IncludeNextStack.Pop(); |
@@ -570,7 +575,7 @@ namespace WixToolset.Core | |||
570 | // Resolve other variables in the warning message. | 575 | // Resolve other variables in the warning message. |
571 | warningMessage = this.Helper.PreprocessString(this.Context, warningMessage); | 576 | warningMessage = this.Helper.PreprocessString(this.Context, warningMessage); |
572 | 577 | ||
573 | this.Context.Messaging.Write(WarningMessages.PreprocessorWarning(this.Context.CurrentSourceLineNumber, warningMessage)); | 578 | this.Messaging.Write(WarningMessages.PreprocessorWarning(this.Context.CurrentSourceLineNumber, warningMessage)); |
574 | } | 579 | } |
575 | 580 | ||
576 | /// <summary> | 581 | /// <summary> |
@@ -1431,7 +1436,6 @@ namespace WixToolset.Core | |||
1431 | private IPreprocessContext CreateContext() | 1436 | private IPreprocessContext CreateContext() |
1432 | { | 1437 | { |
1433 | var context = this.ServiceProvider.GetService<IPreprocessContext>(); | 1438 | var context = this.ServiceProvider.GetService<IPreprocessContext>(); |
1434 | context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
1435 | context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<IPreprocessorExtension>(); | 1439 | context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<IPreprocessorExtension>(); |
1436 | context.CurrentSourceLineNumber = new SourceLineNumber(this.SourcePath); | 1440 | context.CurrentSourceLineNumber = new SourceLineNumber(this.SourcePath); |
1437 | context.Platform = this.Platform; | 1441 | context.Platform = this.Platform; |
@@ -1456,7 +1460,7 @@ namespace WixToolset.Core | |||
1456 | } | 1460 | } |
1457 | else | 1461 | else |
1458 | { | 1462 | { |
1459 | this.Context.Messaging.Write(ErrorMessages.DuplicateExtensionPreprocessorType(extension.GetType().ToString(), prefix, collidingExtension.GetType().ToString())); | 1463 | this.Messaging.Write(ErrorMessages.DuplicateExtensionPreprocessorType(extension.GetType().ToString(), prefix, collidingExtension.GetType().ToString())); |
1460 | } | 1464 | } |
1461 | } | 1465 | } |
1462 | } | 1466 | } |
diff --git a/src/WixToolset.Core/ResolveContext.cs b/src/WixToolset.Core/ResolveContext.cs index d49a7d4b..65b991ea 100644 --- a/src/WixToolset.Core/ResolveContext.cs +++ b/src/WixToolset.Core/ResolveContext.cs | |||
@@ -6,6 +6,7 @@ namespace WixToolset.Core | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Data; | ||
9 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
10 | 11 | ||
11 | public class ResolveContext : IResolveContext | 12 | public class ResolveContext : IResolveContext |
@@ -17,8 +18,6 @@ namespace WixToolset.Core | |||
17 | 18 | ||
18 | public IServiceProvider ServiceProvider { get; } | 19 | public IServiceProvider ServiceProvider { get; } |
19 | 20 | ||
20 | public IMessaging Messaging { get; set; } | ||
21 | |||
22 | public IEnumerable<BindPath> BindPaths { get; set; } | 21 | public IEnumerable<BindPath> BindPaths { get; set; } |
23 | 22 | ||
24 | public IEnumerable<IResolverExtension> Extensions { get; set; } | 23 | public IEnumerable<IResolverExtension> Extensions { get; set; } |
diff --git a/src/WixToolset.Core/Resolver.cs b/src/WixToolset.Core/Resolver.cs index 503d4bb7..5e283f2c 100644 --- a/src/WixToolset.Core/Resolver.cs +++ b/src/WixToolset.Core/Resolver.cs | |||
@@ -9,6 +9,7 @@ namespace WixToolset.Core | |||
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Tuples; | 10 | using WixToolset.Data.Tuples; |
11 | using WixToolset.Extensibility; | 11 | using WixToolset.Extensibility; |
12 | using WixToolset.Extensibility.Data; | ||
12 | using WixToolset.Extensibility.Services; | 13 | using WixToolset.Extensibility.Services; |
13 | 14 | ||
14 | /// <summary> | 15 | /// <summary> |
@@ -19,9 +20,13 @@ namespace WixToolset.Core | |||
19 | public Resolver(IServiceProvider serviceProvider) | 20 | public Resolver(IServiceProvider serviceProvider) |
20 | { | 21 | { |
21 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
23 | |||
24 | this.Messaging = serviceProvider.GetService<IMessaging>(); | ||
22 | } | 25 | } |
23 | 26 | ||
24 | private IServiceProvider ServiceProvider { get; set; } | 27 | private IServiceProvider ServiceProvider { get; } |
28 | |||
29 | public IMessaging Messaging { get; } | ||
25 | 30 | ||
26 | public IEnumerable<BindPath> BindPaths { get; set; } | 31 | public IEnumerable<BindPath> BindPaths { get; set; } |
27 | 32 | ||
@@ -38,7 +43,6 @@ namespace WixToolset.Core | |||
38 | var extensionManager = this.ServiceProvider.GetService<IExtensionManager>(); | 43 | var extensionManager = this.ServiceProvider.GetService<IExtensionManager>(); |
39 | 44 | ||
40 | var context = this.ServiceProvider.GetService<IResolveContext>(); | 45 | var context = this.ServiceProvider.GetService<IResolveContext>(); |
41 | context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
42 | context.BindPaths = this.BindPaths; | 46 | context.BindPaths = this.BindPaths; |
43 | context.Extensions = extensionManager.Create<IResolverExtension>(); | 47 | context.Extensions = extensionManager.Create<IResolverExtension>(); |
44 | context.ExtensionData = extensionManager.Create<IExtensionData>(); | 48 | context.ExtensionData = extensionManager.Create<IExtensionData>(); |
@@ -46,7 +50,7 @@ namespace WixToolset.Core | |||
46 | context.IntermediateFolder = this.IntermediateFolder; | 50 | context.IntermediateFolder = this.IntermediateFolder; |
47 | context.IntermediateRepresentation = this.IntermediateRepresentation; | 51 | context.IntermediateRepresentation = this.IntermediateRepresentation; |
48 | context.Localizations = this.Localizations; | 52 | context.Localizations = this.Localizations; |
49 | context.VariableResolver = new WixVariableResolver(context.Messaging); | 53 | context.VariableResolver = new WixVariableResolver(this.Messaging); |
50 | 54 | ||
51 | foreach (IResolverExtension extension in context.Extensions) | 55 | foreach (IResolverExtension extension in context.Extensions) |
52 | { | 56 | { |
@@ -82,7 +86,7 @@ namespace WixToolset.Core | |||
82 | IEnumerable<DelayedField> delayedFields; | 86 | IEnumerable<DelayedField> delayedFields; |
83 | { | 87 | { |
84 | var command = new ResolveFieldsCommand(); | 88 | var command = new ResolveFieldsCommand(); |
85 | command.Messaging = context.Messaging; | 89 | command.Messaging = this.Messaging; |
86 | command.BuildingPatch = buildingPatch; | 90 | command.BuildingPatch = buildingPatch; |
87 | command.VariableResolver = context.VariableResolver; | 91 | command.VariableResolver = context.VariableResolver; |
88 | command.BindPaths = context.BindPaths; | 92 | command.BindPaths = context.BindPaths; |
diff --git a/src/WixToolset.Core/WixToolsetServiceProvider.cs b/src/WixToolset.Core/WixToolsetServiceProvider.cs index 7d318648..dd6da8c8 100644 --- a/src/WixToolset.Core/WixToolsetServiceProvider.cs +++ b/src/WixToolset.Core/WixToolsetServiceProvider.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Core | |||
7 | using WixToolset.Core.CommandLine; | 7 | using WixToolset.Core.CommandLine; |
8 | using WixToolset.Core.ExtensibilityServices; | 8 | using WixToolset.Core.ExtensibilityServices; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Extensibility; | 10 | using WixToolset.Extensibility.Data; |
11 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
12 | 12 | ||
13 | public class WixToolsetServiceProvider : IServiceProvider | 13 | public class WixToolsetServiceProvider : IServiceProvider |
@@ -27,7 +27,7 @@ namespace WixToolset.Core | |||
27 | // Transients. | 27 | // Transients. |
28 | { typeof(ICommandLineArguments), (provider, singletons) => new CommandLineArguments(provider) }, | 28 | { typeof(ICommandLineArguments), (provider, singletons) => new CommandLineArguments(provider) }, |
29 | { typeof(ICommandLineContext), (provider, singletons) => new CommandLineContext(provider) }, | 29 | { typeof(ICommandLineContext), (provider, singletons) => new CommandLineContext(provider) }, |
30 | { typeof(ICommandLine), (provider, singletons) => new CommandLineParser() }, | 30 | { typeof(ICommandLineParser), (provider, singletons) => new CommandLineParser(provider) }, |
31 | { typeof(IPreprocessContext), (provider, singletons) => new PreprocessContext(provider) }, | 31 | { typeof(IPreprocessContext), (provider, singletons) => new PreprocessContext(provider) }, |
32 | { typeof(ICompileContext), (provider, singletons) => new CompileContext(provider) }, | 32 | { typeof(ICompileContext), (provider, singletons) => new CompileContext(provider) }, |
33 | { typeof(ILinkContext), (provider, singletons) => new LinkContext(provider) }, | 33 | { typeof(ILinkContext), (provider, singletons) => new LinkContext(provider) }, |
diff --git a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs index 6f86e20d..8fed7944 100644 --- a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs +++ b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs | |||
@@ -5,6 +5,7 @@ namespace Example.Extension | |||
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Extensibility; | 7 | using WixToolset.Extensibility; |
8 | using WixToolset.Extensibility.Data; | ||
8 | using WixToolset.Extensibility.Services; | 9 | using WixToolset.Extensibility.Services; |
9 | 10 | ||
10 | internal class ExamplePreprocessorExtensionAndCommandLine : BasePreprocessorExtension, IExtensionCommandLine | 11 | internal class ExamplePreprocessorExtensionAndCommandLine : BasePreprocessorExtension, IExtensionCommandLine |
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 71e7dd68..516bd95c 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -64,8 +64,8 @@ | |||
64 | </ItemGroup> | 64 | </ItemGroup> |
65 | 65 | ||
66 | <ItemGroup> | 66 | <ItemGroup> |
67 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" /> | 67 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> |
68 | <PackageReference Include="xunit" Version="2.3.1" /> | 68 | <PackageReference Include="xunit" Version="2.4.0" /> |
69 | <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> | 69 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> |
70 | </ItemGroup> | 70 | </ItemGroup> |
71 | </Project> | 71 | </Project> |