Failure to stop a windows service while using Wix Installer on Windows 2012

458 views Asked by At

I have an MSI that stops a running service and upgrades it using Wix 3.7. On windows 2012, I've been randomly getting errors during the install.

This only happens when the service is running which leads me to believe it has something to do with the stopping. When a failure occurs and I hit retry, the install works 100% of the time. Furthermore, I'm only seeing this on win 2012. I've yet to be able to repro this on win 2008.

Here's the code

<ServiceInstall Id="MyServiceInstall" DisplayName="My Service" Description="My Service"     Name="MyService" ErrorControl="normal" Start="auto" Type="ownProcess" Vital="yes">
<ServiceConfig Id="MyServiceConfig" DelayedAutoStart="yes" OnInstall="yes"     OnReinstall="yes" PreShutdownDelay="240000"/>
</ServiceInstall>
<ServiceControl Id="MyServiceControl" Name="MyService" Stop="uninstall"     Remove="uninstall" Wait="yes"/>

Sometimes the errors in the msi logs are:

MSI (s) (BC:FC) [00:54:18:223]: Executing op:  ServiceInstall(Name=MyService,DisplayName=My Service,ImagePath="c:\Program Files\MyCompany\My  Service\myservice.exe",ServiceType=16,StartType=2,ErrorControl=32769,,Dependencies= [~],,,Password=**********,Description=My Service,,)
MSI (s) (BC:FC) [00:54:18:224]: Note: 1: 2205 2:  3: Error 
MSI (s) (BC:FC) [00:54:18:224]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM   `Error` WHERE `Error` = 1923 
MSI (c) (78:2C) [00:54:18:230]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS  Shell Dlg, Ret=MS Shell Dlg

Error 1923. Service 'My Service' (MyService) could not be installed.  Verify that you   have sufficient privileges to install system services.
MSI (s) (BC:FC) [00:54:24:339]: Note: 1: 2205 2:  3: Error 
MSI (s) (BC:FC) [00:54:24:339]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM  `Error` WHERE `Error` = 1709 
MSI (s) (BC:FC) [00:54:24:339]: Product: My Service -- Error 1923. Service 'My Service'   (MyService) could not be installed.  Verify that you have sufficient privileges to install  system services.

and other times I get this:

MSI (s) (6C:D8) [19:35:30:922]: I/O on thread 5784 could not be cancelled. Error: 1168
MSI (s) (6C:D8) [19:35:30:922]: I/O on thread 6784 could not be cancelled. Error: 1168
MSI (s) (6C:D8) [19:35:30:922]: I/O on thread 3652 could not be cancelled. Error: 1168
MSI (s) (6C:D8) [19:35:30:922]: I/O on thread 4804 could not be cancelled. Error: 1168
MSI (s) (6C:D8) [19:35:30:922]: I/O on thread 7000 could not be cancelled. Error: 1168
MSI (s) (6C:D8) [19:35:30:922]: I/O on thread 5080 could not be cancelled. Error: 1168
MSI (s) (6C:D8) [19:35:30:922]: Note: 1: 2205 2:  3: Error 
MSI (s) (6C:D8) [19:35:30:922]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709 

Any ideas on how to solve this?

0

There are 0 answers