Preserve Service Logon Information for upgrade - Advanced Installer Community
Jimmy
Posts: 36
Joined: Thu Apr 12, 2012 1:13 pm

Preserve Service Logon Information for upgrade

Hi

Is ist possible to create a setup, where it is possible to select if the installed service should be run as LocalSystem or DOMAIN\ServiceUser directly?

Is it also possible to preserve the service's configuration and logon information in upgrade case? (so I don't have to ask again for username / password for the service logon)

Thanks in advance
Jimmy
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Preserve Service Logon Information for upgrade

Hi Jimmy

If no username is set for the service, it will run in the LocalSystem account. Else it is very well explained in the following article How to install a service for a custom user?

If you want to preserve the logon information you must check the "Set persistent property" checkbox for the SERVICE_USER and SERVICE_PASSWORD properties you created. You can also set the "Secure property" option for it in order to encrypt its value.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Jimmy
Posts: 36
Joined: Thu Apr 12, 2012 1:13 pm

Re: Preserve Service Logon Information for upgrade

Hello Eusebiu

Thanks for your answer.

I tried to set the service logon to a property, which is not set, if no user logon is selected (I assume it was AI 9.2 or so...)
It didn't work, I have to overcome by using a custom action, which configures the service using SC.EXE to use a user logon.
However, now, I tried it again, and I assume, while my last try, I did something completely wrong while combining the domain and the logon name.

The idea to use a persistent property for the service logon credentials is not practicable:
Let's assume, the IT engineer of the customer changes the service user, and / or its password, and configure it directly in the services.msc.
--> after upgrading, the service would not run anymore, 'cause those logon informations are not valid anymore.
(disregarding the fact, that an audit will not be successfull, if logon properties are stored in the registry, in cleartext...)

I will try to find a solution to back up service configuration and come back, if I foud something.
I don't think, I'm the only one, struggling with services and their configuration / logon..

Best regards and many thanks
Jimmy
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Preserve Service Logon Information for upgrade

Hi Jimmy

In case you want to run your service as LocalSystem, you must use a custom action as you already did, I think.

Else, it is not supported by Advanced Installer to keep the username and password, when they are modified directly in the services.msc. This situation is similar to the case when someone deletes some files from the installation folder and can not be treated.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
NZer
Posts: 3
Joined: Sun Aug 03, 2014 2:02 am

Re: Preserve Service Logon Information for upgrade

Hi

Has Advanced Installer been improved since this thread was last updated?

In my scenario the service needs to be configured by the customers IT department (Network logon for Proxy etc),
When the re seller comes along and does an upgrade, they do not know the password, so the upgrade breaks the product. ( typically in the middle of the night when the customer cannot be contacted). In the ideal world people would remember and the customer would be told to be available during the upgrade to re enter the password. ( which is also not that great!)

Would it be possible to set the 'service' component to not be updated ( in Organisational view) and then have a custom action stop the service replace the files and then restart the service at the end ?

Thanks

Rob
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Preserve Service Logon Information for upgrade

Hi Rob and welcome to Advanced Installer forums.

It seems that Jimmy's scenario was a little bit different than your and we did not make the improvement he asked because this is not possible.

If you want not to update the service component, you can go in the "Organization" page and set the "Permanent" option for it. Also, you should uncheck the "Delete" option that is available in the "Control Operation" view from the "Services" page. Then you can create one or more custom actions that replace the files and restart the service. However, I'm afraid that if the service is still installed, you will not be allowed to replace its source files.

Another approach would be to create a custom action that encrypts the password and writes it to the registry, then, during the upgrade, gets the password from the registry, decrypts it and use it to install the service.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
NZer
Posts: 3
Joined: Sun Aug 03, 2014 2:02 am

Re: Preserve Service Logon Information for upgrade

Thanks Eusebiu!

Not sure the customer would be happy to have the password in the registry ( even encrypted) some of my customers are banks and tax organisations types who are very particular about security.

I'm was a little confused with your statement
"However, I'm afraid that if the service is still installed, you will not be allowed to replace its source files."
But I think I have worked it out.. because the upgrade first runs the uninstall which uses the uninstall settings of the original installer? .. .. hmmmm so it would only be for future upgrades beyond the next.

Maybe for in this installer I could check "if the the service exists and is NOT using LocalSystem account "Then I could provide a dialog warning the installer before the uninstall starts? That should be as simple as checking the service reg 'ObjectName' value? Can that be done without need custom actions. ( If Reg value exists, provide a dialog with text and a option to quit the install)

Oh and I tried copying the registry ( including security binaries) of the service and replacing it afterwards.. but the encryption is obviously a bit more complex than that! :lol:

Many thanks for your assistance.
NZer
Posts: 3
Joined: Sun Aug 03, 2014 2:02 am

Re: Preserve Service Logon Information for upgrade

No need to answer, I have it all working..

Many thanks!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Preserve Service Logon Information for upgrade

You're welcome Rob. I'm glad you got this working.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”