aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2018-08-01 03:11:58 -0700
committerRob Mensching <rob@firegiant.com>2018-08-01 03:11:58 -0700
commitb54516035b4ebbfbd8899b26de501bfa13f53e8b (patch)
tree6b48d5d6d01131a533a81066c00701898a6b28b2 /src/WixToolset.Core.WindowsInstaller
parent52005c7e6917f9866dd0b0de6993def16a72ed4b (diff)
downloadwix-b54516035b4ebbfbd8899b26de501bfa13f53e8b.tar.gz
wix-b54516035b4ebbfbd8899b26de501bfa13f53e8b.tar.bz2
wix-b54516035b4ebbfbd8899b26de501bfa13f53e8b.zip
Add CreateGuid() to IBackendHelper to make Uuid helper internal
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs2
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs9
2 files changed, 7 insertions, 4 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 }