-
I converted a WiX 3.11 project to WiX 4.0 and I got the following error when I tried to compile:
I believe this error should not exist because the WixUtilExtension ServiceConfig element is not a replacement for the ServiceConfig element, it is a replacement for the ServiceConfigFailureActions element. It is true that the MsiConfigServices Action does have a warning that states:
That warning is probably accurate but take note that it is talking about setting up Recovery Actions being enabled by MsiServiceConfigFailureActions, not MsiServiceConfig which enables some other stuff like service delay auto start, SIDs, pre shutdown delay, and failure actions which are not enabled by util:ServiceConfig. From the following snippet which uses ServiceConfig, ServiceConfigFailureActions, and util:ServiceConfig you can see that there are attributes of ServiceConfig that do not have a counterpart in util:ServiceConfig and many attributes in ServiceConfigFailureActions that do have counterparts in util:ServiceConfig. <ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall="yes" OnUninstall="no" PreShutdownDelay="30000"
FailureActionsWhen="failedToStopOrReturnedError" ServiceSid="SERVICE_SID_TYPE_RESTRICTED">
<RequiredPrivilege>SE_AUDIT_NAME</RequiredPrivilege>
</ServiceConfig>
<ServiceConfigFailureActions OnInstall="yes" OnReinstall="yes" OnUninstall="no"
RebootMessage="Service failed. Rebooted!" Command="log.exe 'Service Failure!'"
ResetPeriod="86400">
<Failure Action="restartService" Delay="60" />
<Failure Action="restartComputer" Delay="120" />
<Failure Action="runCommand" Delay="180" />
</ServiceConfigFailureActions>
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="reboot" ThirdFailureActionType="runCommand"
RebootMessage="Service failed. Rebooted!" ProgramCommandLine="log.exe 'Service Failure!'"
ResetPeriodInDays="1" RestartServiceDelayInSeconds="60" /> In short, using the ServiceConfig element should not generate an error. It is possible using the ServiceConfigFailureActions element should generate an error as its functionality seems to be handled by util:ServiceConfig. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
It turned out that I had I still think that using ServiceConfig should not be warned against if you are using it for supported and working functionality without an alternative in util:ServiceConfig. |
Beta Was this translation helpful? Give feedback.
It turned out that I had
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
in the project file which made the WIX1149 warning an error. I removed TreatWarningsAsErrors and suppressed warning 1149. Now the code compiles (aside from other unrelated errors).I still think that using ServiceConfig should not be warned against if you are using it for supported and working functionality without an alternative in util:ServiceConfig.