aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2019-10-07 11:18:13 -0700
committerRob Mensching <rob@firegiant.com>2019-10-07 11:59:14 -0700
commit860676fa5b40a1904478151e9b4934c004e7db63 (patch)
tree83fabd53f2a68dcf56bc8da66d88e115af3764b0 /src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs
parent3b98dac62b47d590f3465985362d6e6fd100b1c0 (diff)
downloadwix-860676fa5b40a1904478151e9b4934c004e7db63.tar.gz
wix-860676fa5b40a1904478151e9b4934c004e7db63.tar.bz2
wix-860676fa5b40a1904478151e9b4934c004e7db63.zip
Implement Bundle build
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs
index 835d9b8d..8135ae2e 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs
@@ -6,9 +6,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.IO; 7 using System.IO;
8 using System.Linq; 8 using System.Linq;
9 using WixToolset.Core.Native;
10 using WixToolset.Data; 9 using WixToolset.Data;
11 using WixToolset.Data.Tuples; 10 using WixToolset.Data.Tuples;
11 using WixToolset.Extensibility.Data;
12 using WixToolset.Extensibility.Services; 12 using WixToolset.Extensibility.Services;
13 13
14 /// <summary> 14 /// <summary>
@@ -16,10 +16,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind
16 /// </summary> 16 /// </summary>
17 internal class CalculateComponentGuids 17 internal class CalculateComponentGuids
18 { 18 {
19 internal CalculateComponentGuids(IMessaging messaging, IBackendHelper helper, IntermediateSection section) 19 internal CalculateComponentGuids(IMessaging messaging, IBackendHelper helper, IPathResolver pathResolver, IntermediateSection section)
20 { 20 {
21 this.Messaging = messaging; 21 this.Messaging = messaging;
22 this.BackendHelper = helper; 22 this.BackendHelper = helper;
23 this.PathResolver = pathResolver;
23 this.Section = section; 24 this.Section = section;
24 } 25 }
25 26
@@ -27,12 +28,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind
27 28
28 private IBackendHelper BackendHelper { get; } 29 private IBackendHelper BackendHelper { get; }
29 30
31 private IPathResolver PathResolver { get; }
32
30 private IntermediateSection Section { get; } 33 private IntermediateSection Section { get; }
31 34
32 public void Execute() 35 public void Execute()
33 { 36 {
34 Dictionary<string, RegistryTuple> registryKeyRows = null; 37 Dictionary<string, RegistryTuple> registryKeyRows = null;
35 Dictionary<string, ResolvedDirectory> targetPathsByDirectoryId = null; 38 Dictionary<string, IResolvedDirectory> targetPathsByDirectoryId = null;
36 Dictionary<string, string> componentIdGenSeeds = null; 39 Dictionary<string, string> componentIdGenSeeds = null;
37 Dictionary<string, List<FileTuple>> filesByComponentId = null; 40 Dictionary<string, List<FileTuple>> filesByComponentId = null;
38 41
@@ -73,7 +76,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
73 { 76 {
74 var directories = this.Section.Tuples.OfType<DirectoryTuple>().ToList(); 77 var directories = this.Section.Tuples.OfType<DirectoryTuple>().ToList();
75 78
76 targetPathsByDirectoryId = new Dictionary<string, ResolvedDirectory>(directories.Count); 79 targetPathsByDirectoryId = new Dictionary<string, IResolvedDirectory>(directories.Count);
77 80
78 // Get the target paths for all directories. 81 // Get the target paths for all directories.
79 foreach (var directory in directories) 82 foreach (var directory in directories)
@@ -86,7 +89,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
86 continue; 89 continue;
87 } 90 }
88 91
89 targetPathsByDirectoryId.Add(directory.Id.Id, new ResolvedDirectory(directory.ParentDirectoryRef, directory.Name)); 92 var resolvedDirectory = this.BackendHelper.CreateResolvedDirectory(directory.ParentDirectoryRef, directory.Name);
93 targetPathsByDirectoryId.Add(directory.Id.Id, resolvedDirectory);
90 } 94 }
91 } 95 }
92 96
@@ -131,7 +135,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
131 if (fileRow.Id.Id == componentTuple.KeyPath) 135 if (fileRow.Id.Id == componentTuple.KeyPath)
132 { 136 {
133 // calculate the key file's canonical target path 137 // calculate the key file's canonical target path
134 string directoryPath = PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentTuple.DirectoryRef, true); 138 string directoryPath = this.PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentTuple.DirectoryRef, true);
135 string fileName = Common.GetName(fileRow.Name, false, true).ToLowerInvariant(); 139 string fileName = Common.GetName(fileRow.Name, false, true).ToLowerInvariant();
136 path = Path.Combine(directoryPath, fileName); 140 path = Path.Combine(directoryPath, fileName);
137 141