diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
| commit | 2bb37beda887d120a0ddabf874ad25357101faa1 (patch) | |
| tree | c35e97b03274b86cfc9ff7fd2caeee211165a140 /src/WixToolset.Core.WindowsInstaller/Bind | |
| parent | df7413aeed3aea3425dff20ae0c8b1be3a3ab525 (diff) | |
| download | wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.gz wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.bz2 wix-2bb37beda887d120a0ddabf874ad25357101faa1.zip | |
Update to WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind')
8 files changed, 75 insertions, 52 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs index 23c481b7..74e2cdb5 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs | |||
| @@ -66,7 +66,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 66 | // When building merge module, all the files go to "#MergeModule.CABinet". | 66 | // When building merge module, all the files go to "#MergeModule.CABinet". |
| 67 | if (OutputType.Module == this.Output.Type) | 67 | if (OutputType.Module == this.Output.Type) |
| 68 | { | 68 | { |
| 69 | Table mergeModuleMediaTable = new Table(null, this.TableDefinitions["Media"]); | 69 | Table mergeModuleMediaTable = new Table(this.TableDefinitions["Media"]); |
| 70 | mergeModuleMediaRow = (MediaRow)mergeModuleMediaTable.CreateRow(null); | 70 | mergeModuleMediaRow = (MediaRow)mergeModuleMediaTable.CreateRow(null); |
| 71 | mergeModuleMediaRow.Cabinet = "#MergeModule.CABinet"; | 71 | mergeModuleMediaRow.Cabinet = "#MergeModule.CABinet"; |
| 72 | 72 | ||
| @@ -150,8 +150,8 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 150 | // When building a product, if the current file is not to be compressed or if | 150 | // When building a product, if the current file is not to be compressed or if |
| 151 | // the package set not to be compressed, don't cab it. | 151 | // the package set not to be compressed, don't cab it. |
| 152 | if (OutputType.Product == this.Output.Type && | 152 | if (OutputType.Product == this.Output.Type && |
| 153 | (YesNoType.No == facade.File.Compressed || | 153 | (!facade.File.Compressed.Value || |
| 154 | (YesNoType.NotSet == facade.File.Compressed && !this.FilesCompressed))) | 154 | (!facade.File.Compressed.HasValue && !this.FilesCompressed))) |
| 155 | { | 155 | { |
| 156 | uncompressedFiles.Add(facade); | 156 | uncompressedFiles.Add(facade); |
| 157 | continue; | 157 | continue; |
| @@ -270,8 +270,8 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 270 | // When building a product, if the current file is not to be compressed or if | 270 | // When building a product, if the current file is not to be compressed or if |
| 271 | // the package set not to be compressed, don't cab it. | 271 | // the package set not to be compressed, don't cab it. |
| 272 | if (OutputType.Product == this.Output.Type && | 272 | if (OutputType.Product == this.Output.Type && |
| 273 | (YesNoType.No == facade.File.Compressed || | 273 | (!facade.File.Compressed.Value || |
| 274 | (YesNoType.NotSet == facade.File.Compressed && !this.FilesCompressed))) | 274 | (!facade.File.Compressed.HasValue && !this.FilesCompressed))) |
| 275 | { | 275 | { |
| 276 | uncompressedFiles.Add(facade); | 276 | uncompressedFiles.Add(facade); |
| 277 | } | 277 | } |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 21fbb022..5a61b63c 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
| @@ -39,7 +39,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 39 | this.DelayedFields = context.DelayedFields; | 39 | this.DelayedFields = context.DelayedFields; |
| 40 | this.ExpectedEmbeddedFiles = context.ExpectedEmbeddedFiles; | 40 | this.ExpectedEmbeddedFiles = context.ExpectedEmbeddedFiles; |
| 41 | this.Extensions = context.Extensions; | 41 | this.Extensions = context.Extensions; |
| 42 | this.Output = context.IntermediateRepresentation; | 42 | this.Intermediate = context.IntermediateRepresentation; |
| 43 | this.OutputPath = context.OutputPath; | 43 | this.OutputPath = context.OutputPath; |
| 44 | this.PdbFile = context.OutputPdbPath; | 44 | this.PdbFile = context.OutputPdbPath; |
| 45 | this.IntermediateFolder = context.IntermediateFolder; | 45 | this.IntermediateFolder = context.IntermediateFolder; |
| @@ -69,10 +69,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 69 | 69 | ||
| 70 | private IEnumerable<IBinderExtension> Extensions { get; } | 70 | private IEnumerable<IBinderExtension> Extensions { get; } |
| 71 | 71 | ||
| 72 | private IEnumerable<InspectorExtension> InspectorExtensions { get; } | ||
| 73 | |||
| 74 | private string PdbFile { get; } | 72 | private string PdbFile { get; } |
| 75 | 73 | ||
| 74 | private Intermediate Intermediate { get; } | ||
| 75 | |||
| 76 | private Output Output { get; } | 76 | private Output Output { get; } |
| 77 | 77 | ||
| 78 | private string OutputPath { get; } | 78 | private string OutputPath { get; } |
| @@ -95,6 +95,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 95 | 95 | ||
| 96 | public void Execute() | 96 | public void Execute() |
| 97 | { | 97 | { |
| 98 | this.Intermediate.Save(this.OutputPath); | ||
| 99 | #if FINISH | ||
| 98 | List<FileTransfer> fileTransfers = new List<FileTransfer>(); | 100 | List<FileTransfer> fileTransfers = new List<FileTransfer>(); |
| 99 | 101 | ||
| 100 | HashSet<string> suppressedTableNames = new HashSet<string>(); | 102 | HashSet<string> suppressedTableNames = new HashSet<string>(); |
| @@ -108,6 +110,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 108 | 110 | ||
| 109 | this.LocalizeUI(this.Output.Tables); | 111 | this.LocalizeUI(this.Output.Tables); |
| 110 | 112 | ||
| 113 | this.Output = CreateOutputFromIR(this.Intermediate); | ||
| 114 | |||
| 111 | // Process the summary information table before the other tables. | 115 | // Process the summary information table before the other tables. |
| 112 | bool compressed; | 116 | bool compressed; |
| 113 | bool longNames; | 117 | bool longNames; |
| @@ -1278,6 +1282,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 1278 | command.TempFilesLocation = this.IntermediateFolder; | 1282 | command.TempFilesLocation = this.IntermediateFolder; |
| 1279 | command.Codepage = this.Codepage; | 1283 | command.Codepage = this.Codepage; |
| 1280 | command.Execute(); | 1284 | command.Execute(); |
| 1285 | #endif | ||
| 1281 | } | 1286 | } |
| 1282 | } | 1287 | } |
| 1283 | } | 1288 | } |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs index 767671b8..42a69310 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs | |||
| @@ -23,6 +23,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 23 | 23 | ||
| 24 | public void Execute() | 24 | public void Execute() |
| 25 | { | 25 | { |
| 26 | #if REVISIT_FOR_PATCHING | ||
| 26 | bool optimizePatchSizeForLargeFiles = false; | 27 | bool optimizePatchSizeForLargeFiles = false; |
| 27 | PatchSymbolFlagsType apiPatchingSymbolFlags = 0; | 28 | PatchSymbolFlagsType apiPatchingSymbolFlags = 0; |
| 28 | 29 | ||
| @@ -82,6 +83,8 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 82 | } | 83 | } |
| 83 | } | 84 | } |
| 84 | } | 85 | } |
| 86 | #endif | ||
| 87 | throw new NotImplementedException(); | ||
| 85 | } | 88 | } |
| 86 | } | 89 | } |
| 87 | } | 90 | } |
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()) |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs index 26d254f2..47b58058 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs | |||
| @@ -122,7 +122,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 122 | { | 122 | { |
| 123 | if (ColumnType.Object == columnDefinition.Type) | 123 | if (ColumnType.Object == columnDefinition.Type) |
| 124 | { | 124 | { |
| 125 | importTable = new Table(table.Section, table.Definition); | 125 | importTable = new Table(table.Definition); |
| 126 | hasBinaryColumn = true; | 126 | hasBinaryColumn = true; |
| 127 | break; | 127 | break; |
| 128 | } | 128 | } |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs index caf8b7a7..9bbb4763 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs | |||
| @@ -24,6 +24,8 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 24 | 24 | ||
| 25 | public void Execute() | 25 | public void Execute() |
| 26 | { | 26 | { |
| 27 | throw new NotImplementedException(); | ||
| 28 | #if TODO | ||
| 27 | List<FileFacade> facades = new List<FileFacade>(this.FileTable.Rows.Count); | 29 | List<FileFacade> facades = new List<FileFacade>(this.FileTable.Rows.Count); |
| 28 | 30 | ||
| 29 | RowDictionary<WixFileRow> wixFiles = new RowDictionary<WixFileRow>(this.WixFileTable); | 31 | RowDictionary<WixFileRow> wixFiles = new RowDictionary<WixFileRow>(this.WixFileTable); |
| @@ -44,6 +46,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 44 | } | 46 | } |
| 45 | 47 | ||
| 46 | this.FileFacades = facades; | 48 | this.FileFacades = facades; |
| 49 | #endif | ||
| 47 | } | 50 | } |
| 48 | 51 | ||
| 49 | /// <summary> | 52 | /// <summary> |
| @@ -66,7 +69,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 66 | case SymbolPathType.Component: | 69 | case SymbolPathType.Component: |
| 67 | if (null == filesByComponent) | 70 | if (null == filesByComponent) |
| 68 | { | 71 | { |
| 69 | filesByComponent = facades.ToLookup(f => f.File.Component); | 72 | filesByComponent = facades.ToLookup(f => f.File.Component_); |
| 70 | } | 73 | } |
| 71 | 74 | ||
| 72 | foreach (FileFacade facade in filesByComponent[row.Id]) | 75 | foreach (FileFacade facade in filesByComponent[row.Id]) |
| @@ -78,7 +81,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 78 | case SymbolPathType.Directory: | 81 | case SymbolPathType.Directory: |
| 79 | if (null == filesByDirectory) | 82 | if (null == filesByDirectory) |
| 80 | { | 83 | { |
| 81 | filesByDirectory = facades.ToLookup(f => f.WixFile.Directory); | 84 | filesByDirectory = facades.ToLookup(f => f.WixFile.Directory_); |
| 82 | } | 85 | } |
| 83 | 86 | ||
| 84 | foreach (FileFacade facade in filesByDirectory[row.Id]) | 87 | foreach (FileFacade facade in filesByDirectory[row.Id]) |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs index 624cbb43..f1605eca 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs | |||
| @@ -304,7 +304,8 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 304 | throw new InvalidOperationException("Failed to fetch a File row from the database that was merged in from a module."); | 304 | throw new InvalidOperationException("Failed to fetch a File row from the database that was merged in from a module."); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | recordUpdate.SetInteger(1, file.File.Sequence); | 307 | //recordUpdate.SetInteger(1, file.File.Sequence); |
| 308 | throw new NotImplementedException(); | ||
| 308 | 309 | ||
| 309 | // update the file attributes to match the compression specified | 310 | // update the file attributes to match the compression specified |
| 310 | // on the Merge element or on the Package element | 311 | // on the Merge element or on the Package element |
| @@ -316,26 +317,25 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 316 | attributes = recordUpdate.GetInteger(2); | 317 | attributes = recordUpdate.GetInteger(2); |
| 317 | } | 318 | } |
| 318 | 319 | ||
| 319 | if (YesNoType.Yes == file.File.Compressed) | 320 | // not specified |
| 321 | if (!file.File.Compressed.HasValue) | ||
| 322 | { | ||
| 323 | // clear any compression bits | ||
| 324 | attributes &= ~MsiInterop.MsidbFileAttributesCompressed; | ||
| 325 | attributes &= ~MsiInterop.MsidbFileAttributesNoncompressed; | ||
| 326 | } | ||
| 327 | else if (file.File.Compressed.Value) | ||
| 320 | { | 328 | { |
| 321 | // these are mutually exclusive | 329 | // these are mutually exclusive |
| 322 | attributes |= MsiInterop.MsidbFileAttributesCompressed; | 330 | attributes |= MsiInterop.MsidbFileAttributesCompressed; |
| 323 | attributes &= ~MsiInterop.MsidbFileAttributesNoncompressed; | 331 | attributes &= ~MsiInterop.MsidbFileAttributesNoncompressed; |
| 324 | } | 332 | } |
| 325 | else if (YesNoType.No == file.File.Compressed) | 333 | else if (!file.File.Compressed.Value) |
| 326 | { | 334 | { |
| 327 | // these are mutually exclusive | 335 | // these are mutually exclusive |
| 328 | attributes |= MsiInterop.MsidbFileAttributesNoncompressed; | 336 | attributes |= MsiInterop.MsidbFileAttributesNoncompressed; |
| 329 | attributes &= ~MsiInterop.MsidbFileAttributesCompressed; | 337 | attributes &= ~MsiInterop.MsidbFileAttributesCompressed; |
| 330 | } | 338 | } |
| 331 | else // not specified | ||
| 332 | { | ||
| 333 | Debug.Assert(YesNoType.NotSet == file.File.Compressed); | ||
| 334 | |||
| 335 | // clear any compression bits | ||
| 336 | attributes &= ~MsiInterop.MsidbFileAttributesCompressed; | ||
| 337 | attributes &= ~MsiInterop.MsidbFileAttributesNoncompressed; | ||
| 338 | } | ||
| 339 | 339 | ||
| 340 | recordUpdate.SetInteger(2, attributes); | 340 | recordUpdate.SetInteger(2, attributes); |
| 341 | 341 | ||
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs index cd9444ee..20058597 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs | |||
| @@ -15,6 +15,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 15 | using WixToolset.Core.Bind; | 15 | using WixToolset.Core.Bind; |
| 16 | using WixToolset.Data; | 16 | using WixToolset.Data; |
| 17 | using WixToolset.Data.Rows; | 17 | using WixToolset.Data.Rows; |
| 18 | using WixToolset.Data.Tuples; | ||
| 18 | using WixToolset.Msi; | 19 | using WixToolset.Msi; |
| 19 | 20 | ||
| 20 | /// <summary> | 21 | /// <summary> |
| @@ -69,7 +70,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 69 | 70 | ||
| 70 | if (!fileInfo.Exists) | 71 | if (!fileInfo.Exists) |
| 71 | { | 72 | { |
| 72 | Messaging.Instance.OnMessage(WixErrors.CannotFindFile(file.File.SourceLineNumbers, file.File.File, file.File.FileName, file.WixFile.Source)); | 73 | Messaging.Instance.OnMessage(WixErrors.CannotFindFile(file.File.SourceLineNumbers, file.File.File, file.File.LongFileName, file.WixFile.Source)); |
| 73 | return; | 74 | return; |
| 74 | } | 75 | } |
| 75 | 76 | ||
| @@ -148,16 +149,17 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 148 | 149 | ||
| 149 | if (null == file.Hash) | 150 | if (null == file.Hash) |
| 150 | { | 151 | { |
| 151 | Table msiFileHashTable = this.Output.EnsureTable(this.TableDefinitions["MsiFileHash"]); | 152 | //Table msiFileHashTable = this.Output.EnsureTable(this.TableDefinitions["MsiFileHash"]); |
| 152 | file.Hash = msiFileHashTable.CreateRow(file.File.SourceLineNumbers); | 153 | //file.Hash = msiFileHashTable.CreateRow(file.File.SourceLineNumbers); |
| 154 | throw new NotImplementedException(); | ||
| 153 | } | 155 | } |
| 154 | 156 | ||
| 155 | file.Hash[0] = file.File.File; | 157 | file.Hash.File_ = file.File.File; |
| 156 | file.Hash[1] = 0; | 158 | file.Hash.Options = 0; |
| 157 | file.Hash[2] = hash[0]; | 159 | file.Hash.HashPart1 = hash[0]; |
| 158 | file.Hash[3] = hash[1]; | 160 | file.Hash.HashPart2 = hash[1]; |
| 159 | file.Hash[4] = hash[2]; | 161 | file.Hash.HashPart3 = hash[2]; |
| 160 | file.Hash[5] = hash[3]; | 162 | file.Hash.HashPart4 = hash[3]; |
| 161 | } | 163 | } |
| 162 | } | 164 | } |
| 163 | else // update the file row with the version and language information. | 165 | else // update the file row with the version and language information. |
| @@ -250,9 +252,9 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 250 | assemblyNameValues.Add("publicKeyToken", publicKeyIsNeutral ? "null" : publicKeyToken.ToUpperInvariant()); | 252 | assemblyNameValues.Add("publicKeyToken", publicKeyIsNeutral ? "null" : publicKeyToken.ToUpperInvariant()); |
| 251 | assemblyNameValues.Add("publicKeyTokenPreservedCase", publicKeyIsNeutral ? "null" : publicKeyToken); | 253 | assemblyNameValues.Add("publicKeyTokenPreservedCase", publicKeyIsNeutral ? "null" : publicKeyToken); |
| 252 | } | 254 | } |
| 253 | else if (file.WixFile.AssemblyApplication == null) | 255 | else if (file.WixFile.File_AssemblyApplication == null) |
| 254 | { | 256 | { |
| 255 | throw new WixException(WixErrors.GacAssemblyNoStrongName(file.File.SourceLineNumbers, fileInfo.FullName, file.File.Component)); | 257 | throw new WixException(WixErrors.GacAssemblyNoStrongName(file.File.SourceLineNumbers, fileInfo.FullName, file.File.Component_)); |
| 256 | } | 258 | } |
| 257 | 259 | ||
| 258 | string assemblyVersion = referenceIdentity.GetAttribute(null, "Version"); | 260 | string assemblyVersion = referenceIdentity.GetAttribute(null, "Version"); |
| @@ -350,10 +352,10 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 350 | // TODO: Consider passing in the this.FileFacades as an indexed collection instead of searching through | 352 | // TODO: Consider passing in the this.FileFacades as an indexed collection instead of searching through |
| 351 | // all files like this. Even though this is a rare case it looks like we might be able to index the | 353 | // all files like this. Even though this is a rare case it looks like we might be able to index the |
| 352 | // file earlier. | 354 | // file earlier. |
| 353 | FileFacade fileManifest = this.FileFacades.SingleOrDefault(r => r.File.File.Equals(file.WixFile.AssemblyManifest, StringComparison.Ordinal)); | 355 | FileFacade fileManifest = this.FileFacades.SingleOrDefault(r => r.File.File.Equals(file.WixFile.File_AssemblyManifest, StringComparison.Ordinal)); |
| 354 | if (null == fileManifest) | 356 | if (null == fileManifest) |
| 355 | { | 357 | { |
| 356 | Messaging.Instance.OnMessage(WixErrors.MissingManifestForWin32Assembly(file.File.SourceLineNumbers, file.File.File, file.WixFile.AssemblyManifest)); | 358 | Messaging.Instance.OnMessage(WixErrors.MissingManifestForWin32Assembly(file.File.SourceLineNumbers, file.File.File, file.WixFile.File_AssemblyManifest)); |
| 357 | } | 359 | } |
| 358 | 360 | ||
| 359 | string win32Type = null; | 361 | string win32Type = null; |
| @@ -476,7 +478,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 476 | // check for null value (this can occur when grabbing the file version from an assembly without one) | 478 | // check for null value (this can occur when grabbing the file version from an assembly without one) |
| 477 | if (String.IsNullOrEmpty(value)) | 479 | if (String.IsNullOrEmpty(value)) |
| 478 | { | 480 | { |
| 479 | Messaging.Instance.OnMessage(WixWarnings.NullMsiAssemblyNameValue(file.File.SourceLineNumbers, file.File.Component, name)); | 481 | Messaging.Instance.OnMessage(WixWarnings.NullMsiAssemblyNameValue(file.File.SourceLineNumbers, file.File.Component_, name)); |
| 480 | } | 482 | } |
| 481 | else | 483 | else |
| 482 | { | 484 | { |
| @@ -485,7 +487,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 485 | // override directly authored value | 487 | // override directly authored value |
| 486 | foreach (Row row in assemblyNameTable.Rows) | 488 | foreach (Row row in assemblyNameTable.Rows) |
| 487 | { | 489 | { |
| 488 | if ((string)row[0] == file.File.Component && (string)row[1] == name) | 490 | if ((string)row[0] == file.File.Component_ && (string)row[1] == name) |
| 489 | { | 491 | { |
| 490 | assemblyNameRow = row; | 492 | assemblyNameRow = row; |
| 491 | break; | 493 | break; |
| @@ -494,7 +496,7 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 494 | 496 | ||
| 495 | // if the assembly will be GAC'd and the name in the file table doesn't match the name in the MsiAssemblyName table, error because the install will fail. | 497 | // if the assembly will be GAC'd and the name in the file table doesn't match the name in the MsiAssemblyName table, error because the install will fail. |
| 496 | if ("name" == name && FileAssemblyType.DotNetAssembly == file.WixFile.AssemblyType && | 498 | if ("name" == name && FileAssemblyType.DotNetAssembly == file.WixFile.AssemblyType && |
| 497 | String.IsNullOrEmpty(file.WixFile.AssemblyApplication) && | 499 | String.IsNullOrEmpty(file.WixFile.File_AssemblyApplication) && |
| 498 | !String.Equals(Path.GetFileNameWithoutExtension(file.File.LongFileName), value, StringComparison.OrdinalIgnoreCase)) | 500 | !String.Equals(Path.GetFileNameWithoutExtension(file.File.LongFileName), value, StringComparison.OrdinalIgnoreCase)) |
| 499 | { | 501 | { |
| 500 | Messaging.Instance.OnMessage(WixErrors.GACAssemblyIdentityWarning(file.File.SourceLineNumbers, Path.GetFileNameWithoutExtension(file.File.LongFileName), value)); | 502 | Messaging.Instance.OnMessage(WixErrors.GACAssemblyIdentityWarning(file.File.SourceLineNumbers, Path.GetFileNameWithoutExtension(file.File.LongFileName), value)); |
| @@ -502,8 +504,10 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 502 | 504 | ||
| 503 | if (null == assemblyNameRow) | 505 | if (null == assemblyNameRow) |
| 504 | { | 506 | { |
| 507 | throw new NotImplementedException(); | ||
| 508 | #if TODO | ||
| 505 | assemblyNameRow = assemblyNameTable.CreateRow(file.File.SourceLineNumbers); | 509 | assemblyNameRow = assemblyNameTable.CreateRow(file.File.SourceLineNumbers); |
| 506 | assemblyNameRow[0] = file.File.Component; | 510 | assemblyNameRow[0] = file.File.Component_; |
| 507 | assemblyNameRow[1] = name; | 511 | assemblyNameRow[1] = name; |
| 508 | assemblyNameRow[2] = value; | 512 | assemblyNameRow[2] = value; |
| 509 | 513 | ||
| @@ -512,10 +516,11 @@ namespace WixToolset.Core.WindowsInstaller.Databases | |||
| 512 | 516 | ||
| 513 | if (null == file.AssemblyNames) | 517 | if (null == file.AssemblyNames) |
| 514 | { | 518 | { |
| 515 | file.AssemblyNames = new List<Row>(); | 519 | file.AssemblyNames = new List<MsiAssemblyNameTuple>(); |
| 516 | } | 520 | } |
| 517 | 521 | ||
| 518 | file.AssemblyNames.Add(assemblyNameRow); | 522 | file.AssemblyNames.Add(assemblyNameRow); |
| 523 | #endif | ||
| 519 | } | 524 | } |
| 520 | else | 525 | else |
| 521 | { | 526 | { |
