diff options
| author | Rob Mensching <rob@firegiant.com> | 2019-10-18 11:30:10 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2019-10-18 11:34:46 -0700 |
| commit | 6155da0bc9e7faa97612d15def98dd68ea2557cd (patch) | |
| tree | d2a6d9f4c4898b84982f941848b02e4f7ffed037 /src | |
| parent | 7d699fdbbe8a15c72b69f633ac9799fb757e2acc (diff) | |
| download | wix-6155da0bc9e7faa97612d15def98dd68ea2557cd.tar.gz wix-6155da0bc9e7faa97612d15def98dd68ea2557cd.tar.bz2 wix-6155da0bc9e7faa97612d15def98dd68ea2557cd.zip | |
Small tuple based fixes
Diffstat (limited to 'src')
5 files changed, 58 insertions, 39 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index cdda4ebc..ebb494c0 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs | |||
| @@ -50,13 +50,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 50 | switch (tuple.Definition.Type) | 50 | switch (tuple.Definition.Type) |
| 51 | { | 51 | { |
| 52 | case TupleDefinitionType.Binary: | 52 | case TupleDefinitionType.Binary: |
| 53 | this.AddTupleDefaultly(tuple, output, true); | 53 | this.AddTupleDefaultly(tuple, output, idIsPrimaryKey: true); |
| 54 | break; | 54 | break; |
| 55 | 55 | ||
| 56 | case TupleDefinitionType.BBControl: | 56 | case TupleDefinitionType.BBControl: |
| 57 | this.AddBBControlTuple((BBControlTuple)tuple, output); | 57 | this.AddBBControlTuple((BBControlTuple)tuple, output); |
| 58 | break; | 58 | break; |
| 59 | 59 | ||
| 60 | case TupleDefinitionType.Class: | ||
| 61 | this.AddClassTuple((ClassTuple)tuple, output); | ||
| 62 | break; | ||
| 63 | |||
| 60 | case TupleDefinitionType.Control: | 64 | case TupleDefinitionType.Control: |
| 61 | this.AddControlTuple((ControlTuple)tuple, output); | 65 | this.AddControlTuple((ControlTuple)tuple, output); |
| 62 | break; | 66 | break; |
| @@ -89,6 +93,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 89 | this.AddFileTuple((FileTuple)tuple, output); | 93 | this.AddFileTuple((FileTuple)tuple, output); |
| 90 | break; | 94 | break; |
| 91 | 95 | ||
| 96 | case TupleDefinitionType.Icon: | ||
| 97 | this.AddTupleDefaultly(tuple, output, idIsPrimaryKey: true); | ||
| 98 | break; | ||
| 99 | |||
| 92 | case TupleDefinitionType.IniFile: | 100 | case TupleDefinitionType.IniFile: |
| 93 | this.AddIniFileTuple((IniFileTuple)tuple, output); | 101 | this.AddIniFileTuple((IniFileTuple)tuple, output); |
| 94 | break; | 102 | break; |
| @@ -118,7 +126,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 118 | break; | 126 | break; |
| 119 | 127 | ||
| 120 | case TupleDefinitionType.MsiShortcutProperty: | 128 | case TupleDefinitionType.MsiShortcutProperty: |
| 121 | this.AddTupleDefaultly(tuple, output, true); | 129 | this.AddTupleDefaultly(tuple, output, idIsPrimaryKey: true); |
| 122 | break; | 130 | break; |
| 123 | 131 | ||
| 124 | case TupleDefinitionType.MoveFile: | 132 | case TupleDefinitionType.MoveFile: |
| @@ -146,7 +154,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 146 | break; | 154 | break; |
| 147 | 155 | ||
| 148 | case TupleDefinitionType.ReserveCost: | 156 | case TupleDefinitionType.ReserveCost: |
| 149 | this.AddTupleDefaultly(tuple, output, true); | 157 | this.AddTupleDefaultly(tuple, output, idIsPrimaryKey: true); |
| 150 | break; | 158 | break; |
| 151 | 159 | ||
| 152 | case TupleDefinitionType.ServiceControl: | 160 | case TupleDefinitionType.ServiceControl: |
| @@ -162,7 +170,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 162 | break; | 170 | break; |
| 163 | 171 | ||
| 164 | case TupleDefinitionType.Signature: | 172 | case TupleDefinitionType.Signature: |
| 165 | this.AddTupleDefaultly(tuple, output, true); | 173 | this.AddTupleDefaultly(tuple, output, idIsPrimaryKey: true); |
| 166 | break; | 174 | break; |
| 167 | 175 | ||
| 168 | case TupleDefinitionType.SummaryInformation: | 176 | case TupleDefinitionType.SummaryInformation: |
| @@ -228,6 +236,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 228 | row[8] = tuple.Text; | 236 | row[8] = tuple.Text; |
| 229 | } | 237 | } |
| 230 | 238 | ||
| 239 | private void AddClassTuple(ClassTuple tuple, Output output) | ||
| 240 | { | ||
| 241 | var table = output.EnsureTable(this.TableDefinitions["Class"]); | ||
| 242 | var row = table.CreateRow(tuple.SourceLineNumbers); | ||
| 243 | row[0] = tuple.CLSID; | ||
| 244 | row[1] = tuple.Context; | ||
| 245 | row[2] = tuple.ComponentRef; | ||
| 246 | row[3] = tuple.DefaultProgIdRef; | ||
| 247 | row[4] = tuple.Description; | ||
| 248 | row[5] = tuple.AppIdRef; | ||
| 249 | row[6] = tuple.FileTypeMask; | ||
| 250 | row[7] = tuple.IconRef; | ||
| 251 | row[8] = tuple.IconIndex; | ||
| 252 | row[9] = tuple.DefInprocHandler; | ||
| 253 | row[10] = tuple.Argument; | ||
| 254 | row[11] = tuple.FeatureRef; | ||
| 255 | row[12] = tuple.RelativePath ? (int?)1 : null; | ||
| 256 | } | ||
| 257 | |||
| 231 | private void AddControlTuple(ControlTuple tuple, Output output) | 258 | private void AddControlTuple(ControlTuple tuple, Output output) |
| 232 | { | 259 | { |
| 233 | var text = tuple.Text; | 260 | var text = tuple.Text; |
| @@ -326,7 +353,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 326 | row[1] = type; | 353 | row[1] = type; |
| 327 | row[2] = tuple.Source; | 354 | row[2] = tuple.Source; |
| 328 | row[3] = tuple.Target; | 355 | row[3] = tuple.Target; |
| 329 | row[4] = tuple.PatchUninstall ? WindowsInstallerConstants.MsidbCustomActionTypePatchUninstall : 0; | 356 | row[4] = tuple.PatchUninstall ? (int?)WindowsInstallerConstants.MsidbCustomActionTypePatchUninstall : null; |
| 330 | } | 357 | } |
| 331 | 358 | ||
| 332 | private void AddDialogTuple(DialogTuple tuple, Output output) | 359 | private void AddDialogTuple(DialogTuple tuple, Output output) |
| @@ -775,13 +802,22 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 775 | styleBits |= tuple.Strike ? WindowsInstallerConstants.MsidbTextStyleStyleBitsStrike : 0; | 802 | styleBits |= tuple.Strike ? WindowsInstallerConstants.MsidbTextStyleStyleBitsStrike : 0; |
| 776 | styleBits |= tuple.Underline ? WindowsInstallerConstants.MsidbTextStyleStyleBitsUnderline : 0; | 803 | styleBits |= tuple.Underline ? WindowsInstallerConstants.MsidbTextStyleStyleBitsUnderline : 0; |
| 777 | 804 | ||
| 805 | long? color = null; | ||
| 806 | |||
| 807 | if (tuple.Red.HasValue || tuple.Green.HasValue || tuple.Blue.HasValue) | ||
| 808 | { | ||
| 809 | color = tuple.Red ?? 0; | ||
| 810 | color += (long)(tuple.Green ?? 0) * 256; | ||
| 811 | color += (long)(tuple.Blue ?? 0) * 65536; | ||
| 812 | } | ||
| 813 | |||
| 778 | var table = output.EnsureTable(this.TableDefinitions["TextStyle"]); | 814 | var table = output.EnsureTable(this.TableDefinitions["TextStyle"]); |
| 779 | var row = table.CreateRow(tuple.SourceLineNumbers); | 815 | var row = table.CreateRow(tuple.SourceLineNumbers); |
| 780 | row[0] = tuple.Id.Id; | 816 | row[0] = tuple.Id.Id; |
| 781 | row[1] = tuple.FaceName; | 817 | row[1] = tuple.FaceName; |
| 782 | row[2] = tuple.Size; | 818 | row[2] = tuple.Size; |
| 783 | row[3] = tuple.Color; | 819 | row[3] = color; |
| 784 | row[4] = styleBits; | 820 | row[4] = styleBits == 0 ? null : (int?)styleBits; |
| 785 | } | 821 | } |
| 786 | 822 | ||
| 787 | private void AddUpgradeTuple(UpgradeTuple tuple, Output output) | 823 | private void AddUpgradeTuple(UpgradeTuple tuple, Output output) |
diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index 740219cb..10416850 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs | |||
| @@ -27,7 +27,7 @@ namespace WixToolset.Core | |||
| 27 | { | 27 | { |
| 28 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 28 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); |
| 29 | var codepage = 65001; | 29 | var codepage = 65001; |
| 30 | string productCode = "*"; | 30 | var productCode = "*"; |
| 31 | string upgradeCode = null; | 31 | string upgradeCode = null; |
| 32 | string manufacturer = null; | 32 | string manufacturer = null; |
| 33 | string version = null; | 33 | string version = null; |
diff --git a/src/WixToolset.Core/Compiler_UI.cs b/src/WixToolset.Core/Compiler_UI.cs index 6b933d09..30bb7ab6 100644 --- a/src/WixToolset.Core/Compiler_UI.cs +++ b/src/WixToolset.Core/Compiler_UI.cs | |||
| @@ -746,7 +746,9 @@ namespace WixToolset.Core | |||
| 746 | { | 746 | { |
| 747 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 747 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); |
| 748 | Identifier id = null; | 748 | Identifier id = null; |
| 749 | var color = CompilerConstants.IntegerNotSet; | 749 | int? red = null; |
| 750 | int? green = null; | ||
| 751 | int? blue = null; | ||
| 750 | var bold = false; | 752 | var bold = false; |
| 751 | var italic = false; | 753 | var italic = false; |
| 752 | var strike = false; | 754 | var strike = false; |
| @@ -769,42 +771,21 @@ namespace WixToolset.Core | |||
| 769 | var redColor = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Byte.MaxValue); | 771 | var redColor = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Byte.MaxValue); |
| 770 | if (CompilerConstants.IllegalInteger != redColor) | 772 | if (CompilerConstants.IllegalInteger != redColor) |
| 771 | { | 773 | { |
| 772 | if (CompilerConstants.IntegerNotSet == color) | 774 | red = redColor; |
| 773 | { | ||
| 774 | color = redColor; | ||
| 775 | } | ||
| 776 | else | ||
| 777 | { | ||
| 778 | color += redColor; | ||
| 779 | } | ||
| 780 | } | 775 | } |
| 781 | break; | 776 | break; |
| 782 | case "Green": | 777 | case "Green": |
| 783 | var greenColor = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Byte.MaxValue); | 778 | var greenColor = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Byte.MaxValue); |
| 784 | if (CompilerConstants.IllegalInteger != greenColor) | 779 | if (CompilerConstants.IllegalInteger != greenColor) |
| 785 | { | 780 | { |
| 786 | if (CompilerConstants.IntegerNotSet == color) | 781 | green = greenColor; |
| 787 | { | ||
| 788 | color = greenColor * 256; | ||
| 789 | } | ||
| 790 | else | ||
| 791 | { | ||
| 792 | color += greenColor * 256; | ||
| 793 | } | ||
| 794 | } | 782 | } |
| 795 | break; | 783 | break; |
| 796 | case "Blue": | 784 | case "Blue": |
| 797 | var blueColor = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Byte.MaxValue); | 785 | var blueColor = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Byte.MaxValue); |
| 798 | if (CompilerConstants.IllegalInteger != blueColor) | 786 | if (CompilerConstants.IllegalInteger != blueColor) |
| 799 | { | 787 | { |
| 800 | if (CompilerConstants.IntegerNotSet == color) | 788 | blue = blueColor; |
| 801 | { | ||
| 802 | color = blueColor * 65536; | ||
| 803 | } | ||
| 804 | else | ||
| 805 | { | ||
| 806 | color += blueColor * 65536; | ||
| 807 | } | ||
| 808 | } | 789 | } |
| 809 | break; | 790 | break; |
| 810 | 791 | ||
| @@ -843,7 +824,7 @@ namespace WixToolset.Core | |||
| 843 | 824 | ||
| 844 | if (null == id) | 825 | if (null == id) |
| 845 | { | 826 | { |
| 846 | this.Core.CreateIdentifier("txs", faceName, size.ToString(), color.ToString(), bold.ToString(), italic.ToString(), strike.ToString(), underline.ToString()); | 827 | this.Core.CreateIdentifier("txs", faceName, size.ToString(), (red ?? 0).ToString(), (green ?? 0).ToString(), (blue ?? 0).ToString(), bold.ToString(), italic.ToString(), strike.ToString(), underline.ToString()); |
| 847 | } | 828 | } |
| 848 | 829 | ||
| 849 | if (null == faceName) | 830 | if (null == faceName) |
| @@ -858,7 +839,9 @@ namespace WixToolset.Core | |||
| 858 | var tuple = new TextStyleTuple(sourceLineNumbers, id) | 839 | var tuple = new TextStyleTuple(sourceLineNumbers, id) |
| 859 | { | 840 | { |
| 860 | FaceName = faceName, | 841 | FaceName = faceName, |
| 861 | Color = color, | 842 | Red = red, |
| 843 | Green = green, | ||
| 844 | Blue = blue, | ||
| 862 | Bold = bold, | 845 | Bold = bold, |
| 863 | Italic = italic, | 846 | Italic = italic, |
| 864 | Strike = strike, | 847 | Strike = strike, |
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index d31c9ee8..8535f69c 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
| @@ -146,7 +146,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 146 | } | 146 | } |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | [Fact(Skip = "Test demonstrates failure")] | 149 | [Fact] |
| 150 | public void PopulatesClassTablesWhenIconIndexIsZero() | 150 | public void PopulatesClassTablesWhenIconIndexIsZero() |
| 151 | { | 151 | { |
| 152 | var folder = TestData.Get(@"TestData"); | 152 | var folder = TestData.Get(@"TestData"); |
| @@ -218,7 +218,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 218 | } | 218 | } |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | [Fact(Skip = "Test demonstrates failure")] | 221 | [Fact] |
| 222 | public void PopulatesCustomActionTable() | 222 | public void PopulatesCustomActionTable() |
| 223 | { | 223 | { |
| 224 | var folder = TestData.Get(@"TestData"); | 224 | var folder = TestData.Get(@"TestData"); |
| @@ -647,7 +647,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 647 | } | 647 | } |
| 648 | } | 648 | } |
| 649 | 649 | ||
| 650 | [Fact(Skip = "Test demonstrates failure")] | 650 | [Fact] |
| 651 | public void PopulatesTextStyleTableWhenColorIsNull() | 651 | public void PopulatesTextStyleTableWhenColorIsNull() |
| 652 | { | 652 | { |
| 653 | var folder = TestData.Get(@"TestData"); | 653 | var folder = TestData.Get(@"TestData"); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs index 517bddbf..7f9b9686 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs | |||
| @@ -43,7 +43,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | [Fact(Skip = "Test demonstrates failure")] | 46 | [Fact] |
| 47 | public void TypeLibLanguageAsStringReturnsZero() | 47 | public void TypeLibLanguageAsStringReturnsZero() |
| 48 | { | 48 | { |
| 49 | var folder = TestData.Get(@"TestData\TypeLib"); | 49 | var folder = TestData.Get(@"TestData\TypeLib"); |
