schwarzsurfer
Posts: 49
Joined: Wed Feb 10, 2016 11:06 am

Service with created user cannot be started

Hello,

I have a project where I need to create an user during the setup routine. This user is a local administrator account. His password is test123. for example.

I also have to install a service during the installation and link the created user with this service. I entered the name and the password of the created user in the "services to install"\"servicename" tab in Advanced Installer.

When I run the setup, there is shown an error message, that the service could not be started. When I open the windows services console and try to start the service manually, it says, that the login for this service failed. The user is created correctly and entered in the logon field of the service dialogue. But the password seems not to be entered correctly. When I enter the password test123. manually in the windows service dialogue and save the changes, the service can be started - manually from the service dialogue or when I hit "retry" in the error message in the installer.

What am I doing wrong or is this an Advanced Installler bug?

Thanky for help!

Marian
Ich weiß, dass ich nichts weiß!
korr
Posts: 48
Joined: Tue Sep 09, 2014 3:13 pm

Re: Service with created user cannot be started

Did you select "Set Log on as a service policy for selected username" ?
schwarzsurfer
Posts: 49
Joined: Wed Feb 10, 2016 11:06 am

Re: Service with created user cannot be started

I tried both. With this option and without. Same error.
Ich weiß, dass ich nichts weiß!
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service with created user cannot be started

Hello,

Please note that you cannot install and start a service and create a user account from the same installation process. This is because the user account install action is performed after the service install and start actions. To achieve what you need try to create another separate setup which will only create the user account and add this setup as a prerequisite to your service setup. Please take a look on our "Install a service for a user created by your installation package" article.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
schwarzsurfer
Posts: 49
Joined: Wed Feb 10, 2016 11:06 am

Re: Service with created user cannot be started

OK, thank you!
Ich weiß, dass ich nichts weiß!
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service with created user cannot be started

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
schwarzsurfer
Posts: 49
Joined: Wed Feb 10, 2016 11:06 am

Re: Service with created user cannot be started

Well, I did it exactly like the tutorial, but it doesn't work. Same failure. The service doesn't start due to a login error. If a change the password for the service manually, everything works fine. The user is created correctly, I can login to the computer with the predefined password. But it seems like the installer does not set the password for the service correctly.

Can you please check if this is an Advanced Installer problem?

Thank you!
Ich weiß, dass ich nichts weiß!
schwarzsurfer
Posts: 49
Joined: Wed Feb 10, 2016 11:06 am

Re: Service with created user cannot be started

Ok, now it works. As you already said the "logon user as service" checkbox was the solution. I thought I tried this bevor, perhaps I haven't.

It even works in the same installation package, but then the user will be removed if the package is uninstalled... is there a way to make the created user permanent?

Thank you!
Ich weiß, dass ich nichts weiß!
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service with created user cannot be started

Hello,

To avoid the user removal on uninstall you can configure your setup project to skip the uninstall action that remove the user account created at install.

This can be done by going to “Table Editor” page in the “Custom Behavior” section, open the “InstallExecuteSequence” table and edit the "Condition" field of “AI_UninstallAccounts” line to be always false. For instance you can set it like this:

Code: Select all

1=2
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Re: Service with created user cannot be started

Sorry if this is a silly question, since I haven't ever tried this sort of installation setup myself, I may very well be missing something here..

But just out of curiosity, would it not be easier to just disable the "Register product with Windows Installer" option in the prerequisite project that actually creates the new user account? From my understanding, this should prevent the "create user" setup package from being uninstalled, thus removing the ability for any setup package to undo what this one has done.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service with created user cannot be started

Hello Andre,

Indeed, unchecking the "Register product with Windows Installer" option is another solution too. But in this case you won't be able to uninstall any resource installed by the product that installs the user account.

If you have any questions just let us know.

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

Return to “Common Problems”