Skip processing missing FeatureComponents table.
Fixes https://github.com/wixtoolset/issues/issues/7472.
Bob Arnson committed
May 15, 2023 at 21:05 UTC
506cc6ec5075a7d7e9267f571d85ce5e63d1616f
8 files changed
+55
-1
src/wix/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs
+1
-1
@@ -379,7 +379,7 @@ namespace WixToolset.Core.Burn.Bundles
379
380
private void CreateMsiFeatures(Database db)
381
{
382
- if (db.TableExists("Feature"))
382
+ if (db.TableExists("Feature") && db.TableExists("FeatureComponents"))
383
{
384
using (var allFeaturesView = db.OpenExecuteView("SELECT * FROM `Feature`"))
385
using (var featureView = db.OpenView("SELECT `Component_` FROM `FeatureComponents` WHERE `Feature_` = ?"))
src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
+28
@@ -811,5 +811,33 @@ namespace WixToolsetTest.CoreIntegration
811
Assert.False(true, "Expected exception not accepted.");
812
}
813
}
814
+
815
+ [Fact]
816
+ public void CanBuildBundleWithMsiPackageWithoutComponents()
817
+ {
818
+ var folder = TestData.Get(@"TestData\BundleWithComponentlessPackage");
819
+
820
+ using (var fs = new DisposableFileSystem())
821
+ {
822
+ var baseFolder = fs.GetFolder();
823
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
824
+
825
+ var result = WixRunner.Execute(new[]
826
+ {
827
+ "build",
828
+ Path.Combine(folder, "Bundle.wxs"),
829
+ "-loc", Path.Combine(folder, "Bundle.en-us.wxl"),
830
+ "-bindpath", Path.Combine(folder, "data"),
831
+ "-intermediateFolder", intermediateFolder,
832
+ "-o", Path.Combine(baseFolder, @"bin\test.exe")
833
+ });
834
+
835
+ result.AssertSuccess();
836
+
837
+ Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.exe")));
838
+ Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb")));
839
+ }
840
+ }
841
+
842
}
843
}
src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithComponentlessPackage/Bundle.en-us.wxl
new
+11
@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+
3
+<!--
4
+This file contains the declaration of all the localizable strings.
5
+-->
6
+<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
7
+
8
+ <String Id="BundleName" Value="~TestBundle" />
9
+ <String Id="BundleInProgressName" Value="~InProgressTestBundle" />
10
+
11
+</WixLocalization>
src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithComponentlessPackage/Bundle.wxs
new
+12
@@ -0,0 +1,12 @@
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2
+ <Bundle Name="!(loc.BundleName)" InProgressName="!(loc.BundleInProgressName)" Version="!(bind.packageVersion.test.msi)" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
3
+ <BootstrapperApplication>
4
+ <BootstrapperApplicationDll SourceFile="fakeba.dll" />
5
+ </BootstrapperApplication>
6
+ <Chain>
7
+ <MsiPackage SourceFile="test.msi">
8
+ <MsiProperty Name="TEST" Value="1" />
9
+ </MsiPackage>
10
+ </Chain>
11
+ </Bundle>
12
+</Wix>
src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithComponentlessPackage/data/MsiPackage/Shared.dll
new
+1
@@ -0,0 +1 @@
1
+This is Shared.dll.
\ No newline at end of file
src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithComponentlessPackage/data/MsiPackage/test.txt
new
+1
@@ -0,0 +1 @@
1
+This is test.txt
\ No newline at end of file
src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithComponentlessPackage/data/fakeba.dll
new
+1
@@ -0,0 +1 @@
1
+This is a fakeba.dll
\ No newline at end of file
src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithComponentlessPackage/data/test.msi
Binary files /dev/null and b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithComponentlessPackage/data/test.msi differ