aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs4
-rw-r--r--src/WixToolset.Core/Compiler.cs1
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs39
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/SingleFile/PackageComponents.wxs17
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs2
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs2
6 files changed, 53 insertions, 12 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
index 4b02b3aa..6f33080d 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
@@ -232,9 +232,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
232 attributes |= tuple.NeverOverwrite ? WindowsInstallerConstants.MsidbComponentAttributesNeverOverwrite : 0; 232 attributes |= tuple.NeverOverwrite ? WindowsInstallerConstants.MsidbComponentAttributesNeverOverwrite : 0;
233 attributes |= tuple.Permanent ? WindowsInstallerConstants.MsidbComponentAttributesPermanent : 0; 233 attributes |= tuple.Permanent ? WindowsInstallerConstants.MsidbComponentAttributesPermanent : 0;
234 attributes |= tuple.SharedDllRefCount ? WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount : 0; 234 attributes |= tuple.SharedDllRefCount ? WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount : 0;
235 attributes |= tuple.Shared ? WindowsInstallerConstants.MsidbComponentAttributesShared : 0;
235 attributes |= tuple.Transitive ? WindowsInstallerConstants.MsidbComponentAttributesTransitive : 0; 236 attributes |= tuple.Transitive ? WindowsInstallerConstants.MsidbComponentAttributesTransitive : 0;
236 attributes |= tuple.UninstallWhenSuperseded ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0; 237 attributes |= tuple.UninstallWhenSuperseded ? WindowsInstallerConstants.MsidbComponentAttributesUninstallOnSupersedence : 0;
237
238 attributes |= tuple.Win64 ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0; 238 attributes |= tuple.Win64 ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0;
239 239
240 var table = output.EnsureTable(this.TableDefinitions["Component"]); 240 var table = output.EnsureTable(this.TableDefinitions["Component"]);
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs
index 48e22f6d..25cc095b 100644
--- a/src/WixToolset.Core/Compiler.cs
+++ b/src/WixToolset.Core/Compiler.cs
@@ -2469,6 +2469,7 @@ namespace WixToolset.Core
2469 NeverOverwrite = neverOverwrite, 2469 NeverOverwrite = neverOverwrite,
2470 Permanent = permanent, 2470 Permanent = permanent,
2471 SharedDllRefCount = sharedDllRefCount, 2471 SharedDllRefCount = sharedDllRefCount,
2472 Shared = shared,
2472 Transitive = transitive, 2473 Transitive = transitive,
2473 UninstallWhenSuperseded = uninstallWhenSuperseded, 2474 UninstallWhenSuperseded = uninstallWhenSuperseded,
2474 Win64 = win64, 2475 Win64 = win64,
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
index 3e66ad0a..0aabc5a9 100644
--- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
@@ -43,7 +43,7 @@ namespace WixToolsetTest.CoreIntegration
43 var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); 43 var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
44 var section = intermediate.Sections.Single(); 44 var section = intermediate.Sections.Single();
45 45
46 var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); 46 var wixFile = section.Tuples.OfType<WixFileTuple>().First();
47 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); 47 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
48 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); 48 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
49 } 49 }
@@ -540,6 +540,43 @@ namespace WixToolsetTest.CoreIntegration
540 } 540 }
541 541
542 [Fact] 542 [Fact]
543 public void CanBuildSharedComponent()
544 {
545 var folder = TestData.Get(@"TestData\SingleFile");
546
547 using (var fs = new DisposableFileSystem())
548 {
549 var baseFolder = fs.GetFolder();
550 var intermediateFolder = Path.Combine(baseFolder, "obj");
551
552 var result = WixRunner.Execute(new[]
553 {
554 "build",
555 Path.Combine(folder, "Package.wxs"),
556 Path.Combine(folder, "PackageComponents.wxs"),
557 "-loc", Path.Combine(folder, "Package.en-us.wxl"),
558 "-bindpath", Path.Combine(folder, "data"),
559 "-intermediateFolder", intermediateFolder,
560 "-arch", "x64",
561 "-o", Path.Combine(baseFolder, @"bin\test.msi")
562 });
563
564 result.AssertSuccess();
565
566 var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir"));
567 var section = intermediate.Sections.Single();
568
569 // Only one component is shared.
570 var sharedComponentTuples = section.Tuples.OfType<ComponentTuple>();
571 Assert.Equal(1, sharedComponentTuples.Sum(t => t.Shared ? 1 : 0));
572
573 // And it is this one.
574 var sharedComponentTuple = sharedComponentTuples.Single(t => t.Id.Id == "Shared.dll");
575 Assert.True(sharedComponentTuple.Shared);
576 }
577 }
578
579 [Fact]
543 public void CanBuildSetProperty() 580 public void CanBuildSetProperty()
544 { 581 {
545 var folder = TestData.Get(@"TestData\SetProperty"); 582 var folder = TestData.Get(@"TestData\SetProperty");
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFile/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFile/PackageComponents.wxs
index e26c4509..b8e9f59c 100644
--- a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFile/PackageComponents.wxs
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFile/PackageComponents.wxs
@@ -1,10 +1,13 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> 2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment> 3 <Fragment>
4 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 4 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
5 <Component> 5 <Component>
6 <File Source="test.txt" /> 6 <File Source="test.txt" />
7 </Component> 7 </Component>
8 </ComponentGroup> 8 <Component Id="Shared.dll" Shared="yes">
9 </Fragment> 9 <File Name="Shared.dll" Source="test.txt" />
10 </Component>
11 </ComponentGroup>
12 </Fragment>
10</Wix> 13</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs
index c52fa68f..391b7021 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs
@@ -50,7 +50,7 @@ namespace WixToolsetTest.CoreIntegration
50 var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"obj\test.wir")); 50 var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"obj\test.wir"));
51 var section = intermediate.Sections.Single(); 51 var section = intermediate.Sections.Single();
52 52
53 var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); 53 var wixFile = section.Tuples.OfType<WixFileTuple>().First();
54 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); 54 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
55 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); 55 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
56 } 56 }
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs
index 532f158d..07044a1f 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs
@@ -50,7 +50,7 @@ namespace WixToolsetTest.CoreIntegration
50 var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"obj\test.wir")); 50 var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"obj\test.wir"));
51 var section = intermediate.Sections.Single(); 51 var section = intermediate.Sections.Single();
52 52
53 var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); 53 var wixFile = section.Tuples.OfType<WixFileTuple>().First();
54 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); 54 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
55 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); 55 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
56 } 56 }