diff options
| author | Rob Mensching <rob@firegiant.com> | 2019-05-22 00:58:13 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2019-05-23 16:02:37 -0700 |
| commit | d0462be8000f18aa7dc0791d02142f000bb19fbf (patch) | |
| tree | 072aabc2bd9b8f171e17654473f85c44a8a42a66 /src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs | |
| parent | 1ed894bc0f39397ec7f7f6344370fc2123420c43 (diff) | |
| download | wix-d0462be8000f18aa7dc0791d02142f000bb19fbf.tar.gz wix-d0462be8000f18aa7dc0791d02142f000bb19fbf.tar.bz2 wix-d0462be8000f18aa7dc0791d02142f000bb19fbf.zip | |
Integrate latest changes to tuple definitions
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs index 48b208f2..85567471 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs | |||
| @@ -57,7 +57,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 57 | // Now since Merge Modules are already slow and generally less desirable than .wixlibs we'll let | 57 | // Now since Merge Modules are already slow and generally less desirable than .wixlibs we'll let |
| 58 | // this case be slightly more expensive because the cost of maintaining an indexed file row collection | 58 | // this case be slightly more expensive because the cost of maintaining an indexed file row collection |
| 59 | // is a lot more costly for the common cases. | 59 | // is a lot more costly for the common cases. |
| 60 | var indexedFileFacades = this.FileFacades.ToDictionary(f => f.File.File, StringComparer.Ordinal); | 60 | var indexedFileFacades = this.FileFacades.ToDictionary(f => f.File.Id.Id, StringComparer.Ordinal); |
| 61 | 61 | ||
| 62 | foreach (var wixMergeRow in this.WixMergeTuples) | 62 | foreach (var wixMergeRow in this.WixMergeTuples) |
| 63 | { | 63 | { |
| @@ -101,42 +101,33 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 101 | // NOTE: this is very tricky - the merge module file rows are not added to the | 101 | // NOTE: this is very tricky - the merge module file rows are not added to the |
| 102 | // file table because they should not be created via idt import. Instead, these | 102 | // file table because they should not be created via idt import. Instead, these |
| 103 | // rows are created by merging in the actual modules. | 103 | // rows are created by merging in the actual modules. |
| 104 | var fileRow = new FileTuple(wixMergeRow.SourceLineNumbers, new Identifier(record[1], AccessModifier.Private)); | 104 | var fileRow = new FileTuple(wixMergeRow.SourceLineNumbers, new Identifier(AccessModifier.Private, record[1])); |
| 105 | fileRow.File = record[1]; | ||
| 106 | fileRow.Compressed = wixMergeRow.FileCompression; | 105 | fileRow.Compressed = wixMergeRow.FileCompression; |
| 107 | //FileRow fileRow = (FileRow)this.FileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); | ||
| 108 | //fileRow.File = record[1]; | ||
| 109 | //fileRow.Compressed = wixMergeRow.FileCompression; | ||
| 110 | 106 | ||
| 111 | var wixFileRow = new WixFileTuple(wixMergeRow.SourceLineNumbers); | 107 | var wixFileRow = new WixFileTuple(wixMergeRow.SourceLineNumbers); |
| 112 | wixFileRow.Directory_ = record[2]; | 108 | wixFileRow.Directory_ = record[2]; |
| 113 | wixFileRow.DiskId = wixMergeRow.DiskId; | 109 | wixFileRow.DiskId = wixMergeRow.DiskId; |
| 114 | wixFileRow.PatchGroup = -1; | 110 | wixFileRow.PatchGroup = -1; |
| 115 | wixFileRow.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) }; | 111 | wixFileRow.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) }; |
| 116 | //WixFileRow wixFileRow = (WixFileRow)this.WixFileTable.CreateRow(wixMergeRow.SourceLineNumbers, false); | ||
| 117 | //wixFileRow.Directory = record[2]; | ||
| 118 | //wixFileRow.DiskId = wixMergeRow.DiskId; | ||
| 119 | //wixFileRow.PatchGroup = -1; | ||
| 120 | //wixFileRow.Source = Path.Combine(this.IntermediateFolder, "MergeId.", wixMergeRow.Number.ToString(CultureInfo.InvariantCulture), record[1]); | ||
| 121 | 112 | ||
| 122 | var mergeModuleFileFacade = new FileFacade(true, fileRow, wixFileRow); | 113 | var mergeModuleFileFacade = new FileFacade(true, fileRow, wixFileRow); |
| 123 | 114 | ||
| 124 | // If case-sensitive collision with another merge module or a user-authored file identifier. | 115 | // If case-sensitive collision with another merge module or a user-authored file identifier. |
| 125 | if (indexedFileFacades.TryGetValue(mergeModuleFileFacade.File.File, out var collidingFacade)) | 116 | if (indexedFileFacades.TryGetValue(mergeModuleFileFacade.File.Id.Id, out var collidingFacade)) |
| 126 | { | 117 | { |
| 127 | this.Messaging.Write(ErrorMessages.DuplicateModuleFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, collidingFacade.File.File)); | 118 | this.Messaging.Write(ErrorMessages.DuplicateModuleFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, collidingFacade.File.Id.Id)); |
| 128 | } | 119 | } |
| 129 | else if (uniqueModuleFileIdentifiers.TryGetValue(mergeModuleFileFacade.File.File, out collidingFacade)) // case-insensitive collision with another file identifier in the same merge module | 120 | else if (uniqueModuleFileIdentifiers.TryGetValue(mergeModuleFileFacade.File.Id.Id, out collidingFacade)) // case-insensitive collision with another file identifier in the same merge module |
| 130 | { | 121 | { |
| 131 | this.Messaging.Write(ErrorMessages.DuplicateModuleCaseInsensitiveFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, mergeModuleFileFacade.File.File, collidingFacade.File.File)); | 122 | this.Messaging.Write(ErrorMessages.DuplicateModuleCaseInsensitiveFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, mergeModuleFileFacade.File.Id.Id, collidingFacade.File.Id.Id)); |
| 132 | } | 123 | } |
| 133 | else // no collision | 124 | else // no collision |
| 134 | { | 125 | { |
| 135 | mergeModulesFileFacades.Add(mergeModuleFileFacade); | 126 | mergeModulesFileFacades.Add(mergeModuleFileFacade); |
| 136 | 127 | ||
| 137 | // Keep updating the indexes as new rows are added. | 128 | // Keep updating the indexes as new rows are added. |
| 138 | indexedFileFacades.Add(mergeModuleFileFacade.File.File, mergeModuleFileFacade); | 129 | indexedFileFacades.Add(mergeModuleFileFacade.File.Id.Id, mergeModuleFileFacade); |
| 139 | uniqueModuleFileIdentifiers.Add(mergeModuleFileFacade.File.File, mergeModuleFileFacade); | 130 | uniqueModuleFileIdentifiers.Add(mergeModuleFileFacade.File.Id.Id, mergeModuleFileFacade); |
| 140 | } | 131 | } |
| 141 | 132 | ||
| 142 | containsFiles = true; | 133 | containsFiles = true; |
