diff options
author | Rob Mensching <rob@firegiant.com> | 2023-01-12 11:39:43 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2023-01-12 12:47:53 -0800 |
commit | e3b4af31d93962a7bd0a417d400921e00e9e249a (patch) | |
tree | c87e10b3487464f3e539a1e632fc2ba9b76b99da /src/ext | |
parent | bcb75416e20cc16d85fc2c0e44a8fd78449f3b3c (diff) | |
download | wix-e3b4af31d93962a7bd0a417d400921e00e9e249a.tar.gz wix-e3b4af31d93962a7bd0a417d400921e00e9e249a.tar.bz2 wix-e3b4af31d93962a7bd0a417d400921e00e9e249a.zip |
Fix compiler to handle util:ServiceConfig absent reset period and start delay
Fixes 7150
Diffstat (limited to 'src/ext')
3 files changed, 46 insertions, 2 deletions
diff --git a/src/ext/Util/test/WixToolsetTest.Util/TestData/ServiceConfig/Package.wxs b/src/ext/Util/test/WixToolsetTest.Util/TestData/ServiceConfig/Package.wxs new file mode 100644 index 00000000..0e7cc42b --- /dev/null +++ b/src/ext/Util/test/WixToolsetTest.Util/TestData/ServiceConfig/Package.wxs | |||
@@ -0,0 +1,27 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
2 | xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
3 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
4 | <MajorUpgrade DowngradeErrorMessage="A downgrade error message." /> | ||
5 | |||
6 | <Feature Id="ProductFeature" Title="A feature title"> | ||
7 | <ComponentGroupRef Id="ProductComponents" /> | ||
8 | </Feature> | ||
9 | </Package> | ||
10 | |||
11 | <Fragment> | ||
12 | <StandardDirectory Id="ProgramFilesFolder"> | ||
13 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
14 | </StandardDirectory> | ||
15 | </Fragment> | ||
16 | |||
17 | <Fragment> | ||
18 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
19 | <Component> | ||
20 | <File Name="notanexe.exe" Source="Package.wxs" /> | ||
21 | <ServiceInstall Name="svc" Start="demand" Type="ownProcess" ErrorControl="normal"> | ||
22 | <util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" /> | ||
23 | </ServiceInstall> | ||
24 | </Component> | ||
25 | </ComponentGroup> | ||
26 | </Fragment> | ||
27 | </Wix> | ||
diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 18bb2c7d..2b59b2a9 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |||
@@ -171,6 +171,23 @@ namespace WixToolsetTest.Util | |||
171 | } | 171 | } |
172 | 172 | ||
173 | [Fact] | 173 | [Fact] |
174 | public void CanBuildServiceConfig() | ||
175 | { | ||
176 | var folder = TestData.Get(@"TestData", "ServiceConfig"); | ||
177 | var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }, "test.msi"); | ||
178 | |||
179 | var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "ServiceConfig", "Wix4ServiceConfig"); | ||
180 | WixAssert.CompareLineByLine(new[] | ||
181 | { | ||
182 | "Binary:Wix4UtilCA_X64\t[Binary data]", | ||
183 | "CustomAction:Wix4ExecServiceConfig_X64\t3073\tWix4UtilCA_X64\tExecServiceConfig\t", | ||
184 | "CustomAction:Wix4RollbackServiceConfig_X64\t3329\tWix4UtilCA_X64\tRollbackServiceConfig\t", | ||
185 | "CustomAction:Wix4SchedServiceConfig_X64\t1\tWix4UtilCA_X64\tSchedServiceConfig\t", | ||
186 | "Wix4ServiceConfig:svc\tfilPeUUVRrj2.Q_YcmN55mro4H1aQY\t1\trestart\trestart\trestart\t\t\t\t", | ||
187 | }, results.OrderBy(s => s).ToArray()); | ||
188 | } | ||
189 | |||
190 | [Fact] | ||
174 | public void CanBuildWithEventManifest() | 191 | public void CanBuildWithEventManifest() |
175 | { | 192 | { |
176 | var folder = TestData.Get(@"TestData\EventManifest"); | 193 | var folder = TestData.Get(@"TestData\EventManifest"); |
diff --git a/src/ext/Util/wixext/UtilCompiler.cs b/src/ext/Util/wixext/UtilCompiler.cs index c2ae5c94..9249f74a 100644 --- a/src/ext/Util/wixext/UtilCompiler.cs +++ b/src/ext/Util/wixext/UtilCompiler.cs | |||
@@ -3072,8 +3072,8 @@ namespace WixToolset.Util | |||
3072 | var newService = false; | 3072 | var newService = false; |
3073 | string programCommandLine = null; | 3073 | string programCommandLine = null; |
3074 | string rebootMessage = null; | 3074 | string rebootMessage = null; |
3075 | var resetPeriod = CompilerConstants.IntegerNotSet; | 3075 | int? resetPeriod = null; |
3076 | var restartServiceDelay = CompilerConstants.IntegerNotSet; | 3076 | int? restartServiceDelay = null; |
3077 | string secondFailureActionType = null; | 3077 | string secondFailureActionType = null; |
3078 | string serviceName = null; | 3078 | string serviceName = null; |
3079 | string thirdFailureActionType = null; | 3079 | string thirdFailureActionType = null; |