diff options
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind')
8 files changed, 121 insertions, 81 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 30a19a4b..012998e6 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
@@ -123,7 +123,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
123 | { | 123 | { |
124 | propertyRow.Value = Common.GenerateGuid(); | 124 | propertyRow.Value = Common.GenerateGuid(); |
125 | 125 | ||
126 | #if TODO_FIX_INSTANCE_TRANSFORM | 126 | #if TODO_FIX_INSTANCE_TRANSFORM // Is this still necessary? |
127 | |||
127 | // Update the target ProductCode in any instance transforms. | 128 | // Update the target ProductCode in any instance transforms. |
128 | foreach (SubStorage subStorage in this.Output.SubStorages) | 129 | foreach (SubStorage subStorage in this.Output.SubStorages) |
129 | { | 130 | { |
@@ -391,7 +392,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
391 | command.ResolveMedia = this.ResolveMedia; | 392 | command.ResolveMedia = this.ResolveMedia; |
392 | command.TableDefinitions = this.TableDefinitions; | 393 | command.TableDefinitions = this.TableDefinitions; |
393 | command.TempFilesLocation = this.IntermediateFolder; | 394 | command.TempFilesLocation = this.IntermediateFolder; |
394 | command.WixMediaTable = output.Tables["WixMedia"]; | 395 | command.WixMediaTuples = section.Tuples.OfType<WixMediaTuple>(); |
395 | command.Execute(); | 396 | command.Execute(); |
396 | 397 | ||
397 | fileTransfers.AddRange(command.FileTransfers); | 398 | fileTransfers.AddRange(command.FileTransfers); |
@@ -526,7 +527,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
526 | } | 527 | } |
527 | 528 | ||
528 | this.FileTransfers = fileTransfers; | 529 | this.FileTransfers = fileTransfers; |
529 | this.ContentFilePaths = fileFacades.Select(r => r.WixFile.Source).ToList(); | 530 | this.ContentFilePaths = fileFacades.Select(r => r.WixFile.Source.Path).ToList(); |
530 | 531 | ||
531 | // TODO: Eventually this gets removed | 532 | // TODO: Eventually this gets removed |
532 | var intermediate = new Intermediate(this.Intermediate.Id, new[] { section }, this.Intermediate.Localizations.ToDictionary(l => l.Culture, StringComparer.OrdinalIgnoreCase), this.Intermediate.EmbedFilePaths); | 533 | var intermediate = new Intermediate(this.Intermediate.Id, new[] { section }, this.Intermediate.Localizations.ToDictionary(l => l.Culture, StringComparer.OrdinalIgnoreCase), this.Intermediate.EmbedFilePaths); |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs index c25a497e..2cbcc8e1 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs | |||
@@ -4,11 +4,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections; | 6 | using System.Collections; |
7 | using System.Collections.Generic; | ||
7 | using System.IO; | 8 | using System.IO; |
8 | using System.Linq; | 9 | using System.Linq; |
9 | using System.Threading; | 10 | using System.Threading; |
10 | using WixToolset.Core.Bind; | 11 | using WixToolset.Core.Bind; |
11 | using WixToolset.Core.Cab; | 12 | using WixToolset.Core.Native; |
12 | using WixToolset.Data; | 13 | using WixToolset.Data; |
13 | 14 | ||
14 | /// <summary> | 15 | /// <summary> |
@@ -137,7 +138,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
137 | int maxCabinetSize = 0; // The value of 0 corresponds to default of 2GB which means no cabinet splitting | 138 | int maxCabinetSize = 0; // The value of 0 corresponds to default of 2GB which means no cabinet splitting |
138 | ulong maxPreCompressedSizeInBytes = 0; | 139 | ulong maxPreCompressedSizeInBytes = 0; |
139 | 140 | ||
140 | if (MaximumCabinetSizeForLargeFileSplitting != 0) | 141 | if (this.MaximumCabinetSizeForLargeFileSplitting != 0) |
141 | { | 142 | { |
142 | // User Specified Max Cab Size for File Splitting, So Check if this cabinet has a single file larger than MaximumUncompressedFileSize | 143 | // User Specified Max Cab Size for File Splitting, So Check if this cabinet has a single file larger than MaximumUncompressedFileSize |
143 | // If a file is larger than MaximumUncompressedFileSize, then the cabinet containing it will have only this file | 144 | // If a file is larger than MaximumUncompressedFileSize, then the cabinet containing it will have only this file |
@@ -152,26 +153,33 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
152 | if ((ulong)facade.File.FileSize >= maxPreCompressedSizeInBytes) | 153 | if ((ulong)facade.File.FileSize >= maxPreCompressedSizeInBytes) |
153 | { | 154 | { |
154 | // If file is larger than MaximumUncompressedFileSize set Maximum Cabinet Size for Cabinet Splitting | 155 | // If file is larger than MaximumUncompressedFileSize set Maximum Cabinet Size for Cabinet Splitting |
155 | maxCabinetSize = MaximumCabinetSizeForLargeFileSplitting; | 156 | maxCabinetSize = this.MaximumCabinetSizeForLargeFileSplitting; |
156 | } | 157 | } |
157 | } | 158 | } |
158 | } | 159 | } |
159 | } | 160 | } |
160 | 161 | ||
161 | // create the cabinet file | 162 | // create the cabinet file |
163 | var cabinetPath = Path.GetFullPath(cabinetWorkItem.CabinetFile); | ||
162 | string cabinetFileName = Path.GetFileName(cabinetWorkItem.CabinetFile); | 164 | string cabinetFileName = Path.GetFileName(cabinetWorkItem.CabinetFile); |
163 | string cabinetDirectory = Path.GetDirectoryName(cabinetWorkItem.CabinetFile); | 165 | string cabinetDirectory = Path.GetDirectoryName(cabinetWorkItem.CabinetFile); |
164 | 166 | ||
165 | using (WixCreateCab cab = new WixCreateCab(cabinetFileName, cabinetDirectory, cabinetWorkItem.FileFacades.Count(), maxCabinetSize, cabinetWorkItem.MaxThreshold, cabinetWorkItem.CompressionLevel)) | 167 | //using (WixCreateCab cab = new WixCreateCab(cabinetFileName, cabinetDirectory, cabinetWorkItem.FileFacades.Count(), maxCabinetSize, cabinetWorkItem.MaxThreshold, cabinetWorkItem.CompressionLevel)) |
166 | { | 168 | //{ |
167 | foreach (FileFacade facade in cabinetWorkItem.FileFacades) | 169 | // foreach (FileFacade facade in cabinetWorkItem.FileFacades) |
168 | { | 170 | // { |
169 | cab.AddFile(facade); | 171 | // cab.AddFile(facade); |
170 | } | 172 | // } |
171 | 173 | ||
172 | cab.Complete(newCabNamesCallBackAddress); | 174 | // cab.Complete(newCabNamesCallBackAddress); |
173 | } | 175 | //} |
176 | |||
177 | var files = cabinetWorkItem.FileFacades.Select(facade => new CabinetCompressFile(facade.WixFile.Source.Path, facade.File.File, facade.Hash.HashPart1, facade.Hash.HashPart2, facade.Hash.HashPart3, facade.Hash.HashPart4)).ToList(); | ||
178 | |||
179 | var cabinetCompressionLevel = (CabinetCompressionLevel)cabinetWorkItem.CompressionLevel; | ||
180 | |||
181 | var cab = new Cabinet(cabinetPath); | ||
182 | cab.Compress(files, cabinetCompressionLevel, maxCabinetSize, cabinetWorkItem.MaxThreshold); | ||
174 | } | 183 | } |
175 | } | 184 | } |
176 | } | 185 | } |
177 | |||
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs index df1ccecf..370d4b9c 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs | |||
@@ -6,8 +6,8 @@ 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.Cab; | ||
10 | using WixToolset.Core.Bind; | 9 | using WixToolset.Core.Bind; |
10 | using WixToolset.Core.Native; | ||
11 | using WixToolset.Data; | 11 | using WixToolset.Data; |
12 | using WixToolset.Extensibility; | 12 | using WixToolset.Extensibility; |
13 | 13 | ||
@@ -26,7 +26,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
26 | 26 | ||
27 | public ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<FileFacade> fileFacades) | 27 | public ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<FileFacade> fileFacades) |
28 | { | 28 | { |
29 | var filesWithPath = fileFacades.Select(f => new BindFileWithPath() { Id = f.File.File, Path = f.WixFile.Source }).ToList(); | 29 | var filesWithPath = fileFacades.Select(f => new BindFileWithPath() { Id = f.File.File, Path = f.WixFile.Source.Path }).ToList(); |
30 | 30 | ||
31 | ResolvedCabinet resolved = null; | 31 | ResolvedCabinet resolved = null; |
32 | 32 | ||
@@ -58,45 +58,39 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
58 | // 3. modified time changed | 58 | // 3. modified time changed |
59 | bool cabinetValid = true; | 59 | bool cabinetValid = true; |
60 | 60 | ||
61 | // Need to force garbage collection of WixEnumerateCab to ensure the handle | 61 | var cabinet = new Cabinet(resolved.Path); |
62 | // associated with it is closed before it is reused. | 62 | List<CabinetFileInfo> fileList = cabinet.Enumerate(); |
63 | using (var wixEnumerateCab = new WixEnumerateCab()) | ||
64 | { | ||
65 | List<CabinetFileInfo> fileList = wixEnumerateCab.Enumerate(resolved.Path); | ||
66 | 63 | ||
67 | if (filesWithPath.Count() != fileList.Count) | 64 | if (filesWithPath.Count() != fileList.Count) |
68 | { | 65 | { |
69 | cabinetValid = false; | 66 | cabinetValid = false; |
70 | } | 67 | } |
71 | else | 68 | else |
69 | { | ||
70 | int i = 0; | ||
71 | foreach (BindFileWithPath file in filesWithPath) | ||
72 | { | 72 | { |
73 | int i = 0; | 73 | // First check that the file identifiers match because that is quick and easy. |
74 | foreach (BindFileWithPath file in filesWithPath) | 74 | CabinetFileInfo cabFileInfo = fileList[i]; |
75 | cabinetValid = (cabFileInfo.FileId == file.Id); | ||
76 | if (cabinetValid) | ||
75 | { | 77 | { |
76 | // First check that the file identifiers match because that is quick and easy. | 78 | // Still valid so ensure the file sizes are the same. |
77 | CabinetFileInfo cabFileInfo = fileList[i]; | 79 | FileInfo fileInfo = new FileInfo(file.Path); |
78 | cabinetValid = (cabFileInfo.FileId == file.Id); | 80 | cabinetValid = (cabFileInfo.Size == fileInfo.Length); |
79 | if (cabinetValid) | 81 | if (cabinetValid) |
80 | { | 82 | { |
81 | // Still valid so ensure the file sizes are the same. | 83 | // Still valid so ensure the source time stamp hasn't changed. |
82 | FileInfo fileInfo = new FileInfo(file.Path); | 84 | cabinetValid = cabFileInfo.SameAsDateTime(fileInfo.LastWriteTime); |
83 | cabinetValid = (cabFileInfo.Size == fileInfo.Length); | ||
84 | if (cabinetValid) | ||
85 | { | ||
86 | // Still valid so ensure the source time stamp hasn't changed. Thus we need | ||
87 | // to convert the source file time stamp into a cabinet compatible data/time. | ||
88 | Native.CabInterop.DateTimeToCabDateAndTime(fileInfo.LastWriteTime, out var sourceCabDate, out var sourceCabTime); | ||
89 | cabinetValid = (cabFileInfo.Date == sourceCabDate && cabFileInfo.Time == sourceCabTime); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | if (!cabinetValid) | ||
94 | { | ||
95 | break; | ||
96 | } | 85 | } |
86 | } | ||
97 | 87 | ||
98 | i++; | 88 | if (!cabinetValid) |
89 | { | ||
90 | break; | ||
99 | } | 91 | } |
92 | |||
93 | i++; | ||
100 | } | 94 | } |
101 | } | 95 | } |
102 | 96 | ||
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs index b5a436c5..a449397d 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs | |||
@@ -66,7 +66,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
66 | 66 | ||
67 | public TableDefinitionCollection TableDefinitions { private get; set; } | 67 | public TableDefinitionCollection TableDefinitions { private get; set; } |
68 | 68 | ||
69 | public Table WixMediaTable { private get; set; } | 69 | public IEnumerable<WixMediaTuple> WixMediaTuples { private get; set; } |
70 | 70 | ||
71 | public IEnumerable<FileTransfer> FileTransfers => this.fileTransfers; | 71 | public IEnumerable<FileTransfer> FileTransfers => this.fileTransfers; |
72 | 72 | ||
@@ -77,7 +77,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
77 | /// <returns>The uncompressed file rows.</returns> | 77 | /// <returns>The uncompressed file rows.</returns> |
78 | public void Execute() | 78 | public void Execute() |
79 | { | 79 | { |
80 | var wixMediaRows = new RowDictionary<WixMediaRow>(this.WixMediaTable); | 80 | var wixMediaTuples = this.WixMediaTuples.ToDictionary(t => t.DiskId_); |
81 | 81 | ||
82 | this.lastCabinetAddedToMediaTable = new Dictionary<string, string>(); | 82 | this.lastCabinetAddedToMediaTable = new Dictionary<string, string>(); |
83 | 83 | ||
@@ -93,13 +93,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
93 | 93 | ||
94 | foreach (var entry in this.FileRowsByCabinet) | 94 | foreach (var entry in this.FileRowsByCabinet) |
95 | { | 95 | { |
96 | var mediaRow = entry.Key; | 96 | var mediaTuple = entry.Key; |
97 | IEnumerable<FileFacade> files = entry.Value; | 97 | IEnumerable<FileFacade> files = entry.Value; |
98 | CompressionLevel compressionLevel = this.DefaultCompressionLevel; | 98 | CompressionLevel compressionLevel = this.DefaultCompressionLevel; |
99 | 99 | ||
100 | string mediaLayoutFolder = null; | 100 | string mediaLayoutFolder = null; |
101 | 101 | ||
102 | if (wixMediaRows.TryGetValue(mediaRow.Id.Id, out var wixMediaRow)) | 102 | if (wixMediaTuples.TryGetValue(mediaTuple.DiskId, out var wixMediaRow)) |
103 | { | 103 | { |
104 | mediaLayoutFolder = wixMediaRow.Layout; | 104 | mediaLayoutFolder = wixMediaRow.Layout; |
105 | 105 | ||
@@ -109,9 +109,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
112 | string cabinetDir = this.ResolveMedia(mediaRow, mediaLayoutFolder, this.LayoutDirectory); | 112 | string cabinetDir = this.ResolveMedia(mediaTuple, mediaLayoutFolder, this.LayoutDirectory); |
113 | 113 | ||
114 | CabinetWorkItem cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaRow, compressionLevel, files, this.fileTransfers); | 114 | CabinetWorkItem cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaTuple, compressionLevel, files, this.fileTransfers); |
115 | if (null != cabinetWorkItem) | 115 | if (null != cabinetWorkItem) |
116 | { | 116 | { |
117 | cabinetBuilder.Enqueue(cabinetWorkItem); | 117 | cabinetBuilder.Enqueue(cabinetWorkItem); |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 85b3b25a..a19a53f1 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs | |||
@@ -44,9 +44,21 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
44 | this.AddFileTuple((FileTuple)tuple, output); | 44 | this.AddFileTuple((FileTuple)tuple, output); |
45 | break; | 45 | break; |
46 | 46 | ||
47 | case TupleDefinitionType.Media: | ||
48 | this.AddMediaTuple((MediaTuple)tuple, output); | ||
49 | break; | ||
50 | |||
51 | case TupleDefinitionType.Property: | ||
52 | this.AddPropertyTuple((PropertyTuple)tuple, output); | ||
53 | break; | ||
54 | |||
47 | case TupleDefinitionType.WixAction: | 55 | case TupleDefinitionType.WixAction: |
48 | this.AddWixActionTuple((WixActionTuple)tuple, output); | 56 | this.AddWixActionTuple((WixActionTuple)tuple, output); |
49 | break; | 57 | break; |
58 | |||
59 | case TupleDefinitionType.WixMedia: | ||
60 | // Ignored. | ||
61 | break; | ||
50 | 62 | ||
51 | default: | 63 | default: |
52 | this.AddTupleDefaultly(tuple, output); | 64 | this.AddTupleDefaultly(tuple, output); |
@@ -76,6 +88,34 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
76 | row.Attributes = attributes; | 88 | row.Attributes = attributes; |
77 | } | 89 | } |
78 | 90 | ||
91 | private void AddMediaTuple(MediaTuple tuple, Output output) | ||
92 | { | ||
93 | if (this.Section.Type != SectionType.Module) | ||
94 | { | ||
95 | var table = output.EnsureTable(this.TableDefinitions["Media"]); | ||
96 | var row = (MediaRow)table.CreateRow(tuple.SourceLineNumbers); | ||
97 | row.DiskId = tuple.DiskId; | ||
98 | row.LastSequence = tuple.LastSequence; | ||
99 | row.DiskPrompt = tuple.DiskPrompt; | ||
100 | row.Cabinet = tuple.Cabinet; | ||
101 | row.VolumeLabel = tuple.VolumeLabel; | ||
102 | row.Source = tuple.Source; | ||
103 | } | ||
104 | } | ||
105 | |||
106 | private void AddPropertyTuple(PropertyTuple tuple, Output output) | ||
107 | { | ||
108 | if (String.IsNullOrEmpty(tuple.Value)) | ||
109 | { | ||
110 | return; | ||
111 | } | ||
112 | |||
113 | var table = output.EnsureTable(this.TableDefinitions["Property"]); | ||
114 | var row = (PropertyRow)table.CreateRow(tuple.SourceLineNumbers); | ||
115 | row.Property = tuple.Property; | ||
116 | row.Value = tuple.Value; | ||
117 | } | ||
118 | |||
79 | private void AddWixActionTuple(WixActionTuple actionRow, Output output) | 119 | private void AddWixActionTuple(WixActionTuple actionRow, Output output) |
80 | { | 120 | { |
81 | // Get the table definition for the action (and ensure the proper table exists for a module). | 121 | // Get the table definition for the action (and ensure the proper table exists for a module). |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs index 32d1cfda..a31c8079 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs | |||
@@ -14,7 +14,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
14 | using WixToolset.Msi; | 14 | using WixToolset.Msi; |
15 | using WixToolset.Core.Native; | 15 | using WixToolset.Core.Native; |
16 | using WixToolset.Core.Bind; | 16 | using WixToolset.Core.Bind; |
17 | using WixToolset.Core.Cab; | ||
18 | using WixToolset.Data.Tuples; | 17 | using WixToolset.Data.Tuples; |
19 | 18 | ||
20 | /// <summary> | 19 | /// <summary> |
@@ -110,7 +109,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
110 | wixFileRow.Directory_ = record[2]; | 109 | wixFileRow.Directory_ = record[2]; |
111 | wixFileRow.DiskId = wixMergeRow.DiskId; | 110 | wixFileRow.DiskId = wixMergeRow.DiskId; |
112 | wixFileRow.PatchGroup = -1; | 111 | wixFileRow.PatchGroup = -1; |
113 | wixFileRow.Source = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]); | 112 | wixFileRow.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) }; |
114 | //WixFileRow wixFileRow = (WixFileRow)this.WixFileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); | 113 | //WixFileRow wixFileRow = (WixFileRow)this.WixFileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); |
115 | //wixFileRow.Directory = record[2]; | 114 | //wixFileRow.Directory = record[2]; |
116 | //wixFileRow.DiskId = wixMergeRow.DiskId; | 115 | //wixFileRow.DiskId = wixMergeRow.DiskId; |
@@ -204,20 +203,18 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
204 | string mergeIdPath = Path.Combine(this.IntermediateFolder, mergeId); | 203 | string mergeIdPath = Path.Combine(this.IntermediateFolder, mergeId); |
205 | Directory.CreateDirectory(mergeIdPath); | 204 | Directory.CreateDirectory(mergeIdPath); |
206 | 205 | ||
207 | using (var extractCab = new WixExtractCab()) | 206 | try |
208 | { | 207 | { |
209 | try | 208 | var cabinet = new Cabinet(moduleCabPath); |
210 | { | 209 | cabinet.Extract(mergeIdPath); |
211 | extractCab.Extract(moduleCabPath, mergeIdPath); | 210 | } |
212 | } | 211 | catch (FileNotFoundException) |
213 | catch (FileNotFoundException) | 212 | { |
214 | { | 213 | throw new WixException(WixErrors.CabFileDoesNotExist(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); |
215 | throw new WixException(WixErrors.CabFileDoesNotExist(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); | 214 | } |
216 | } | 215 | catch |
217 | catch | 216 | { |
218 | { | 217 | throw new WixException(WixErrors.CabExtractionFailed(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); |
219 | throw new WixException(WixErrors.CabExtractionFailed(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); | ||
220 | } | ||
221 | } | 218 | } |
222 | } | 219 | } |
223 | catch (COMException ce) | 220 | catch (COMException ce) |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs index d71724d1..aa4382f5 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs | |||
@@ -105,7 +105,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
105 | 105 | ||
106 | // finally put together the base media layout path and the relative file layout path | 106 | // finally put together the base media layout path and the relative file layout path |
107 | string fileLayoutPath = Path.Combine(mediaLayoutDirectory, relativeFileLayoutPath); | 107 | string fileLayoutPath = Path.Combine(mediaLayoutDirectory, relativeFileLayoutPath); |
108 | if (FileTransfer.TryCreate(facade.WixFile.Source, fileLayoutPath, false, "File", facade.File.SourceLineNumbers, out var transfer)) | 108 | if (FileTransfer.TryCreate(facade.WixFile.Source.Path, fileLayoutPath, false, "File", facade.File.SourceLineNumbers, out var transfer)) |
109 | { | 109 | { |
110 | fileTransfers.Add(transfer); | 110 | fileTransfers.Add(transfer); |
111 | } | 111 | } |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs index 030bc4cc..a9eb2a8f 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs | |||
@@ -57,27 +57,27 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
57 | FileInfo fileInfo = null; | 57 | FileInfo fileInfo = null; |
58 | try | 58 | try |
59 | { | 59 | { |
60 | fileInfo = new FileInfo(file.WixFile.Source); | 60 | fileInfo = new FileInfo(file.WixFile.Source.Path); |
61 | } | 61 | } |
62 | catch (ArgumentException) | 62 | catch (ArgumentException) |
63 | { | 63 | { |
64 | Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source)); | 64 | Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); |
65 | return; | 65 | return; |
66 | } | 66 | } |
67 | catch (PathTooLongException) | 67 | catch (PathTooLongException) |
68 | { | 68 | { |
69 | Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source)); | 69 | Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); |
70 | return; | 70 | return; |
71 | } | 71 | } |
72 | catch (NotSupportedException) | 72 | catch (NotSupportedException) |
73 | { | 73 | { |
74 | Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source)); | 74 | Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); |
75 | return; | 75 | return; |
76 | } | 76 | } |
77 | 77 | ||
78 | if (!fileInfo.Exists) | 78 | if (!fileInfo.Exists) |
79 | { | 79 | { |
80 | Messaging.Instance.OnMessage(WixErrors.CannotFindFile(file.File.SourceLineNumbers, file.File.File, file.File.LongFileName, file.WixFile.Source)); | 80 | Messaging.Instance.OnMessage(WixErrors.CannotFindFile(file.File.SourceLineNumbers, file.File.File, file.File.LongFileName, file.WixFile.Source.Path)); |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | 83 | ||
@@ -85,7 +85,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
85 | { | 85 | { |
86 | if (Int32.MaxValue < fileStream.Length) | 86 | if (Int32.MaxValue < fileStream.Length) |
87 | { | 87 | { |
88 | throw new WixException(WixErrors.FileTooLarge(file.File.SourceLineNumbers, file.WixFile.Source)); | 88 | throw new WixException(WixErrors.FileTooLarge(file.File.SourceLineNumbers, file.WixFile.Source.Path)); |
89 | } | 89 | } |
90 | 90 | ||
91 | file.File.FileSize = Convert.ToInt32(fileStream.Length, CultureInfo.InvariantCulture); | 91 | file.File.FileSize = Convert.ToInt32(fileStream.Length, CultureInfo.InvariantCulture); |
@@ -372,7 +372,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
372 | // Navigator is cheaper than dom. Perhaps there is a cheaper API still. | 372 | // Navigator is cheaper than dom. Perhaps there is a cheaper API still. |
373 | try | 373 | try |
374 | { | 374 | { |
375 | XPathDocument doc = new XPathDocument(fileManifest.WixFile.Source); | 375 | XPathDocument doc = new XPathDocument(fileManifest.WixFile.Source.Path); |
376 | XPathNavigator nav = doc.CreateNavigator(); | 376 | XPathNavigator nav = doc.CreateNavigator(); |
377 | nav.MoveToRoot(); | 377 | nav.MoveToRoot(); |
378 | 378 | ||
@@ -396,7 +396,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
396 | } | 396 | } |
397 | if (!hasNextSibling) | 397 | if (!hasNextSibling) |
398 | { | 398 | { |
399 | Messaging.Instance.OnMessage(WixErrors.InvalidManifestContent(file.File.SourceLineNumbers, fileManifest.WixFile.Source)); | 399 | Messaging.Instance.OnMessage(WixErrors.InvalidManifestContent(file.File.SourceLineNumbers, fileManifest.WixFile.Source.Path)); |
400 | return; | 400 | return; |
401 | } | 401 | } |
402 | 402 | ||
@@ -434,11 +434,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
434 | } | 434 | } |
435 | catch (FileNotFoundException fe) | 435 | catch (FileNotFoundException fe) |
436 | { | 436 | { |
437 | Messaging.Instance.OnMessage(WixErrors.FileNotFound(new SourceLineNumber(fileManifest.WixFile.Source), fe.FileName, "AssemblyManifest")); | 437 | Messaging.Instance.OnMessage(WixErrors.FileNotFound(new SourceLineNumber(fileManifest.WixFile.Source.Path), fe.FileName, "AssemblyManifest")); |
438 | } | 438 | } |
439 | catch (XmlException xe) | 439 | catch (XmlException xe) |
440 | { | 440 | { |
441 | Messaging.Instance.OnMessage(WixErrors.InvalidXml(new SourceLineNumber(fileManifest.WixFile.Source), "manifest", xe.Message)); | 441 | Messaging.Instance.OnMessage(WixErrors.InvalidXml(new SourceLineNumber(fileManifest.WixFile.Source.Path), "manifest", xe.Message)); |
442 | } | 442 | } |
443 | 443 | ||
444 | if (!String.IsNullOrEmpty(win32Name)) | 444 | if (!String.IsNullOrEmpty(win32Name)) |