diff options
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs index ae76037d..0d3e7bd1 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs | |||
@@ -16,6 +16,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
16 | using WixToolset.Core.Native; | 16 | using WixToolset.Core.Native; |
17 | using WixToolset.Core.Bind; | 17 | using WixToolset.Core.Bind; |
18 | using WixToolset.Core.Cab; | 18 | using WixToolset.Core.Cab; |
19 | using WixToolset.Data.Tuples; | ||
19 | 20 | ||
20 | /// <summary> | 21 | /// <summary> |
21 | /// Retrieve files information and extract them from merge modules. | 22 | /// Retrieve files information and extract them from merge modules. |
@@ -34,7 +35,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
34 | 35 | ||
35 | public bool SuppressLayout { private get; set; } | 36 | public bool SuppressLayout { private get; set; } |
36 | 37 | ||
37 | public string TempFilesLocation { private get; set; } | 38 | public string IntermediateFolder { private get; set; } |
38 | 39 | ||
39 | public IEnumerable<FileFacade> MergeModulesFileFacades { get; private set; } | 40 | public IEnumerable<FileFacade> MergeModulesFileFacades { get; private set; } |
40 | 41 | ||
@@ -95,22 +96,28 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
95 | // NOTE: this is very tricky - the merge module file rows are not added to the | 96 | // NOTE: this is very tricky - the merge module file rows are not added to the |
96 | // file table because they should not be created via idt import. Instead, these | 97 | // file table because they should not be created via idt import. Instead, these |
97 | // rows are created by merging in the actual modules. | 98 | // rows are created by merging in the actual modules. |
98 | FileRow fileRow = (FileRow)this.FileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); | 99 | var fileRow = new FileTuple(wixMergeRow.SourceLineNumbers, new Identifier(record[1], AccessModifier.Private)); |
99 | fileRow.File = record[1]; | 100 | fileRow.File = record[1]; |
100 | fileRow.Compressed = wixMergeRow.FileCompression; | 101 | fileRow.Compressed = (wixMergeRow.FileCompression == YesNoType.Yes) ? true : (wixMergeRow.FileCompression == YesNoType.No) ? (bool?)false : null; |
102 | //FileRow fileRow = (FileRow)this.FileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); | ||
103 | //fileRow.File = record[1]; | ||
104 | //fileRow.Compressed = wixMergeRow.FileCompression; | ||
101 | 105 | ||
102 | WixFileRow wixFileRow = (WixFileRow)this.WixFileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); | 106 | var wixFileRow = new WixFileTuple(wixMergeRow.SourceLineNumbers); |
103 | wixFileRow.Directory = record[2]; | 107 | wixFileRow.Directory_ = record[2]; |
104 | wixFileRow.DiskId = wixMergeRow.DiskId; | 108 | wixFileRow.DiskId = wixMergeRow.DiskId; |
105 | wixFileRow.PatchGroup = -1; | 109 | wixFileRow.PatchGroup = -1; |
106 | wixFileRow.Source = String.Concat(this.TempFilesLocation, Path.DirectorySeparatorChar, "MergeId.", wixMergeRow.Number.ToString(CultureInfo.InvariantCulture), Path.DirectorySeparatorChar, record[1]); | 110 | wixFileRow.Source = Path.Combine(this.IntermediateFolder, "MergeId.", wixMergeRow.Number.ToString(CultureInfo.InvariantCulture), record[1]); |
111 | //WixFileRow wixFileRow = (WixFileRow)this.WixFileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); | ||
112 | //wixFileRow.Directory = record[2]; | ||
113 | //wixFileRow.DiskId = wixMergeRow.DiskId; | ||
114 | //wixFileRow.PatchGroup = -1; | ||
115 | //wixFileRow.Source = Path.Combine(this.IntermediateFolder, "MergeId.", wixMergeRow.Number.ToString(CultureInfo.InvariantCulture), record[1]); | ||
107 | 116 | ||
108 | FileFacade mergeModuleFileFacade = new FileFacade(true, fileRow, wixFileRow); | 117 | var mergeModuleFileFacade = new FileFacade(true, fileRow, wixFileRow); |
109 | |||
110 | FileFacade collidingFacade; | ||
111 | 118 | ||
112 | // If case-sensitive collision with another merge module or a user-authored file identifier. | 119 | // If case-sensitive collision with another merge module or a user-authored file identifier. |
113 | if (indexedFileFacades.TryGetValue(mergeModuleFileFacade.File.File, out collidingFacade)) | 120 | if (indexedFileFacades.TryGetValue(mergeModuleFileFacade.File.File, out var collidingFacade)) |
114 | { | 121 | { |
115 | Messaging.Instance.OnMessage(WixErrors.DuplicateModuleFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id, collidingFacade.File.File)); | 122 | Messaging.Instance.OnMessage(WixErrors.DuplicateModuleFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id, collidingFacade.File.File)); |
116 | } | 123 | } |
@@ -188,10 +195,10 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
188 | string safeMergeId = wixMergeRow.Number.ToString(CultureInfo.InvariantCulture.NumberFormat); | 195 | string safeMergeId = wixMergeRow.Number.ToString(CultureInfo.InvariantCulture.NumberFormat); |
189 | 196 | ||
190 | // extract the module cabinet, then explode all of the files to a temp directory | 197 | // extract the module cabinet, then explode all of the files to a temp directory |
191 | string moduleCabPath = String.Concat(this.TempFilesLocation, Path.DirectorySeparatorChar, safeMergeId, ".module.cab"); | 198 | string moduleCabPath = String.Concat(this.IntermediateFolder, Path.DirectorySeparatorChar, safeMergeId, ".module.cab"); |
192 | merge.ExtractCAB(moduleCabPath); | 199 | merge.ExtractCAB(moduleCabPath); |
193 | 200 | ||
194 | string mergeIdPath = String.Concat(this.TempFilesLocation, Path.DirectorySeparatorChar, "MergeId.", safeMergeId); | 201 | string mergeIdPath = String.Concat(this.IntermediateFolder, Path.DirectorySeparatorChar, "MergeId.", safeMergeId); |
195 | Directory.CreateDirectory(mergeIdPath); | 202 | Directory.CreateDirectory(mergeIdPath); |
196 | 203 | ||
197 | using (var extractCab = new WixExtractCab()) | 204 | using (var extractCab = new WixExtractCab()) |