tlen
Posts: 2
Joined: Fri Jun 28, 2019 10:57 pm

Update service without changing its logon details

I have an application that installs a service. By default, the service account is local system, but the user can change it after installation if they wish. When upgrading to a new version, the service is reinstalled. We want to preserve the login details that the user set, we don't want it to be changed back to local system. How can this be accomplished?
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Update service without changing its logon details

Hello and welcome to Advanced Installer forums,

I am afraid that this is not possible in the scenario where the user changes the User & Password details after the installation. However, it is possible to do that if they change this during the installation.

For instance, you can have a dialog where you ask the user to input the following data: the user for which the service will be installed and the password.

These two inputs will be saved in two different properties. These two properties will have their attribute set to persistent.

Please have a look on the following articles which I think you will find useful:

- How to install a service for a custom user

- How do I make the properties in the package keep their values during Maintenance or Upgrade?

Beside what is said above, in order to receive the input from the user (in what regards the Username & password for the service), a new dialog will be needed. Please have a look on the following article for more information about this:

- Adding a custom dialog

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tlen
Posts: 2
Joined: Fri Jun 28, 2019 10:57 pm

Re: Update service without changing its logon details

Thank you. What we ended up doing turned out to be much simpler. Now, when upgrading, we don't delete and reinstall the service. This way the service is left intact (only the corresponding exe changes), so the service credentials remain as the user set it. Finally, if the product is uninstalled (real uninstall, not uninstall for upgrade), we use a custom action to remove the service.
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Update service without changing its logon details

Hello,

Thank you for your followup on this and for sharing your solution with us. I am sure this will be of help for further users facing a similar scenario.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”