diff options
| author | Rob Mensching <rob@firegiant.com> | 2019-05-23 15:35:48 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2019-05-23 16:07:04 -0700 |
| commit | 5812c6c4b9d40e9ae2b5234a778ecf5aeb8423ff (patch) | |
| tree | ea6fae3959e205b5c261ae7d7fc1f83b981d5e63 /src | |
| parent | b645ddc2c1386c1199ca1e7790201d7a5ab6627b (diff) | |
| download | wix-5812c6c4b9d40e9ae2b5234a778ecf5aeb8423ff.tar.gz wix-5812c6c4b9d40e9ae2b5234a778ecf5aeb8423ff.tar.bz2 wix-5812c6c4b9d40e9ae2b5234a778ecf5aeb8423ff.zip | |
Integrate latest Data changes for FileTuple and AssemblyTuple
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Converters.Tupleizer/ConvertTuplesCommand.cs | 82 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Converters.Tupleizer/ConvertTuplesFixture.cs | 94 |
2 files changed, 113 insertions, 63 deletions
diff --git a/src/WixToolset.Converters.Tupleizer/ConvertTuplesCommand.cs b/src/WixToolset.Converters.Tupleizer/ConvertTuplesCommand.cs index 007b9c62..b878f656 100644 --- a/src/WixToolset.Converters.Tupleizer/ConvertTuplesCommand.cs +++ b/src/WixToolset.Converters.Tupleizer/ConvertTuplesCommand.cs | |||
| @@ -23,16 +23,18 @@ namespace WixToolset.Converters.Tupleizer | |||
| 23 | var section = new IntermediateSection(String.Empty, OutputType3ToSectionType4(output.Type), output.Codepage); | 23 | var section = new IntermediateSection(String.Empty, OutputType3ToSectionType4(output.Type), output.Codepage); |
| 24 | 24 | ||
| 25 | var wixMediaByDiskId = IndexWixMediaTableByDiskId(output); | 25 | var wixMediaByDiskId = IndexWixMediaTableByDiskId(output); |
| 26 | var componentsById = IndexById<Wix3.Row>(output, "Component"); | ||
| 26 | var bindPathsById = IndexById<Wix3.Row>(output, "BindPath"); | 27 | var bindPathsById = IndexById<Wix3.Row>(output, "BindPath"); |
| 27 | var fontsById = IndexById<Wix3.Row>(output, "Font"); | 28 | var fontsById = IndexById<Wix3.Row>(output, "Font"); |
| 28 | var selfRegById = IndexById<Wix3.Row>(output, "SelfReg"); | 29 | var selfRegById = IndexById<Wix3.Row>(output, "SelfReg"); |
| 29 | var wixDirectoryById = IndexById<Wix3.Row>(output, "WixDirectory"); | 30 | var wixDirectoryById = IndexById<Wix3.Row>(output, "WixDirectory"); |
| 31 | var wixFileById = IndexById<Wix3.Row>(output, "WixFile"); | ||
| 30 | 32 | ||
| 31 | foreach (Wix3.Table table in output.Tables) | 33 | foreach (Wix3.Table table in output.Tables) |
| 32 | { | 34 | { |
| 33 | foreach (Wix3.Row row in table.Rows) | 35 | foreach (Wix3.Row row in table.Rows) |
| 34 | { | 36 | { |
| 35 | var tuple = GenerateTupleFromRow(row, wixMediaByDiskId, fontsById, bindPathsById, selfRegById, wixDirectoryById); | 37 | var tuple = GenerateTupleFromRow(row, wixMediaByDiskId, componentsById, fontsById, bindPathsById, selfRegById, wixFileById, wixDirectoryById); |
| 36 | if (tuple != null) | 38 | if (tuple != null) |
| 37 | { | 39 | { |
| 38 | section.Tuples.Add(tuple); | 40 | section.Tuples.Add(tuple); |
| @@ -75,7 +77,7 @@ namespace WixToolset.Converters.Tupleizer | |||
| 75 | return byId; | 77 | return byId; |
| 76 | } | 78 | } |
| 77 | 79 | ||
| 78 | private static IntermediateTuple GenerateTupleFromRow(Wix3.Row row, Dictionary<int, Wix3.WixMediaRow> wixMediaByDiskId, Dictionary<string, Wix3.Row> fontsById, Dictionary<string, Wix3.Row> bindPathsById, Dictionary<string, Wix3.Row> selfRegById, Dictionary<string, Wix3.Row> wixDirectoryById) | 80 | private static IntermediateTuple GenerateTupleFromRow(Wix3.Row row, Dictionary<int, Wix3.WixMediaRow> wixMediaByDiskId, Dictionary<string, Wix3.Row> componentsById, Dictionary<string, Wix3.Row> fontsById, Dictionary<string, Wix3.Row> bindPathsById, Dictionary<string, Wix3.Row> selfRegById, Dictionary<string, Wix3.Row> wixFileById, Dictionary<string, Wix3.Row> wixDirectoryById) |
| 79 | { | 81 | { |
| 80 | var name = row.Table.Name; | 82 | var name = row.Table.Name; |
| 81 | switch (name) | 83 | switch (name) |
| @@ -234,20 +236,15 @@ namespace WixToolset.Converters.Tupleizer | |||
| 234 | case "File": | 236 | case "File": |
| 235 | { | 237 | { |
| 236 | var attributes = FieldAsNullableInt(row, 6); | 238 | var attributes = FieldAsNullableInt(row, 6); |
| 237 | var readOnly = (attributes & WindowsInstallerConstants.MsidbFileAttributesReadOnly) == WindowsInstallerConstants.MsidbFileAttributesReadOnly; | 239 | |
| 238 | var hidden = (attributes & WindowsInstallerConstants.MsidbFileAttributesHidden) == WindowsInstallerConstants.MsidbFileAttributesHidden; | 240 | FileTupleAttributes tupleAttributes = 0; |
| 239 | var system = (attributes & WindowsInstallerConstants.MsidbFileAttributesSystem) == WindowsInstallerConstants.MsidbFileAttributesSystem; | 241 | tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesReadOnly) == WindowsInstallerConstants.MsidbFileAttributesReadOnly ? FileTupleAttributes.ReadOnly : 0; |
| 240 | var vital = (attributes & WindowsInstallerConstants.MsidbFileAttributesVital) == WindowsInstallerConstants.MsidbFileAttributesVital; | 242 | tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesHidden) == WindowsInstallerConstants.MsidbFileAttributesHidden ? FileTupleAttributes.Hidden : 0; |
| 241 | var checksum = (attributes & WindowsInstallerConstants.MsidbFileAttributesChecksum) == WindowsInstallerConstants.MsidbFileAttributesChecksum; | 243 | tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesSystem) == WindowsInstallerConstants.MsidbFileAttributesSystem ? FileTupleAttributes.System : 0; |
| 242 | bool? compressed = null; | 244 | tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesVital) == WindowsInstallerConstants.MsidbFileAttributesVital ? FileTupleAttributes.Vital : 0; |
| 243 | if ((attributes & WindowsInstallerConstants.MsidbFileAttributesNoncompressed) == WindowsInstallerConstants.MsidbFileAttributesNoncompressed) | 245 | tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesChecksum) == WindowsInstallerConstants.MsidbFileAttributesChecksum ? FileTupleAttributes.Checksum : 0; |
| 244 | { | 246 | tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesNoncompressed) == WindowsInstallerConstants.MsidbFileAttributesNoncompressed ? FileTupleAttributes.Uncompressed : 0; |
| 245 | compressed = false; | 247 | tupleAttributes |= (attributes & WindowsInstallerConstants.MsidbFileAttributesCompressed) == WindowsInstallerConstants.MsidbFileAttributesCompressed ? FileTupleAttributes.Compressed : 0; |
| 246 | } | ||
| 247 | else if ((attributes & WindowsInstallerConstants.MsidbFileAttributesCompressed) == WindowsInstallerConstants.MsidbFileAttributesCompressed) | ||
| 248 | { | ||
| 249 | compressed = true; | ||
| 250 | } | ||
| 251 | 248 | ||
| 252 | var id = FieldAsString(row, 0); | 249 | var id = FieldAsString(row, 0); |
| 253 | 250 | ||
| @@ -258,12 +255,7 @@ namespace WixToolset.Converters.Tupleizer | |||
| 258 | FileSize = FieldAsInt(row, 3), | 255 | FileSize = FieldAsInt(row, 3), |
| 259 | Version = FieldAsString(row, 4), | 256 | Version = FieldAsString(row, 4), |
| 260 | Language = FieldAsString(row, 5), | 257 | Language = FieldAsString(row, 5), |
| 261 | ReadOnly = readOnly, | 258 | Attributes = tupleAttributes |
| 262 | Hidden = hidden, | ||
| 263 | System = system, | ||
| 264 | Vital = vital, | ||
| 265 | Checksum = checksum, | ||
| 266 | Compressed = compressed, | ||
| 267 | }; | 259 | }; |
| 268 | 260 | ||
| 269 | if (bindPathsById.TryGetValue(id, out var bindPathRow)) | 261 | if (bindPathsById.TryGetValue(id, out var bindPathRow)) |
| @@ -281,6 +273,16 @@ namespace WixToolset.Converters.Tupleizer | |||
| 281 | tuple.SelfRegCost = FieldAsNullableInt(selfRegRow, 1) ?? 0; | 273 | tuple.SelfRegCost = FieldAsNullableInt(selfRegRow, 1) ?? 0; |
| 282 | } | 274 | } |
| 283 | 275 | ||
| 276 | if (wixFileById.TryGetValue(id, out var wixFileRow)) | ||
| 277 | { | ||
| 278 | tuple.DirectoryRef = FieldAsString(wixFileRow, 4); | ||
| 279 | tuple.DiskId = FieldAsNullableInt(wixFileRow, 5) ?? 0; | ||
| 280 | tuple.Source = new IntermediateFieldPathValue() { Path = FieldAsString(wixFileRow, 6) }; | ||
| 281 | tuple.PatchGroup = FieldAsInt(wixFileRow, 8); | ||
| 282 | tuple.Attributes |= FieldAsInt(wixFileRow, 9) != 0 ? FileTupleAttributes.GeneratedShortFileName : 0; | ||
| 283 | tuple.PatchAttributes = (PatchAttributeType)FieldAsInt(wixFileRow, 10); | ||
| 284 | } | ||
| 285 | |||
| 284 | return tuple; | 286 | return tuple; |
| 285 | } | 287 | } |
| 286 | case "Font": | 288 | case "Font": |
| @@ -321,7 +323,22 @@ namespace WixToolset.Converters.Tupleizer | |||
| 321 | case "MoveFile": | 323 | case "MoveFile": |
| 322 | return DefaultTupleFromRow(typeof(MoveFileTuple), row, columnZeroIsId: true); | 324 | return DefaultTupleFromRow(typeof(MoveFileTuple), row, columnZeroIsId: true); |
| 323 | case "MsiAssembly": | 325 | case "MsiAssembly": |
| 324 | return DefaultTupleFromRow(typeof(MsiAssemblyTuple), row, columnZeroIsId: false); | 326 | { |
| 327 | var componentId = FieldAsString(row, 0); | ||
| 328 | if (componentsById.TryGetValue(componentId, out var componentRow)) | ||
| 329 | { | ||
| 330 | return new AssemblyTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(componentRow, 5))) | ||
| 331 | { | ||
| 332 | ComponentRef = componentId, | ||
| 333 | FeatureRef = FieldAsString(row, 1), | ||
| 334 | ManifestFileRef = FieldAsString(row, 2), | ||
| 335 | ApplicationFileRef = FieldAsString(row, 3), | ||
| 336 | Type = FieldAsNullableInt(row, 4) == 1 ? AssemblyType.Win32Assembly : AssemblyType.DotNetAssembly, | ||
| 337 | }; | ||
| 338 | } | ||
| 339 | |||
| 340 | return null; | ||
| 341 | } | ||
| 325 | case "MsiLockPermissionsEx": | 342 | case "MsiLockPermissionsEx": |
| 326 | return DefaultTupleFromRow(typeof(MsiLockPermissionsExTuple), row, columnZeroIsId: true); | 343 | return DefaultTupleFromRow(typeof(MsiLockPermissionsExTuple), row, columnZeroIsId: true); |
| 327 | case "MsiShortcutProperty": | 344 | case "MsiShortcutProperty": |
| @@ -504,6 +521,7 @@ namespace WixToolset.Converters.Tupleizer | |||
| 504 | case "Verb": | 521 | case "Verb": |
| 505 | return DefaultTupleFromRow(typeof(VerbTuple), row, columnZeroIsId: false); | 522 | return DefaultTupleFromRow(typeof(VerbTuple), row, columnZeroIsId: false); |
| 506 | case "WixAction": | 523 | case "WixAction": |
| 524 | { | ||
| 507 | var sequenceTable = FieldAsString(row, 0); | 525 | var sequenceTable = FieldAsString(row, 0); |
| 508 | return new WixActionTuple(SourceLineNumber4(row.SourceLineNumbers)) | 526 | return new WixActionTuple(SourceLineNumber4(row.SourceLineNumbers)) |
| 509 | { | 527 | { |
| @@ -515,6 +533,7 @@ namespace WixToolset.Converters.Tupleizer | |||
| 515 | After = FieldAsString(row, 5), | 533 | After = FieldAsString(row, 5), |
| 516 | Overridable = FieldAsNullableInt(row, 6) != 0, | 534 | Overridable = FieldAsNullableInt(row, 6) != 0, |
| 517 | }; | 535 | }; |
| 536 | } | ||
| 518 | case "WixBootstrapperApplication": | 537 | case "WixBootstrapperApplication": |
| 519 | return DefaultTupleFromRow(typeof(WixBootstrapperApplicationTuple), row, columnZeroIsId: true); | 538 | return DefaultTupleFromRow(typeof(WixBootstrapperApplicationTuple), row, columnZeroIsId: true); |
| 520 | case "WixBundleContainer": | 539 | case "WixBundleContainer": |
| @@ -525,25 +544,10 @@ namespace WixToolset.Converters.Tupleizer | |||
| 525 | return DefaultTupleFromRow(typeof(WixChainItemTuple), row, columnZeroIsId: true); | 544 | return DefaultTupleFromRow(typeof(WixChainItemTuple), row, columnZeroIsId: true); |
| 526 | case "WixCustomTable": | 545 | case "WixCustomTable": |
| 527 | return DefaultTupleFromRow(typeof(WixCustomTableTuple), row, columnZeroIsId: true); | 546 | return DefaultTupleFromRow(typeof(WixCustomTableTuple), row, columnZeroIsId: true); |
| 528 | case "WixDeltaPatchFile": | ||
| 529 | return DefaultTupleFromRow(typeof(WixDeltaPatchFileTuple), row, columnZeroIsId: true); | ||
| 530 | case "WixDirectory": | 547 | case "WixDirectory": |
| 531 | return null; | 548 | return null; |
| 532 | case "WixFile": | 549 | case "WixFile": |
| 533 | var assemblyAttributes3 = FieldAsNullableInt(row, 1); | 550 | return null; |
| 534 | return new WixFileTuple(SourceLineNumber4(row.SourceLineNumbers), new Identifier(AccessModifier.Public, FieldAsString(row, 0))) | ||
| 535 | { | ||
| 536 | AssemblyType = assemblyAttributes3 == 0 ? FileAssemblyType.DotNetAssembly : assemblyAttributes3 == 1 ? FileAssemblyType.Win32Assembly : FileAssemblyType.NotAnAssembly, | ||
| 537 | AssemblyManifestFileRef = FieldAsString(row, 2), | ||
| 538 | AssemblyApplicationFileRef = FieldAsString(row, 3), | ||
| 539 | DirectoryRef = FieldAsString(row, 4), | ||
| 540 | DiskId = FieldAsNullableInt(row, 5) ?? 0, | ||
| 541 | Source = new IntermediateFieldPathValue() { Path = FieldAsString(row, 6) }, | ||
| 542 | ProcessorArchitecture = FieldAsString(row, 7), | ||
| 543 | PatchGroup = FieldAsInt(row, 8), | ||
| 544 | Attributes = FieldAsInt(row, 9), | ||
| 545 | PatchAttributes = (PatchAttributeType)FieldAsInt(row, 10), | ||
| 546 | }; | ||
| 547 | case "WixInstanceTransforms": | 551 | case "WixInstanceTransforms": |
| 548 | return DefaultTupleFromRow(typeof(WixInstanceTransformsTuple), row, columnZeroIsId: true); | 552 | return DefaultTupleFromRow(typeof(WixInstanceTransformsTuple), row, columnZeroIsId: true); |
| 549 | case "WixMedia": | 553 | case "WixMedia": |
diff --git a/src/test/WixToolsetTest.Converters.Tupleizer/ConvertTuplesFixture.cs b/src/test/WixToolsetTest.Converters.Tupleizer/ConvertTuplesFixture.cs index 9b1fa4cf..14ebd70a 100644 --- a/src/test/WixToolsetTest.Converters.Tupleizer/ConvertTuplesFixture.cs +++ b/src/test/WixToolsetTest.Converters.Tupleizer/ConvertTuplesFixture.cs | |||
| @@ -56,8 +56,11 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 56 | .ToArray(); | 56 | .ToArray(); |
| 57 | 57 | ||
| 58 | var tuples = intermediate.Sections.SelectMany(s => s.Tuples); | 58 | var tuples = intermediate.Sections.SelectMany(s => s.Tuples); |
| 59 | |||
| 60 | var assemblyTuplesByFileId = tuples.OfType<AssemblyTuple>().ToDictionary(a => a.Id.Id); | ||
| 61 | |||
| 59 | var wix4Dump = tuples | 62 | var wix4Dump = tuples |
| 60 | .SelectMany(tuple => TupleToStrings(tuple)) | 63 | .SelectMany(tuple => TupleToStrings(tuple, assemblyTuplesByFileId)) |
| 61 | .OrderBy(s => s) | 64 | .OrderBy(s => s) |
| 62 | .ToArray(); | 65 | .ToArray(); |
| 63 | 66 | ||
| @@ -67,8 +70,11 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 67 | var wix3TextDump = String.Join(Environment.NewLine, wix3Dump); | 70 | var wix3TextDump = String.Join(Environment.NewLine, wix3Dump); |
| 68 | var wix4TextDump = String.Join(Environment.NewLine, wix4Dump); | 71 | var wix4TextDump = String.Join(Environment.NewLine, wix4Dump); |
| 69 | 72 | ||
| 70 | File.WriteAllText(Path.Combine(Path.GetTempPath(), "~3.txt"), wix3TextDump); | 73 | var path3 = Path.Combine(Path.GetTempPath(), "~3.txt"); |
| 71 | File.WriteAllText(Path.Combine(Path.GetTempPath(), "~4.txt"), wix4TextDump); | 74 | var path4 = Path.Combine(Path.GetTempPath(), "~4.txt"); |
| 75 | |||
| 76 | File.WriteAllText(path3, wix3TextDump); | ||
| 77 | File.WriteAllText(path4, wix4TextDump); | ||
| 72 | 78 | ||
| 73 | Assert.Equal(wix3TextDump, wix4TextDump); | 79 | Assert.Equal(wix3TextDump, wix4TextDump); |
| 74 | #endif | 80 | #endif |
| @@ -143,13 +149,19 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 143 | break; | 149 | break; |
| 144 | case "WixFile": | 150 | case "WixFile": |
| 145 | { | 151 | { |
| 146 | var fieldValues = row.Fields.Take(10).Select(SafeConvertField).ToArray(); | 152 | var fieldValues = row.Fields.Select(SafeConvertField).ToArray(); |
| 147 | if (fieldValues[8] == null) | 153 | if (fieldValues[8] == null) |
| 148 | { | 154 | { |
| 149 | // "Somebody" sometimes writes out a null field even when the column definition says | 155 | // "Somebody" sometimes writes out a null field even when the column definition says |
| 150 | // it's non-nullable. Not naming names or anything. (SWID tags.) | 156 | // it's non-nullable. Not naming names or anything. (SWID tags.) |
| 151 | fieldValues[8] = "0"; | 157 | fieldValues[8] = "0"; |
| 152 | } | 158 | } |
| 159 | if (fieldValues[10] == null) | ||
| 160 | { | ||
| 161 | // WixFile rows that come from merge modules will not have the attributes column set | ||
| 162 | // so initilaize with 0. | ||
| 163 | fieldValues[10] = "0"; | ||
| 164 | } | ||
| 153 | fields = String.Join(",", fieldValues); | 165 | fields = String.Join(",", fieldValues); |
| 154 | break; | 166 | break; |
| 155 | } | 167 | } |
| @@ -166,8 +178,11 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 166 | } | 178 | } |
| 167 | } | 179 | } |
| 168 | 180 | ||
| 169 | private static IEnumerable<string> TupleToStrings(IntermediateTuple tuple) | 181 | private static IEnumerable<string> TupleToStrings(IntermediateTuple tuple, Dictionary<string, AssemblyTuple> assemblyTuplesByFileId) |
| 170 | { | 182 | { |
| 183 | var name = tuple.Definition.Type == TupleDefinitionType.SummaryInformation ? "_SummaryInformation" : tuple.Definition.Name; | ||
| 184 | var id = tuple.Id?.Id ?? String.Empty; | ||
| 185 | |||
| 171 | string fields; | 186 | string fields; |
| 172 | switch (tuple.Definition.Name) | 187 | switch (tuple.Definition.Name) |
| 173 | { | 188 | { |
| @@ -280,20 +295,53 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 280 | yield return $"SelfReg:{fileTuple.Id.Id},{fileTuple.SelfRegCost}"; | 295 | yield return $"SelfReg:{fileTuple.Id.Id},{fileTuple.SelfRegCost}"; |
| 281 | } | 296 | } |
| 282 | 297 | ||
| 298 | int? assemblyAttributes = null; | ||
| 299 | if (assemblyTuplesByFileId.TryGetValue(fileTuple.Id.Id, out var assemblyTuple)) | ||
| 300 | { | ||
| 301 | if (assemblyTuple.Type == AssemblyType.DotNetAssembly) | ||
| 302 | { | ||
| 303 | assemblyAttributes = 0; | ||
| 304 | } | ||
| 305 | else if (assemblyTuple.Type == AssemblyType.Win32Assembly) | ||
| 306 | { | ||
| 307 | assemblyAttributes = 1; | ||
| 308 | } | ||
| 309 | } | ||
| 310 | |||
| 311 | yield return "WixFile:" + String.Join(",", | ||
| 312 | fileTuple.Id.Id, | ||
| 313 | assemblyAttributes, | ||
| 314 | assemblyTuple?.ManifestFileRef, | ||
| 315 | assemblyTuple?.ApplicationFileRef, | ||
| 316 | fileTuple.DirectoryRef, | ||
| 317 | fileTuple.DiskId, | ||
| 318 | fileTuple.Source.Path, | ||
| 319 | null, // assembly processor arch | ||
| 320 | fileTuple.PatchGroup, | ||
| 321 | (fileTuple.Attributes & FileTupleAttributes.GeneratedShortFileName) != 0 ? 1 : 0, | ||
| 322 | (int)fileTuple.PatchAttributes, | ||
| 323 | fileTuple.RetainLengths, | ||
| 324 | fileTuple.IgnoreOffsets, | ||
| 325 | fileTuple.IgnoreLengths, | ||
| 326 | fileTuple.RetainOffsets | ||
| 327 | ); | ||
| 328 | |||
| 329 | var fileAttributes = 0; | ||
| 330 | fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.ReadOnly) != 0 ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0; | ||
| 331 | fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Hidden) != 0 ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0; | ||
| 332 | fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.System) != 0 ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0; | ||
| 333 | fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Vital) != 0 ? WindowsInstallerConstants.MsidbFileAttributesVital : 0; | ||
| 334 | fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Checksum) != 0 ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0; | ||
| 335 | fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Compressed) != 0 ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0; | ||
| 336 | fileAttributes |= (fileTuple.Attributes & FileTupleAttributes.Uncompressed) != 0 ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0; | ||
| 337 | |||
| 283 | fields = String.Join(",", | 338 | fields = String.Join(",", |
| 284 | fileTuple.ComponentRef, | 339 | fileTuple.ComponentRef, |
| 285 | fileTuple.Name, | 340 | fileTuple.Name, |
| 286 | fileTuple.FileSize.ToString(), | 341 | fileTuple.FileSize.ToString(), |
| 287 | fileTuple.Version, | 342 | fileTuple.Version, |
| 288 | fileTuple.Language, | 343 | fileTuple.Language, |
| 289 | ((fileTuple.ReadOnly ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0) | 344 | fileAttributes); |
| 290 | | (fileTuple.Hidden ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0) | ||
| 291 | | (fileTuple.System ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0) | ||
| 292 | | (fileTuple.Vital ? WindowsInstallerConstants.MsidbFileAttributesVital : 0) | ||
| 293 | | (fileTuple.Checksum ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0) | ||
| 294 | | ((fileTuple.Compressed.HasValue && fileTuple.Compressed.Value) ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0) | ||
| 295 | | ((fileTuple.Compressed.HasValue && !fileTuple.Compressed.Value) ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0)) | ||
| 296 | .ToString()); | ||
| 297 | break; | 345 | break; |
| 298 | } | 346 | } |
| 299 | 347 | ||
| @@ -301,6 +349,15 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 301 | fields = String.Join(",", tuple.Fields.Skip(1).Select(SafeConvertField)); | 349 | fields = String.Join(",", tuple.Fields.Skip(1).Select(SafeConvertField)); |
| 302 | break; | 350 | break; |
| 303 | 351 | ||
| 352 | case "Assembly": | ||
| 353 | { | ||
| 354 | var assemblyTuple = (AssemblyTuple)tuple; | ||
| 355 | |||
| 356 | id = null; | ||
| 357 | name = "MsiAssembly"; | ||
| 358 | fields = String.Join(",", assemblyTuple.ComponentRef, assemblyTuple.FeatureRef, assemblyTuple.ManifestFileRef, assemblyTuple.ApplicationFileRef, assemblyTuple.Type == AssemblyType.Win32Assembly ? 1 : 0); | ||
| 359 | break; | ||
| 360 | } | ||
| 304 | case "Registry": | 361 | case "Registry": |
| 305 | { | 362 | { |
| 306 | var registryTuple = (RegistryTuple)tuple; | 363 | var registryTuple = (RegistryTuple)tuple; |
| @@ -468,15 +525,6 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 468 | break; | 525 | break; |
| 469 | } | 526 | } |
| 470 | 527 | ||
| 471 | case "WixFile": | ||
| 472 | { | ||
| 473 | var wixFileTuple = (WixFileTuple)tuple; | ||
| 474 | fields = String.Concat( | ||
| 475 | wixFileTuple.AssemblyType == FileAssemblyType.DotNetAssembly ? "0" : wixFileTuple.AssemblyType == FileAssemblyType.Win32Assembly ? "1" : String.Empty, ",", | ||
| 476 | String.Join(",", tuple.Fields.Skip(1).Take(8).Select(field => (string)field))); | ||
| 477 | break; | ||
| 478 | } | ||
| 479 | |||
| 480 | case "WixProperty": | 528 | case "WixProperty": |
| 481 | { | 529 | { |
| 482 | var wixPropertyTuple = (WixPropertyTuple)tuple; | 530 | var wixPropertyTuple = (WixPropertyTuple)tuple; |
| @@ -496,8 +544,6 @@ namespace WixToolsetTest.Converters.Tupleizer | |||
| 496 | break; | 544 | break; |
| 497 | } | 545 | } |
| 498 | 546 | ||
| 499 | var name = tuple.Definition.Type == TupleDefinitionType.SummaryInformation ? "_SummaryInformation" : tuple.Definition.Name; | ||
| 500 | var id = tuple.Id?.Id ?? String.Empty; | ||
| 501 | fields = String.IsNullOrEmpty(id) ? fields : String.IsNullOrEmpty(fields) ? id : $"{id},{fields}"; | 547 | fields = String.IsNullOrEmpty(id) ? fields : String.IsNullOrEmpty(fields) ? id : $"{id},{fields}"; |
| 502 | yield return $"{name}:{fields}"; | 548 | yield return $"{name}:{fields}"; |
| 503 | } | 549 | } |
