Fix MsiAssembly table processing
Rob Mensching committed
Oct 25, 2019 at 02:47 UTC
f01d284101e95d490497062c2dc9065423d0cf37
4 files changed
+21
-4
src/WixToolset.Core.WindowsInstaller/Bind/AssemblyName.cs
+2
-2
@@ -16,7 +16,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
16
this.Architecture = architecture;
17
18
this.StrongNamedSigned = !String.IsNullOrEmpty(publicKeyToken);
19
- this.PublicKeyToken = publicKeyToken ?? "null";
19
+ this.PublicKeyToken = publicKeyToken;
20
this.Type = type;
21
}
22
@@ -46,7 +46,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
46
assemblyName.Append(", Culture=");
47
assemblyName.Append(this.Culture);
48
assemblyName.Append(", PublicKeyToken=");
49
- assemblyName.Append(this.PublicKeyToken);
49
+ assemblyName.Append(this.PublicKeyToken ?? "null");
50
51
if (!String.IsNullOrEmpty(this.Architecture))
52
{
src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
+17
@@ -60,6 +60,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind
60
output.EnsureTable(this.TableDefinitions["Signature"]);
61
break;
62
63
+ case TupleDefinitionType.Assembly:
64
+ this.AddAssemblyTuple((AssemblyTuple)tuple, output);
65
+ break;
66
+
67
case TupleDefinitionType.Binary:
68
this.AddTupleDefaultly(tuple, output, idIsPrimaryKey: true);
69
break;
@@ -239,6 +243,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind
243
}
244
}
245
246
+ private void AddAssemblyTuple(AssemblyTuple tuple, Output output)
247
+ {
248
+ var attributes = tuple.Type == AssemblyType.Win32Assembly ? 1 : (int?)null;
249
+
250
+ var table = output.EnsureTable(this.TableDefinitions["MsiAssembly"]);
251
+ var row = table.CreateRow(tuple.SourceLineNumbers);
252
+ row[0] = tuple.ComponentRef;
253
+ row[1] = tuple.FeatureRef;
254
+ row[2] = tuple.ManifestFileRef;
255
+ row[3] = tuple.ApplicationFileRef;
256
+ row[4] = attributes;
257
+ }
258
+
259
private void AddBBControlTuple(BBControlTuple tuple, Output output)
260
{
261
var attributes = tuple.Attributes;
src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+1
-1
@@ -480,7 +480,7 @@ namespace WixToolsetTest.CoreIntegration
480
}
481
}
482
483
- [Fact(Skip = "Test demonstrates failure")]
483
+ [Fact]
484
public void PopulatesMsiAssemblyTables()
485
{
486
var folder = TestData.Get(@"TestData");
src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Win32Assembly.wxs
+1
-1
@@ -3,7 +3,7 @@
3
<Fragment>
4
<ComponentGroup Id="ProductComponents">
5
<Component Directory="INSTALLFOLDER">
6
- <File Source="test.txt" Assembly="win32" AssemblyManifest="test.dll.manifest" />
6
+ <File Id="test.txt" Source="test.txt" Assembly="win32" AssemblyManifest="test.dll.manifest" />
7
</Component>
8
<Component Id="test.dll.manifest" Directory="INSTALLFOLDER">
9
<File Id="test.dll.manifest" Source="test.manifest" Name="test.dll.manifest"></File>