Service could not start after upgrade rollback - Advanced Installer Community
tomas.maruska
Posts: 38
Joined: Fri Jul 19, 2013 11:49 am

Service could not start after upgrade rollback

Hello,

I encountered problem to start service, when upgrade falled into rollback:

- We have configured one service in Advanced Installer, where Service Account is filled using properties. (see attached screenshot)
- Password property is set in custom action (named GainPassword), and password is generated (first install) or recovered from register (upgrade). (see attached screenshot)
- Install and Upgrade works OK when ends successfully

But when upgrade fails on another custom action's exception (custom action which is almost last in setup sequence) setup is turned into rollback (which is OK), but after rollback, service is stopped. And when I try to run it from Service list, I get following error:

Windows could not start the MessageBroker service on Local Computer.

Error 1069: The service did not start due to a logon failure.


I noticed, that when I set password by myself in service properties in windows service list, service starts OK. I guess, that rollback somehow change service password during rollback...

Can you tell me, what can I do to start service after rollback (which sometimes happens)?

Regards,

Tomas Maruska
Gamanet a.s.
Attachments
service.PNG
service.PNG (6.59 KiB) Viewed 3447 times
customactions.PNG
customactions.PNG (16.8 KiB) Viewed 3447 times
serviceacc.PNG
serviceacc.PNG (4.9 KiB) Viewed 3447 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service could not start after upgrade rollback

Hello Tomas,

Please keep in mind that during an upgrade the old version of your product is removed and, then the upgraded version is installed. If the upgrade installation fails after the old product version is removed, then during the rollback the old version will not be installed again. The rollback will remove the upgrade installation files and, after the rollback the installation files (of both product versions) will be missing from target machine. However, after the rollback your service should be also deleted from target machine (it should not be visible in Windows Services console - services.msc). Did you encountered a different behavior? If so, can you give us a more detailed test case scenario (maybe exemplify)? Also, can you please please send us the .AIPs (project files of your old and upgraded versions) and a verbose log of the upgrade installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tomas.maruska
Posts: 38
Joined: Fri Jul 19, 2013 11:49 am

Re: Service could not start after upgrade rollback

Hello,

I sent you the project file and log from install and upgrade. To fails upgrade I throws exception in custom action 'ConfigureConnectionStringForMessageBroker'.

I forgot to mention, that we use 'Install new version first and then uninstall old version' upgrade.

We use Advanced Installer 11.3

Best regards,

Tomas Maruska
Gamanet a.s.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service could not start after upgrade rollback

Hello Tomas,

I've tested the scenario and I was able to replicate the behavior. However, this is the default Windows Installer behavior. This happens because you have added for your service "Stop" and "Delete" control operations on install. Please keep in mind that after deleting a service (using a "Delete" control operation) that was installed with a user name and password, the installation process cannot rollback the service without first using a custom action to get the password. The installer can acquire all the necessary information about the service except the password, which is stored in a protected part of the system.

Therefore, you should create a custom action which calls ChangeServiceConfig function (to supply the password) before reinstalling the service on rollback (the custom action should be scheduled right before "Install Execution Stage -> Remove Resources -> DeleteServices" standard action and should run only on rollback).

Also, as another approach you can disable the "Stop" and "Delete" control operations on install for your service and see if the behavior still persist.

If you have any question let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”