diff options
author | Rob Mensching <rob@firegiant.com> | 2017-10-18 15:21:45 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-10-18 15:21:45 -0700 |
commit | 7efd412cda00b369bc331c9bedd8db971d98fee7 (patch) | |
tree | 20403b9a5372db2407200cefab1eed0bdcc19879 | |
parent | 475dd063933b8a23d8e47021e9b105a20699bbac (diff) | |
download | wix-7efd412cda00b369bc331c9bedd8db971d98fee7.tar.gz wix-7efd412cda00b369bc331c9bedd8db971d98fee7.tar.bz2 wix-7efd412cda00b369bc331c9bedd8db971d98fee7.zip |
Incorporate refactoring of WixToolset.Core assemblies
27 files changed, 427 insertions, 188 deletions
diff --git a/src/WixToolset.Extensibility/AssemblyInfo.cs b/src/WixToolset.Extensibility/AssemblyInfo.cs index 6512230a..b3740b2a 100644 --- a/src/WixToolset.Extensibility/AssemblyInfo.cs +++ b/src/WixToolset.Extensibility/AssemblyInfo.cs | |||
@@ -5,5 +5,5 @@ using System.Reflection; | |||
5 | using System.Runtime.InteropServices; | 5 | using System.Runtime.InteropServices; |
6 | 6 | ||
7 | [assembly: AssemblyCulture("")] | 7 | [assembly: AssemblyCulture("")] |
8 | [assembly:CLSCompliant(true)] | 8 | [assembly: CLSCompliant(true)] |
9 | [assembly: ComVisible(false)] | 9 | [assembly: ComVisible(false)] |
diff --git a/src/WixToolset.Extensibility/BindPath.cs b/src/WixToolset.Extensibility/BindPath.cs deleted file mode 100644 index 236ee4ec..00000000 --- a/src/WixToolset.Extensibility/BindPath.cs +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using System; | ||
6 | |||
7 | /// <summary> | ||
8 | /// Bind path representation. | ||
9 | /// </summary> | ||
10 | public class BindPath | ||
11 | { | ||
12 | /// <summary> | ||
13 | /// Creates an unnamed bind path. | ||
14 | /// </summary> | ||
15 | /// <param name="path">Path for the bind path.</param> | ||
16 | public BindPath(string path) : this(String.Empty, path) | ||
17 | { | ||
18 | } | ||
19 | |||
20 | /// <summary> | ||
21 | /// Creates a named bind path. | ||
22 | /// </summary> | ||
23 | /// <param name="name">Name of the bind path.</param> | ||
24 | /// <param name="path">Path for the bind path.</param> | ||
25 | public BindPath(string name, string path) | ||
26 | { | ||
27 | this.Name = name; | ||
28 | this.Path = path; | ||
29 | } | ||
30 | |||
31 | /// <summary> | ||
32 | /// Parses a bind path from its string representation | ||
33 | /// </summary> | ||
34 | /// <param name="bindPath">String representation of bind path that looks like: [name=]path</param> | ||
35 | /// <returns>Parsed bind path.</returns> | ||
36 | public static BindPath Parse(string bindPath) | ||
37 | { | ||
38 | string[] namedPath = bindPath.Split(new char[] { '=' }, 2); | ||
39 | return (1 == namedPath.Length) ? new BindPath(namedPath[0]) : new BindPath(namedPath[0], namedPath[1]); | ||
40 | } | ||
41 | |||
42 | /// <summary> | ||
43 | /// Name of the bind path or String.Empty if the path is unnamed. | ||
44 | /// </summary> | ||
45 | public string Name { get; set; } | ||
46 | |||
47 | /// <summary> | ||
48 | /// Path for the bind path. | ||
49 | /// </summary> | ||
50 | public string Path { get; set; } | ||
51 | } | ||
52 | } | ||
diff --git a/src/WixToolset.Extensibility/BindStage.cs b/src/WixToolset.Extensibility/BindStage.cs deleted file mode 100644 index 71ac5616..00000000 --- a/src/WixToolset.Extensibility/BindStage.cs +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | /// <summary> | ||
6 | /// Bind stage of a file.. The reason we need this is to change the ResolveFile behavior based on if | ||
7 | /// dynamic bindpath plugin is desirable. We cannot change the signature of ResolveFile since it might | ||
8 | /// break existing implementers which derived from BinderFileManager | ||
9 | /// </summary> | ||
10 | public enum BindStage | ||
11 | { | ||
12 | /// <summary> | ||
13 | /// Normal binding | ||
14 | /// </summary> | ||
15 | Normal, | ||
16 | |||
17 | /// <summary> | ||
18 | /// Bind the file path of the target build file | ||
19 | /// </summary> | ||
20 | Target, | ||
21 | |||
22 | /// <summary> | ||
23 | /// Bind the file path of the updated build file | ||
24 | /// </summary> | ||
25 | Updated, | ||
26 | } | ||
27 | } | ||
diff --git a/src/WixToolset.Extensibility/BinderExtension.cs b/src/WixToolset.Extensibility/BinderExtension.cs deleted file mode 100644 index c6ccb3c2..00000000 --- a/src/WixToolset.Extensibility/BinderExtension.cs +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | |||
7 | /// <summary> | ||
8 | /// Base class for creating an binder extension. | ||
9 | /// </summary> | ||
10 | public abstract class BinderExtension : IBinderExtension | ||
11 | { | ||
12 | /// <summary> | ||
13 | /// Gets or sets the binder core for the extension. | ||
14 | /// </summary> | ||
15 | /// <value>Binder core for the extension.</value> | ||
16 | public IBinderCore Core { get; set; } | ||
17 | |||
18 | |||
19 | /// <summary> | ||
20 | /// Called before binding occurs. | ||
21 | /// </summary> | ||
22 | public virtual void Initialize(Output output) | ||
23 | { | ||
24 | } | ||
25 | |||
26 | /// <summary> | ||
27 | /// Called after variable resolution occurs. | ||
28 | /// </summary> | ||
29 | public virtual void AfterResolvedFields(Output output) | ||
30 | { | ||
31 | } | ||
32 | |||
33 | /// <summary> | ||
34 | /// Called after all output changes occur and right before the output is bound into its final format. | ||
35 | /// </summary> | ||
36 | public virtual void Finish(Output output) | ||
37 | { | ||
38 | } | ||
39 | } | ||
40 | } | ||
diff --git a/src/WixToolset.Extensibility/BinderExtensionBase.cs b/src/WixToolset.Extensibility/BinderExtensionBase.cs new file mode 100644 index 00000000..a0b34a31 --- /dev/null +++ b/src/WixToolset.Extensibility/BinderExtensionBase.cs | |||
@@ -0,0 +1,55 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Data.Bind; | ||
7 | using WixToolset.Extensibility.Services; | ||
8 | |||
9 | public abstract class BinderExtensionBase : IBinderExtension | ||
10 | { | ||
11 | protected IBindContext Context { get; private set; } | ||
12 | |||
13 | /// <summary> | ||
14 | /// Called before binding occurs. | ||
15 | /// </summary> | ||
16 | public virtual void PreBind(IBindContext context) | ||
17 | { | ||
18 | this.Context = context; | ||
19 | } | ||
20 | |||
21 | /// <summary> | ||
22 | /// Called after variable resolution occurs. | ||
23 | /// </summary> | ||
24 | public virtual void AfterResolvedFields(Output output) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | public virtual string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage) | ||
29 | { | ||
30 | return null; | ||
31 | } | ||
32 | |||
33 | public virtual bool? CompareFiles(string targetFile, string updatedFile) | ||
34 | { | ||
35 | return null; | ||
36 | } | ||
37 | |||
38 | public virtual bool CopyFile(string source, string destination, bool overwrite) | ||
39 | { | ||
40 | return false; | ||
41 | } | ||
42 | |||
43 | public virtual bool MoveFile(string source, string destination, bool overwrite) | ||
44 | { | ||
45 | return false; | ||
46 | } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Called after binding is complete before the files are moved to their final locations. | ||
50 | /// </summary> | ||
51 | public virtual void PostBind(BindResult result) | ||
52 | { | ||
53 | } | ||
54 | } | ||
55 | } | ||
diff --git a/src/WixToolset.Extensibility/IBackend.cs b/src/WixToolset.Extensibility/IBackend.cs new file mode 100644 index 00000000..e38de544 --- /dev/null +++ b/src/WixToolset.Extensibility/IBackend.cs | |||
@@ -0,0 +1,17 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Data.Bind; | ||
7 | using WixToolset.Extensibility.Services; | ||
8 | |||
9 | public interface IBackend | ||
10 | { | ||
11 | BindResult Bind(IBindContext context); | ||
12 | |||
13 | Output Unbind(IUnbindContext context); | ||
14 | |||
15 | bool Inscribe(IInscribeContext context); | ||
16 | } | ||
17 | } | ||
diff --git a/src/WixToolset.Extensibility/IBackendFactory.cs b/src/WixToolset.Extensibility/IBackendFactory.cs new file mode 100644 index 00000000..12704c0f --- /dev/null +++ b/src/WixToolset.Extensibility/IBackendFactory.cs | |||
@@ -0,0 +1,11 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Extensibility.Services; | ||
6 | |||
7 | public interface IBackendFactory | ||
8 | { | ||
9 | bool TryCreateBackend(string outputType, string outputPath, IBindContext context, out IBackend backend); | ||
10 | } | ||
11 | } | ||
diff --git a/src/WixToolset.Extensibility/IBindVariableResolver.cs b/src/WixToolset.Extensibility/IBindVariableResolver.cs new file mode 100644 index 00000000..4c2c3003 --- /dev/null +++ b/src/WixToolset.Extensibility/IBindVariableResolver.cs | |||
@@ -0,0 +1,26 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Data.Rows; | ||
7 | |||
8 | public interface IBindVariableResolver | ||
9 | { | ||
10 | int VariableCount { get; } | ||
11 | |||
12 | void AddVariable(string name, string value); | ||
13 | |||
14 | void AddVariable(WixVariableRow wixVariableRow); | ||
15 | |||
16 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly); | ||
17 | |||
18 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, bool errorOnUnknown, out bool isDefault, out bool delayedResolve); | ||
19 | |||
20 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault); | ||
21 | |||
22 | string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault, out bool delayedResolve); | ||
23 | |||
24 | bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl); | ||
25 | } | ||
26 | } | ||
diff --git a/src/WixToolset.Extensibility/IBinderExtension.cs b/src/WixToolset.Extensibility/IBinderExtension.cs index 19790b14..9673d60e 100644 --- a/src/WixToolset.Extensibility/IBinderExtension.cs +++ b/src/WixToolset.Extensibility/IBinderExtension.cs | |||
@@ -3,6 +3,8 @@ | |||
3 | namespace WixToolset.Extensibility | 3 | namespace WixToolset.Extensibility |
4 | { | 4 | { |
5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
6 | using WixToolset.Data.Bind; | ||
7 | using WixToolset.Extensibility.Services; | ||
6 | 8 | ||
7 | /// <summary> | 9 | /// <summary> |
8 | /// Interface all binder extensions implement. | 10 | /// Interface all binder extensions implement. |
@@ -10,24 +12,26 @@ namespace WixToolset.Extensibility | |||
10 | public interface IBinderExtension | 12 | public interface IBinderExtension |
11 | { | 13 | { |
12 | /// <summary> | 14 | /// <summary> |
13 | /// Gets or sets the binder core for the extension. | ||
14 | /// </summary> | ||
15 | /// <value>Binder core for the extension.</value> | ||
16 | IBinderCore Core { get; set; } | ||
17 | |||
18 | /// <summary> | ||
19 | /// Called before binding occurs. | 15 | /// Called before binding occurs. |
20 | /// </summary> | 16 | /// </summary> |
21 | void Initialize(Output output); | 17 | void PreBind(IBindContext context); |
22 | 18 | ||
23 | /// <summary> | 19 | /// <summary> |
24 | /// Called after variable resolution occurs. | 20 | /// Called after variable resolution occurs. |
25 | /// </summary> | 21 | /// </summary> |
26 | void AfterResolvedFields(Output output); | 22 | void AfterResolvedFields(Output output); |
27 | 23 | ||
24 | string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); | ||
25 | |||
26 | bool? CompareFiles(string targetFile, string updatedFile); | ||
27 | |||
28 | bool CopyFile(string source, string destination, bool overwrite); | ||
29 | |||
30 | bool MoveFile(string source, string destination, bool overwrite); | ||
31 | |||
28 | /// <summary> | 32 | /// <summary> |
29 | /// Called after all output changes occur and right before the output is bound into its final format. | 33 | /// Called after all output changes occur and right before the output is bound into its final format. |
30 | /// </summary> | 34 | /// </summary> |
31 | void Finish(Output output); | 35 | void PostBind(BindResult result); |
32 | } | 36 | } |
33 | } | 37 | } |
diff --git a/src/WixToolset.Extensibility/IBinderFileManager.cs b/src/WixToolset.Extensibility/IBinderFileManager.cs deleted file mode 100644 index 3a2b1d40..00000000 --- a/src/WixToolset.Extensibility/IBinderFileManager.cs +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using System.Collections.Generic; | ||
6 | using WixToolset.Data; | ||
7 | using WixToolset.Data.Rows; | ||
8 | |||
9 | public interface IBinderFileManager | ||
10 | { | ||
11 | IBinderFileManagerCore Core { set; } | ||
12 | |||
13 | ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<BindFileWithPath> files); | ||
14 | |||
15 | string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); | ||
16 | |||
17 | string ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); | ||
18 | |||
19 | string ResolveMedia(MediaRow mediaRow, string mediaLayoutDirectory, string layoutDirectory); | ||
20 | |||
21 | string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); | ||
22 | |||
23 | bool? CompareFiles(string targetFile, string updatedFile); | ||
24 | |||
25 | bool CopyFile(string source, string destination, bool overwrite); | ||
26 | |||
27 | bool MoveFile(string source, string destination, bool overwrite); | ||
28 | } | ||
29 | } | ||
diff --git a/src/WixToolset.Extensibility/IBinderFileManagerCore.cs b/src/WixToolset.Extensibility/IBinderFileManagerCore.cs index f5adf4e1..c6d46e11 100644 --- a/src/WixToolset.Extensibility/IBinderFileManagerCore.cs +++ b/src/WixToolset.Extensibility/IBinderFileManagerCore.cs | |||
@@ -4,6 +4,7 @@ namespace WixToolset.Extensibility | |||
4 | { | 4 | { |
5 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
6 | using WixToolset.Data; | 6 | using WixToolset.Data; |
7 | using WixToolset.Data.Bind; | ||
7 | 8 | ||
8 | public interface IBinderFileManagerCore : IMessageHandler | 9 | public interface IBinderFileManagerCore : IMessageHandler |
9 | { | 10 | { |
diff --git a/src/WixToolset.Extensibility/IBurnBackendExtension.cs b/src/WixToolset.Extensibility/IBurnBackendExtension.cs new file mode 100644 index 00000000..c8b8e407 --- /dev/null +++ b/src/WixToolset.Extensibility/IBurnBackendExtension.cs | |||
@@ -0,0 +1,25 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Data.Bind; | ||
7 | using WixToolset.Extensibility.Services; | ||
8 | |||
9 | public interface IBurnBackendExtension | ||
10 | { | ||
11 | /// <summary> | ||
12 | /// Called before binding occurs. | ||
13 | /// </summary> | ||
14 | void PreBackendBind(IBindContext context); | ||
15 | |||
16 | string ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); | ||
17 | |||
18 | string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); | ||
19 | |||
20 | /// <summary> | ||
21 | /// Called after all output changes occur and right before the output is bound into its final format. | ||
22 | /// </summary> | ||
23 | void PostBackendBind(BindResult result); | ||
24 | } | ||
25 | } | ||
diff --git a/src/WixToolset.Extensibility/IDelayedField.cs b/src/WixToolset.Extensibility/IDelayedField.cs new file mode 100644 index 00000000..a6cc7a2e --- /dev/null +++ b/src/WixToolset.Extensibility/IDelayedField.cs | |||
@@ -0,0 +1,13 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | |||
7 | public interface IDelayedField | ||
8 | { | ||
9 | Field Field { get; } | ||
10 | |||
11 | Row Row { get; } | ||
12 | } | ||
13 | } \ No newline at end of file | ||
diff --git a/src/WixToolset.Extensibility/IExpectedExtractFile.cs b/src/WixToolset.Extensibility/IExpectedExtractFile.cs new file mode 100644 index 00000000..06e4f77f --- /dev/null +++ b/src/WixToolset.Extensibility/IExpectedExtractFile.cs | |||
@@ -0,0 +1,15 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using System; | ||
6 | |||
7 | public interface IExpectedExtractFile | ||
8 | { | ||
9 | Uri Uri { get; set; } | ||
10 | |||
11 | int EmbeddedFileIndex { get; set; } | ||
12 | |||
13 | string OutputPath { get; set; } | ||
14 | } | ||
15 | } \ No newline at end of file | ||
diff --git a/src/WixToolset.Extensibility/IInscribeContext.cs b/src/WixToolset.Extensibility/IInscribeContext.cs new file mode 100644 index 00000000..6294271e --- /dev/null +++ b/src/WixToolset.Extensibility/IInscribeContext.cs | |||
@@ -0,0 +1,22 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using System; | ||
6 | using WixToolset.Data; | ||
7 | |||
8 | public interface IInscribeContext | ||
9 | { | ||
10 | IServiceProvider ServiceProvider { get; } | ||
11 | |||
12 | string InputFilePath { get; set; } | ||
13 | |||
14 | string IntermediateFolder { get; set; } | ||
15 | |||
16 | Messaging Messaging { get; } | ||
17 | |||
18 | string OutputFile { get; set; } | ||
19 | |||
20 | string SignedEngineFile { get; set; } | ||
21 | } | ||
22 | } | ||
diff --git a/src/WixToolset.Extensibility/ILibrarianExtension.cs b/src/WixToolset.Extensibility/ILibrarianExtension.cs new file mode 100644 index 00000000..08d37607 --- /dev/null +++ b/src/WixToolset.Extensibility/ILibrarianExtension.cs | |||
@@ -0,0 +1,15 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | |||
7 | public interface ILibrarianExtension | ||
8 | { | ||
9 | void PreCombine(ILibraryContext context); | ||
10 | |||
11 | string Resolve(SourceLineNumber sourceLineNumber, string table, string path); | ||
12 | |||
13 | void PostCombine(Library library); | ||
14 | } | ||
15 | } | ||
diff --git a/src/WixToolset.Extensibility/ILibraryContext.cs b/src/WixToolset.Extensibility/ILibraryContext.cs new file mode 100644 index 00000000..4e13696b --- /dev/null +++ b/src/WixToolset.Extensibility/ILibraryContext.cs | |||
@@ -0,0 +1,20 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using System.Collections.Generic; | ||
6 | using WixToolset.Data; | ||
7 | |||
8 | public interface ILibraryContext | ||
9 | { | ||
10 | bool BindFiles { get; set; } | ||
11 | |||
12 | IEnumerable<ILibrarianExtension> Extensions { get; set; } | ||
13 | |||
14 | IEnumerable<Localization> Localizations { get; set; } | ||
15 | |||
16 | IEnumerable<Section> Sections { get; set; } | ||
17 | |||
18 | IBindVariableResolver WixVariableResolver { get; set; } | ||
19 | } | ||
20 | } | ||
diff --git a/src/WixToolset.Extensibility/ILocalizer.cs b/src/WixToolset.Extensibility/ILocalizer.cs new file mode 100644 index 00000000..3ce29aab --- /dev/null +++ b/src/WixToolset.Extensibility/ILocalizer.cs | |||
@@ -0,0 +1,15 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | |||
7 | public interface ILocalizer | ||
8 | { | ||
9 | int Codepage { get; } | ||
10 | |||
11 | string GetLocalizedValue(string id); | ||
12 | |||
13 | LocalizedControl GetLocalizedControl(string dialog, string control); | ||
14 | } | ||
15 | } | ||
diff --git a/src/WixToolset.Extensibility/IUnbindContext.cs b/src/WixToolset.Extensibility/IUnbindContext.cs new file mode 100644 index 00000000..82364652 --- /dev/null +++ b/src/WixToolset.Extensibility/IUnbindContext.cs | |||
@@ -0,0 +1,23 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | |||
7 | public interface IUnbindContext | ||
8 | { | ||
9 | string ExportBasePath { get; set; } | ||
10 | |||
11 | string InputFilePath { get; set; } | ||
12 | |||
13 | string IntermediateFolder { get; set; } | ||
14 | |||
15 | bool IsAdminImage { get; set; } | ||
16 | |||
17 | Messaging Messaging { get; } | ||
18 | |||
19 | bool SuppressDemodularization { get; set; } | ||
20 | |||
21 | bool SuppressExtractCabinets { get; set; } | ||
22 | } | ||
23 | } \ No newline at end of file | ||
diff --git a/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs b/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs new file mode 100644 index 00000000..3b01cc0d --- /dev/null +++ b/src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs | |||
@@ -0,0 +1,29 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using System.Collections.Generic; | ||
6 | using WixToolset.Data.Rows; | ||
7 | using WixToolset.Data.Bind; | ||
8 | using WixToolset.Extensibility.Services; | ||
9 | |||
10 | /// <summary> | ||
11 | /// Interface all binder extensions implement. | ||
12 | /// </summary> | ||
13 | public interface IWindowsInstallerBackendExtension | ||
14 | { | ||
15 | /// <summary> | ||
16 | /// Called before binding occurs. | ||
17 | /// </summary> | ||
18 | void PreBackendBind(IBindContext context); | ||
19 | |||
20 | ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<BindFileWithPath> files); | ||
21 | |||
22 | string ResolveMedia(MediaRow mediaRow, string mediaLayoutDirectory, string layoutDirectory); | ||
23 | |||
24 | /// <summary> | ||
25 | /// Called after all output changes occur and right before the output is bound into its final format. | ||
26 | /// </summary> | ||
27 | void PostBackendBind(BindResult result); | ||
28 | } | ||
29 | } | ||
diff --git a/src/WixToolset.Extensibility/Identifier.cs b/src/WixToolset.Extensibility/Identifier.cs deleted file mode 100644 index 628cd335..00000000 --- a/src/WixToolset.Extensibility/Identifier.cs +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility | ||
4 | { | ||
5 | using System; | ||
6 | using WixToolset.Data; | ||
7 | |||
8 | /// <summary> | ||
9 | /// Class to define the identifier and access for a row. | ||
10 | /// </summary> | ||
11 | public class Identifier | ||
12 | { | ||
13 | public static Identifier Invalid = new Identifier(null, AccessModifier.Private); | ||
14 | |||
15 | public Identifier(string id, AccessModifier access) | ||
16 | { | ||
17 | this.Id = id; | ||
18 | this.Access = access; | ||
19 | } | ||
20 | |||
21 | /// <summary> | ||
22 | /// Access modifier for a row. | ||
23 | /// </summary> | ||
24 | public AccessModifier Access { get; private set; } | ||
25 | |||
26 | /// <summary> | ||
27 | /// Identifier for the row. | ||
28 | /// </summary> | ||
29 | public string Id { get; private set; } | ||
30 | } | ||
31 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/IBindContext.cs b/src/WixToolset.Extensibility/Services/IBindContext.cs new file mode 100644 index 00000000..ce78709b --- /dev/null +++ b/src/WixToolset.Extensibility/Services/IBindContext.cs | |||
@@ -0,0 +1,59 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility.Services | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections.Generic; | ||
7 | using WixToolset.Data; | ||
8 | |||
9 | public interface IBindContext | ||
10 | { | ||
11 | IServiceProvider ServiceProvider { get; } | ||
12 | |||
13 | Messaging Messaging { get; set; } | ||
14 | |||
15 | IEnumerable<BindPath> BindPaths { get; set; } | ||
16 | |||
17 | int CabbingThreadCount { get; set; } | ||
18 | |||
19 | string CabCachePath { get; set; } | ||
20 | |||
21 | int Codepage { get; set; } | ||
22 | |||
23 | CompressionLevel DefaultCompressionLevel { get; set; } | ||
24 | |||
25 | IEnumerable<IDelayedField> DelayedFields { get; set; } | ||
26 | |||
27 | IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } | ||
28 | |||
29 | IExtensionManager ExtensionManager { get; set; } | ||
30 | |||
31 | IEnumerable<IBinderExtension> Extensions { get; set; } | ||
32 | |||
33 | IEnumerable<string> Ices { get; set; } | ||
34 | |||
35 | string IntermediateFolder { get; set; } | ||
36 | |||
37 | Output IntermediateRepresentation { get; set; } | ||
38 | |||
39 | string OutputPath { get; set; } | ||
40 | |||
41 | string OutputPdbPath { get; set; } | ||
42 | |||
43 | bool SuppressAclReset { get; set; } | ||
44 | |||
45 | IEnumerable<string> SuppressIces { get; set; } | ||
46 | |||
47 | bool SuppressValidation { get; set; } | ||
48 | |||
49 | IBindVariableResolver WixVariableResolver { get; set; } | ||
50 | |||
51 | string ContentsFile { get; set; } | ||
52 | |||
53 | string OutputsFile { get; set; } | ||
54 | |||
55 | string BuiltOutputsFile { get; set; } | ||
56 | |||
57 | string WixprojectFile { get; set; } | ||
58 | } | ||
59 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/ICommandLine.cs b/src/WixToolset.Extensibility/Services/ICommandLine.cs new file mode 100644 index 00000000..9dd247ff --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ICommandLine.cs | |||
@@ -0,0 +1,9 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility.Services | ||
4 | { | ||
5 | public interface ICommandLine | ||
6 | { | ||
7 | ICommandLineCommand ParseStandardCommandLine(ICommandLineContext commandLineContext); | ||
8 | } | ||
9 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs b/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs new file mode 100644 index 00000000..f2333c55 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ICommandLineCommand.cs | |||
@@ -0,0 +1,9 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility.Services | ||
4 | { | ||
5 | public interface ICommandLineCommand | ||
6 | { | ||
7 | int Execute(); | ||
8 | } | ||
9 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/ICommandLineContext.cs b/src/WixToolset.Extensibility/Services/ICommandLineContext.cs new file mode 100644 index 00000000..0e040d7f --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ICommandLineContext.cs | |||
@@ -0,0 +1,20 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility.Services | ||
4 | { | ||
5 | using System; | ||
6 | using WixToolset.Data; | ||
7 | |||
8 | public interface ICommandLineContext | ||
9 | { | ||
10 | IServiceProvider ServiceProvider { get; } | ||
11 | |||
12 | Messaging Messaging { get; set; } | ||
13 | |||
14 | IExtensionManager ExtensionManager { get; set; } | ||
15 | |||
16 | string Arguments { get; set; } | ||
17 | |||
18 | string[] ParsedArguments { get; set; } | ||
19 | } | ||
20 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/IExtensionManager.cs b/src/WixToolset.Extensibility/Services/IExtensionManager.cs new file mode 100644 index 00000000..1d693ee4 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/IExtensionManager.cs | |||
@@ -0,0 +1,16 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility.Services | ||
4 | { | ||
5 | using System.Collections.Generic; | ||
6 | using System.Reflection; | ||
7 | |||
8 | public interface IExtensionManager | ||
9 | { | ||
10 | Assembly Add(Assembly assembly); | ||
11 | |||
12 | Assembly Load(string extension); | ||
13 | |||
14 | IEnumerable<T> Create<T>() where T : class; | ||
15 | } | ||
16 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs b/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs new file mode 100644 index 00000000..f4a5e8c3 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs | |||
@@ -0,0 +1,14 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensibility.Services | ||
4 | { | ||
5 | using System; | ||
6 | |||
7 | public static class ServiceProviderExtensions | ||
8 | { | ||
9 | public static T GetService<T>(this IServiceProvider serviceProvider) where T : class | ||
10 | { | ||
11 | return (T)serviceProvider.GetService(typeof(T)); | ||
12 | } | ||
13 | } | ||
14 | } | ||