<ServiceInstall/> will register the service for you. @Arguments should specify
any command line arguments you need to specify when the service starts up.
I guess that you currently have Arguments="/install" because you expect msiexec
to execute your service to register the service. That's not how
<ServiceInstall/> works. <ServiceInstall/> does the work for you (this is the
preferred method). Another guess is that normal service execution does not
require any command line arguments so you should remove @Arguments.
You should not need more than one <ServiceControl/>. You can specify when to
Start, Stop, and Remove all on one <ServiceControl/>.
<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"
ErrorControl="normal"
Description="$(var.MY_SERVICE_DESCRIPTION)"
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]" />
<ServiceControl Id="StartMySvc"
Name="$(var.MY_SERVICE_SVC_NAME)"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes" />
</Component>
This will *not* execute /install nor /uninstall to install and uninstall the
service. Windows Installer will do it for you.
If you really want to execute your service with /install and /uninstall to
install and uninstall then you'll need to schedule a custom action to execute
your service appropriately. I would *highly* discourage this course of action.
Edwin G. Castro
Software Developer - Staff
Digital Channels
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail
> -----Original Message-----
> From: Brad Lemings [mailto:[email protected]]
> Sent: Thursday, May 19, 2011 1:43 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Debugging/Troubleshooting Service Installs
>
> Followup. I have a better idea what the problem is. Either msiexec is not
> "installing" the service by executing it with the proper /install argument or
> it
> is not executing the install command with Administrator privileges.
>
> >From the log, it appears that the /install option is specified so I'm
> >guessing
> the latter case is the real problem although its somewhat inconceivable that
> the ServiceControl element does not imply Administrator privileges.
>
> I'm guessing the Account and Password attributes are the real culprit. Now
> to prove it...
>
> -----Original Message-----
> From: Brad Lemings [mailto:[email protected]]
> Sent: Thursday, May 19, 2011 1:33 PM
> To: General discussion for Windows Installer XML toolset. (wix-
> [email protected])
> Subject: [WiX-users] Debugging/Troubleshooting Service Installs
>
> 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=[~],,,Pas
> sword=**********,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,Sour
> ce=BinaryData,Target=RollbackServiceConfig,CustomActionData=SchedServi
> ceConfig)
> 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=SchedServiceConfi
> gEURMy-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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> ------------------------------------------------------------------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users