Quantcast

MSI 5.0 ServiceConfigFailureActions fails during InstallExecuteSequence

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MSI 5.0 ServiceConfigFailureActions fails during InstallExecuteSequence

Nick Ramirez

Hi everyone. I was trying out the ServiceConfigFailureActions element to be tried out on Windows 7. However, I keep getting an error that says I either don't have the right permissions or that there's something wrong with the package. There's another thread with the same problem (http://www.mail-archive.com/wix-users@.../msg30451.html), but it doesn't look like it was ever resolved. I've tried a lot of combinations of attributes, but nothing seems to make a difference. (As a side note, I had to suppress ICE27 to compile it, but I think that's a different story.) Here is my code:

<Component Id="cmp_testService1" Guid="F1EE44AC-56FD-46f0-A79A-78B9E603779B">
            <File
                   Id="TestService1"
                   Source="WindowsService1.exe"
                   KeyPath="yes" />

            <ServiceInstall
                   Id="InstallWindowsService1"
                   Type="ownProcess"
                   Description="Does test service"
                   ErrorControl="normal"
                   Name="testsvc"
                   DisplayName="Test Service"
                   Start="auto">

                 <ServiceConfigFailureActions
                        Id="configTestSvc"
                        OnInstall="yes"
                        ResetPeriod="60">

                        <Failure Action="restartService" Delay="2000" />
                 </ServiceConfigFailureActions>

                <ServiceConfig Id="configTS" OnInstall="yes" FailureActionsWhen="1" />

          </ServiceInstall>
 </Component>



I included a ServiceConfig element too because I didn't know if that was needed too. It doesn't seem to fix the problem though. Here is a log from the install (just the failure part):

InstallServices: Service:
MSI (s) (DC:20) [02:45:06:517]: Executing op: ActionStart(Name=MsiConfigureServices,,)
Action 2:45:06: MsiConfigureServices.
MSI (s) (DC:20) [02:45:06:517]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (DC:20) [02:45:06:517]: Executing op: ServiceConfigure(,Name=testsvc,Event=1,ConfigType=4,Argument=1)
MSI (s) (DC:20) [02:45:06:517]: Changing configuration of service testsvc.
MSI (s) (DC:20) [02:45:06:517]: Changed configuration of service testsvc with ConfigType SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
MSI (s) (DC:20) [02:45:06:517]: Done changing configuration of service testsvc
MSI (s) (DC:20) [02:45:06:517]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (DC:20) [02:45:06:527]: Executing op: ServiceConfigureFailureAction(,Name=testsvc,Event=1,ResetPeriod=60,RebootMessage=[~],Command=[~],Actions=1,DelayActions=2000)
MSI (s) (DC:20) [02:45:06:527]: Changing configuration of failure action for service testsvc.
MSI (s) (DC:20) [02:45:06:527]: Error: 5. Failed to change current configuration of failure action for service testsvc
MSI (s) (DC:20) [02:45:06:527]: Failed to change configuration of failure action for service testsvc
MSI (s) (DC:20) [02:45:06:527]: Note: 1: 2205 2:  3: Error
MSI (s) (DC:20) [02:45:06:527]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1939
Error 1939. Service 'Test Service' (testsvc) could not be configured.  This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.
MSI (s) (DC:20) [02:45:08:651]: Note: 1: 2205 2:  3: Error
MSI (s) (DC:20) [02:45:08:651]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (DC:20) [02:45:08:651]: Product: Amazing Software -- Error 1939. Service 'Test Service' (testsvc) could not be configured.  This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.

Action ended 2:45:08: InstallFinalize. Return value 3.



Thanks!

Nick Ramirez



     
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/196390706/direct/01/
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MSI 5.0 ServiceConfigFailureActions fails during InstallExecuteSequence

Nick Ramirez
I've found, as another post has pointed out, that you CAN use the failure action "runCommand". This works fine. However, using either "restartComputer" or "restartService" gives the permission error.

Using processmon, http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx, I can see the Registry keys being accessed and written to at the time the MSI fails. Interestingly, when it fails, it doesn't appear that the MSI is writing the service failure values like it should.

I'm running this as an Administrator and other values are being written to that key (service name, description, etc.). So, I don't think there's something wrong with my permissions or the way the MSI package is written. I think there might be something genuinely wrong with the way MSI 5.0 handles writing failure recovery settings for Windows services.

Here are the Registry actions as captured by processmon:

This worked (when I set the failure action to "runCommand" -- it's supposed to run a script at C:\script.cmd.

--------------------------------------
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS Desired Access: Read/Write
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\ImagePath SUCCESS Type: REG_EXPAND_SZ, Length: 122, Data: "C:\Program Files\MySoftware\WindowsService1.exe"
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage NAME NOT FOUND Length: 268
RegDeleteValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage NAME NOT FOUND
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand NAME NOT FOUND Length: 268
RegSetValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand SUCCESS Type: REG_SZ, Length: 22, Data: script.cmd
RegSetValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions SUCCESS Type: REG_BINARY, Length: 28, Data: 3C 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00
RegFlushKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
------------------------------------


However, this, where I tried to restart the service at failure, did not work:

-------------------------------------
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS Desired Access: Read/Write
RegFlushKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
------------------------------------------------------

Nick Ramirez
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [WiX-users] MSI 5.0 ServiceConfigFailureActions fails during InstallExecuteSequence

Wilson, Phil
I'm just speculating here, but permissions might be an issue because administrators don't always have every right automatically assigned and enabled. Having the "Log on as a service" privilege might be relevant if you're changing service configurations (admins don't get that by default IIRC). It's interesting that the failing ones would cause a reboot, and that might also be a missing right like SE_SHUTDOWN_NAME.

Phil Wilson

-----Original Message-----
From: Nick Ramirez [mailto:[hidden email]]
Sent: Wednesday, January 27, 2010 12:30 PM
To: [hidden email]
Subject: Re: [WiX-users] MSI 5.0 ServiceConfigFailureActions fails during InstallExecuteSequence


I've found, as another post has pointed out, that you CAN use the failure
action "runCommand". This works fine. However, using either
"restartComputer" or "restartService" gives the permission error.

Using processmon,
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx, I can see the
Registry keys being accessed and written to at the time the MSI fails.
Interestingly, when it fails, it doesn't appear that the MSI is writing the
service failure values like it should.

I'm running this as an Administrator and other values are being written to
that key (service name, description, etc.). So, I don't think there's
something wrong with my permissions or the way the MSI package is written. I
think there might be something genuinely wrong with the way MSI 5.0 handles
writing failure recovery settings for Windows services.

Here are the Registry actions as captured by processmon:

This worked (when I set the failure action to "runCommand" -- it's supposed
to run a script at C:\script.cmd.

--------------------------------------
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read/Write
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\ImagePath
SUCCESS Type: REG_EXPAND_SZ, Length: 122, Data: "C:\Program
Files\MySoftware\WindowsService1.exe"
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegDeleteValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegSetValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
SUCCESS Type: REG_SZ, Length: 22, Data: script.cmd
RegSetValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
SUCCESS Type: REG_BINARY, Length: 28, Data: 3C 00 00 00 01 00 00 00 01 00
00 00 01 00 00 00
RegFlushKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
------------------------------------


However, this, where I tried to restart the service at failure, did not
work:

-------------------------------------
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read/Write
RegFlushKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
------------------------------------------------------

Nick Ramirez
--
View this message in context: http://n2.nabble.com/MSI-5-0-ServiceConfigFailureActions-fails-during-InstallExecuteSequence-tp4452709p4469530.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users



*** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at Portland House, Bressenden Place, London, SW1E 5BF (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 7821 3848 or e-mail [hidden email]. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates).



------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [WiX-users] MSI 5.0 ServiceConfigFailureActions fails during InstallExecuteSequence

Nick Ramirez
It's possible that it could be a permissions issue, but it doesn't seem to be. After changing the local security policy to give the Administrator account the "log on as a service" account, the same behavior remained. I didn't see any other privileges that seemed to suggest that they'd specifically affect service configuration, either.

When logged on as Administrator, I am able to change the failure recovery settings of the service with sc.exe failure. As far as I can tell, the MSI package runs with the privileges of the user who installs it. So, I would think it would work the same as using sc.exe.

I don't know if the Wix Util extension's ServiceConfig element works with a different set of permissions, but using it I am able to set all three failure actions -- "restart", "reboot" and "runCommand".

So, it seems to be an issue isolated to MSI 5.0's ServiceConfigFailureActions element, but only when using either the "restart" or "reboot" actions. And even with all of the permissions I can think to give, those actions don't complete successfully.

Nick

Wilson, Phil wrote
I'm just speculating here, but permissions might be an issue because administrators don't always have every right automatically assigned and enabled. Having the "Log on as a service" privilege might be relevant if you're changing service configurations (admins don't get that by default IIRC). It's interesting that the failing ones would cause a reboot, and that might also be a missing right like SE_SHUTDOWN_NAME.

Phil Wilson

-----Original Message-----
From: Nick Ramirez [mailto:nickram44@hotmail.com]
Sent: Wednesday, January 27, 2010 12:30 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] MSI 5.0 ServiceConfigFailureActions fails during InstallExecuteSequence


I've found, as another post has pointed out, that you CAN use the failure
action "runCommand". This works fine. However, using either
"restartComputer" or "restartService" gives the permission error.

Using processmon,
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx, I can see the
Registry keys being accessed and written to at the time the MSI fails.
Interestingly, when it fails, it doesn't appear that the MSI is writing the
service failure values like it should.

I'm running this as an Administrator and other values are being written to
that key (service name, description, etc.). So, I don't think there's
something wrong with my permissions or the way the MSI package is written. I
think there might be something genuinely wrong with the way MSI 5.0 handles
writing failure recovery settings for Windows services.

Here are the Registry actions as captured by processmon:

This worked (when I set the failure action to "runCommand" -- it's supposed
to run a script at C:\script.cmd.

--------------------------------------
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read/Write
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\ImagePath
SUCCESS Type: REG_EXPAND_SZ, Length: 122, Data: "C:\Program
Files\MySoftware\WindowsService1.exe"
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegDeleteValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegSetValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
SUCCESS Type: REG_SZ, Length: 22, Data: script.cmd
RegSetValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
SUCCESS Type: REG_BINARY, Length: 28, Data: 3C 00 00 00 01 00 00 00 01 00
00 00 01 00 00 00
RegFlushKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
------------------------------------


However, this, where I tried to restart the service at failure, did not
work:

-------------------------------------
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureActions
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\RebootMessage
NAME NOT FOUND Length: 268
RegQueryValue HKLM\System\CurrentControlSet\services\testsvc\FailureCommand
NAME NOT FOUND Length: 268
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegOpenKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
Desired Access: Read/Write
RegFlushKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
RegCloseKey HKLM\System\CurrentControlSet\services\testsvc SUCCESS
------------------------------------------------------

Nick Ramirez
--
View this message in context: http://n2.nabble.com/MSI-5-0-ServiceConfigFailureActions-fails-during-InstallExecuteSequence-tp4452709p4469530.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



*** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at Portland House, Bressenden Place, London, SW1E 5BF (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 7821 3848 or e-mail inet.hqhelpdesk@invensys.com. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates).



------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
Loading...