diff options
4 files changed, 13 insertions, 5 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 3aad0709..9194c4c7 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
@@ -233,7 +233,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
233 | 233 | ||
234 | // Set generated component guids. | 234 | // Set generated component guids. |
235 | { | 235 | { |
236 | var command = new CalculateComponentGuids(this.Messaging, section); | 236 | var command = new CalculateComponentGuids(this.Messaging, this.BackendHelper, section); |
237 | command.Execute(); | 237 | command.Execute(); |
238 | } | 238 | } |
239 | 239 | ||
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs index 1a24b803..b8f1b2f3 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs | |||
@@ -16,14 +16,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
16 | /// </summary> | 16 | /// </summary> |
17 | internal class CalculateComponentGuids | 17 | internal class CalculateComponentGuids |
18 | { | 18 | { |
19 | public CalculateComponentGuids(IMessaging messaging, IntermediateSection section) | 19 | internal CalculateComponentGuids(IMessaging messaging, IBackendHelper helper, IntermediateSection section) |
20 | { | 20 | { |
21 | this.Messaging = messaging; | 21 | this.Messaging = messaging; |
22 | this.BackendHelper = helper; | ||
22 | this.Section = section; | 23 | this.Section = section; |
23 | } | 24 | } |
24 | 25 | ||
25 | private IMessaging Messaging { get; } | 26 | private IMessaging Messaging { get; } |
26 | 27 | ||
28 | private IBackendHelper BackendHelper { get; } | ||
29 | |||
27 | private IntermediateSection Section { get; } | 30 | private IntermediateSection Section { get; } |
28 | 31 | ||
29 | public void Execute() | 32 | public void Execute() |
@@ -64,7 +67,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
64 | var is64Bit = (componentRow.Attributes & MsiInterop.MsidbComponentAttributes64bit) != 0; | 67 | var is64Bit = (componentRow.Attributes & MsiInterop.MsidbComponentAttributes64bit) != 0; |
65 | var bitness = is64Bit ? "64" : String.Empty; | 68 | var bitness = is64Bit ? "64" : String.Empty; |
66 | var regkey = String.Concat(bitness, foundRow.AsString(1), "\\", foundRow.AsString(2), "\\", foundRow.AsString(3)); | 69 | var regkey = String.Concat(bitness, foundRow.AsString(1), "\\", foundRow.AsString(2), "\\", foundRow.AsString(3)); |
67 | componentRow.ComponentId = Uuid.NewUuid(BindDatabaseCommand.WixComponentGuidNamespace, regkey.ToLowerInvariant()).ToString("B").ToUpperInvariant(); | 70 | componentRow.ComponentId = this.BackendHelper.CreateGuid(BindDatabaseCommand.WixComponentGuidNamespace, regkey.ToLowerInvariant()); |
68 | } | 71 | } |
69 | } | 72 | } |
70 | else // must be a File KeyPath. | 73 | else // must be a File KeyPath. |
@@ -168,7 +171,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
168 | // if the rules were followed, reward with a generated guid | 171 | // if the rules were followed, reward with a generated guid |
169 | if (!this.Messaging.EncounteredError) | 172 | if (!this.Messaging.EncounteredError) |
170 | { | 173 | { |
171 | componentRow.ComponentId = Uuid.NewUuid(BindDatabaseCommand.WixComponentGuidNamespace, path).ToString("B").ToUpperInvariant(); | 174 | componentRow.ComponentId = this.BackendHelper.CreateGuid(BindDatabaseCommand.WixComponentGuidNamespace, path); |
172 | } | 175 | } |
173 | } | 176 | } |
174 | } | 177 | } |
diff --git a/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs b/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs index 0e5c4b5b..0cda4437 100644 --- a/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs | |||
@@ -36,6 +36,11 @@ namespace WixToolset.Core.ExtensibilityServices | |||
36 | }; | 36 | }; |
37 | } | 37 | } |
38 | 38 | ||
39 | public string CreateGuid(Guid namespaceGuid, string value) | ||
40 | { | ||
41 | return Uuid.NewUuid(namespaceGuid, value).ToString("B").ToUpperInvariant(); | ||
42 | } | ||
43 | |||
39 | private string GetValidatedFullPath(SourceLineNumber sourceLineNumbers, string path) | 44 | private string GetValidatedFullPath(SourceLineNumber sourceLineNumbers, string path) |
40 | { | 45 | { |
41 | try | 46 | try |
diff --git a/src/WixToolset.Core/Uuid.cs b/src/WixToolset.Core/Uuid.cs index 0501c285..c93d134d 100644 --- a/src/WixToolset.Core/Uuid.cs +++ b/src/WixToolset.Core/Uuid.cs | |||
@@ -10,7 +10,7 @@ namespace WixToolset | |||
10 | /// <summary> | 10 | /// <summary> |
11 | /// Implementation of RFC 4122 - A Universally Unique Identifier (UUID) URN Namespace. | 11 | /// Implementation of RFC 4122 - A Universally Unique Identifier (UUID) URN Namespace. |
12 | /// </summary> | 12 | /// </summary> |
13 | public static class Uuid | 13 | internal static class Uuid |
14 | { | 14 | { |
15 | /// <summary> | 15 | /// <summary> |
16 | /// Creates a version 3 name-based UUID. | 16 | /// Creates a version 3 name-based UUID. |