Greetings,

The following excerpt of a Wix file is supposed to install, stop, start, and 
uninstall a service (exact names have been tweaked):

      <Component Id='MySvc'
                 Guid="5E7A07C7-9299-4992-A601-EBB79D441A83"
                 Win64='$(var.Win64)'>

        <File Id='MySvcExe'
              Source='$(var.TARGET_DIR)\$(var.MY_SERVICE_OUTPUT_NAME)'
              KeyPath='yes' Checksum='yes'/>

        <ServiceInstall Id="InstallMySvc"
                        Name="$(var.MY_SERVICE_SVC_NAME)"
                        DisplayName="$(var.MY_SERVICE_DISPLAY_NAME)"
                        Type="ownProcess"
                        Start="auto"
                        Arguments="/install"
                        ErrorControl="normal"
                        Description="$(var.MY_SERVICE_DESCRIPTION)"
                        Account="[SERVICEACCOUNT]"
                        Password="[SERVICEPASSWORD]" />
        <ServiceControl Id="StartMySvc"
                        Name="$(var.MY_SERVICE_SVC_NAME)"
                        Start="install"
                        Wait="yes" />
        <ServiceControl Id="StopMySvcSvc"
                        Name="$(var.MY_SERVICE_SVC_NAME)"
                        Stop="both"
                        Wait="yes" />
        <ServiceControl Id="UninstallMySvcSvc"
                        Name="$(var.MY_SERVICE_SVC_NAME)"
                        Remove="uninstall" >
          <ServiceArgument>/uninstall</ServiceArgument>
        </ServiceControl>
      </Component>

I'm trying to install the resulting .MSI with the following command:

msiexec /norestart /lvx*+ mysvc.log /i mysvc.msi

The install fails and msiexec reports via GUI that the service failed to start. 
 Part of the log shows this:

MSI (s) (2C:D8) [13:17:05:419]: Executing op: RegCreateKey()
MSI (s) (2C:D8) [13:17:05:419]: Executing op: 
ActionStart(Name=InstallServices,Description=Installing new 
services,Template=Service: [2])
MSI (s) (2C:D8) [13:17:05:419]: Executing op: 
ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (2C:D8) [13:17:05:419]: Executing op: 
ServiceInstall(Name=My-Svc,DisplayName=My Svc,ImagePath="C:\Program 
Files\My\My-Svc.exe" 
/install,ServiceType=16,StartType=2,ErrorControl=1,,Dependencies=[~],,,Password=**********,Description=My
 Backup Service,,)
MSI (s) (2C:D8) [13:17:06:060]: Executing op: 
ActionStart(Name=RollbackServiceConfig,,)
MSI (s) (2C:D8) [13:17:06:060]: Executing op: 
CustomActionSchedule(Action=RollbackServiceConfig,ActionType=3329,Source=BinaryData,Target=RollbackServiceConfig,CustomActionData=SchedServiceConfig)
MSI (s) (2C:D8) [13:17:06:060]: Executing op: 
ActionStart(Name=ExecServiceConfig,,)
MSI (s) (2C:D8) [13:17:06:060]: Executing op: 
CustomActionSchedule(Action=ExecServiceConfig,ActionType=3073,Source=BinaryData,Target=ExecServiceConfig,CustomActionData=SchedServiceConfigEURMy-SvcEUR0EURrestartEURrestartEURnoneEUR1EUR60EUREUR)
MSI (s) (2C:D8) [13:17:06:060]: Creating MSIHANDLE (8) of type 790536 for 
thread 1496
MSI (s) (2C:34) [13:17:06:060]: Invoking remote custom action. DLL: 
C:\Windows\Installer\MSIC5E2.tmp, Entrypoint: ExecServiceConfig
MSI (s) (2C:20) [13:17:06:060]: Generating random cookie.
MSI (s) (2C:20) [13:17:06:075]: Created Custom Action Server with PID 784 
(0x310).
MSI (s) (2C:78) [13:17:06:091]: Running as a service.
MSI (s) (2C:78) [13:17:06:091]: Hello, I'm your 32bit Elevated custom action 
server.
MSI (s) (2C!B8) [13:17:06:263]: Creating MSIHANDLE (9) of type 790531 for 
thread 3000
MSI (s) (2C!B8) [13:17:06:263]: Closing MSIHANDLE (9) of type 790531 for thread 
3000
MSI (s) (2C:34) [13:17:06:263]: Closing MSIHANDLE (8) of type 790536 for thread 
1496
MSI (s) (2C:D8) [13:17:06:263]: Executing op: 
ActionStart(Name=StartServices,Description=Starting services,Template=Service: 
[1])
MSI (s) (2C:D8) [13:17:06:263]: Executing op: 
ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (2C:D8) [13:17:06:263]: Executing op: 
ServiceControl(,Name=My-Svc,Action=1,Wait=1,)
MSI (s) (2C:D8) [13:17:36:310]: Note: 1: 2205 2:  3: Error
MSI (s) (2C:D8) [13:17:36:310]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` 
FROM `Error` WHERE `Error` = 1920
MSI (c) (FC:38) [13:17:36:310]: Font created.  Charset: Req=0, Ret=0, Font: 
Req=MS Shell Dlg, Ret=MS Shell Dlg

Error 1920. Service 'My Svc' (My-Svc) failed to start.  Verify that you have 
sufficient privileges to start system services.
MSI (s) (2C:D8) [13:17:49:482]: Note: 1: 2205 2:  3: Error
MSI (s) (2C:D8) [13:17:49:482]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` 
FROM `Error` WHERE `Error` = 1709
MSI (s) (2C:D8) [13:17:49:482]: Product: My (64-bit) -- Error 1920. Service 'My 
Svc' (My-Svc) failed to start.  Verify that you have sufficient privileges to 
start system services.

MSI (s) (2C:D8) [13:18:19:482]: Note: 1: 2205 2:  3: Error
MSI (s) (2C:D8) [13:18:19:482]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` 
FROM `Error` WHERE `Error` = 1920
MSI (c) (FC:38) [13:18:19:482]: Font created.  Charset: Req=0, Ret=0, Font: 
Req=MS Shell Dlg, Ret=MS Shell Dlg

Error 1920. Service 'My Svc' (My-Svc) failed to start.  Verify that you have 
sufficient privileges to start system services.
MSI (s) (2C:F0) [13:18:21:216]: I/O on thread 1796 could not be cancelled. 
Error: 1168

Even with all information being logged, there still isn't enough to determine 
the problem.

When I don't abort the install and the files are copied into their final 
resting places, I can execute the following commands without any errors:

                My-Svc.exe /install
                sc start My-Svc

So it must be something wrong with the Wix file.  Any clues why the service 
fails to start?  Any tips, references, resources, links useful for debugging 
service installs using Wix?

Any and all help appreciated.

Eric.

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to