From 860676fa5b40a1904478151e9b4934c004e7db63 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 7 Oct 2019 11:18:13 -0700 Subject: Implement Bundle build --- .../Bind/CalculateComponentGuids.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs') 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 using System.Collections.Generic; using System.IO; using System.Linq; - using WixToolset.Core.Native; using WixToolset.Data; using WixToolset.Data.Tuples; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; /// @@ -16,10 +16,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// internal class CalculateComponentGuids { - internal CalculateComponentGuids(IMessaging messaging, IBackendHelper helper, IntermediateSection section) + internal CalculateComponentGuids(IMessaging messaging, IBackendHelper helper, IPathResolver pathResolver, IntermediateSection section) { this.Messaging = messaging; this.BackendHelper = helper; + this.PathResolver = pathResolver; this.Section = section; } @@ -27,12 +28,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind private IBackendHelper BackendHelper { get; } + private IPathResolver PathResolver { get; } + private IntermediateSection Section { get; } public void Execute() { Dictionary registryKeyRows = null; - Dictionary targetPathsByDirectoryId = null; + Dictionary targetPathsByDirectoryId = null; Dictionary componentIdGenSeeds = null; Dictionary> filesByComponentId = null; @@ -73,7 +76,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var directories = this.Section.Tuples.OfType().ToList(); - targetPathsByDirectoryId = new Dictionary(directories.Count); + targetPathsByDirectoryId = new Dictionary(directories.Count); // Get the target paths for all directories. foreach (var directory in directories) @@ -86,7 +89,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind continue; } - targetPathsByDirectoryId.Add(directory.Id.Id, new ResolvedDirectory(directory.ParentDirectoryRef, directory.Name)); + var resolvedDirectory = this.BackendHelper.CreateResolvedDirectory(directory.ParentDirectoryRef, directory.Name); + targetPathsByDirectoryId.Add(directory.Id.Id, resolvedDirectory); } } @@ -131,7 +135,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (fileRow.Id.Id == componentTuple.KeyPath) { // calculate the key file's canonical target path - string directoryPath = PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentTuple.DirectoryRef, true); + string directoryPath = this.PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentTuple.DirectoryRef, true); string fileName = Common.GetName(fileRow.Name, false, true).ToLowerInvariant(); path = Path.Combine(directoryPath, fileName); -- cgit v1.2.3-55-g6feb