From a6daf710eac9219e512c625b8fc03bee9172ad35 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 9 Feb 2023 06:41:08 -0800 Subject: Fix the handling of ServiceConfig and ServiceConfigFailureActions Fixes 7198 --- .../Bind/CreateWindowsInstallerDataFromIRCommand.cs | 4 ++-- src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | 7 +++++-- .../TestData/ServiceInstall/OwnProcess.wxs | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs index 49ae1256..960d298e 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs @@ -780,7 +780,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind events |= symbol.OnReinstall ? WindowsInstallerConstants.MsidbServiceConfigEventReinstall : 0; events |= symbol.OnUninstall ? WindowsInstallerConstants.MsidbServiceConfigEventUninstall : 0; - var row = this.CreateRow(symbol, "MsiServiceConfigFailureActions"); + var row = this.CreateRow(symbol, "MsiServiceConfig"); row[0] = symbol.Id.Id; row[1] = symbol.Name; row[2] = events; @@ -795,7 +795,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind events |= symbol.OnReinstall ? WindowsInstallerConstants.MsidbServiceConfigEventReinstall : 0; events |= symbol.OnUninstall ? WindowsInstallerConstants.MsidbServiceConfigEventUninstall : 0; - var row = this.CreateRow(symbol, "MsiServiceConfig"); + var row = this.CreateRow(symbol, "MsiServiceConfigFailureActions"); row[0] = symbol.Id.Id; row[1] = symbol.Name; row[2] = events; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 92d6286f..52bf9d29 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -727,7 +727,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = Path.Combine(baseFolder, "obj"); var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); - var result = WixRunner.Execute(new[] + var result = WixRunner.Execute(warningsAsErrors: false, new[] { "build", Path.Combine(folder, "ServiceInstall", "OwnProcess.wxs"), @@ -741,9 +741,12 @@ namespace WixToolsetTest.CoreIntegration result.AssertSuccess(); Assert.True(File.Exists(msiPath)); - var results = Query.QueryDatabase(msiPath, new[] { "ServiceInstall", "ServiceControl" }); + var results = Query.QueryDatabase(msiPath, new[] { "ServiceInstall", "ServiceControl", "MsiServiceConfig", "MsiServiceConfigFailureActions" }); WixAssert.CompareLineByLine(new[] { + "MsiServiceConfig:SampleService.DS\tSampleService\t1\t3\t1\ttest.txt", + "MsiServiceConfig:SampleService.SS\tSampleService\t1\t5\t1\ttest.txt", + "MsiServiceConfigFailureActions:SampleService\tSampleService\t1\t120\tRestart required because service failed.\t[~]\t\t\ttest.txt", "ServiceControl:SampleService\tSampleService\t161\t\t1\ttest.txt", "ServiceInstall:SampleService\tSampleService\t\t16\t4\t0\t\t\t\t\t\ttest.txt\t", }, results); diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/ServiceInstall/OwnProcess.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/ServiceInstall/OwnProcess.wxs index 65cba20e..67a45116 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/ServiceInstall/OwnProcess.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/ServiceInstall/OwnProcess.wxs @@ -4,7 +4,10 @@ - + + + + -- cgit v1.2.3-55-g6feb