[Solved] Service wont start during installation - Advanced Installer Community
flasher86
Posts: 10
Joined: Thu Jul 03, 2014 7:48 am

[Solved] Service wont start during installation

Hi, I am trying to create installation where I install my freshly created service but It behaves weirdly in your software.

during the installation the service just wait's forever during "starting services". In task manager there is already created new process for that services, but in services tab there is status "Uruchamianie" which in English means "trying to execute/run" or "pending to run". After couple of minutes the installation breaks down and it says I dont have enough permissions to start services (yes I have).

It is just abnormal. Furthermore I cannot start or stop service from task manager.

The service installs fine when I run it from cmd: "myservice /install". But your installer just cannot do this.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Service wont start during installation

Hi,

Can you try the solution described in the "Verify that you have sufficient privileges to start service" thread and see if it works for you?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
flasher86
Posts: 10
Joined: Thu Jul 03, 2014 7:48 am

Re: Service wont start during installation

You have posted a wronk link - to this very topic :roll:

I have Windows 7 x64 with UAC control disabled and Administrator account type as well. I can provide blank service which fail to install, or perhaps you will send me your Delphi blank service + source code + msi install.

I noticed that your installer stuck at this code during installation:

Code: Select all

procedure TAscoUpdate.ServiceExecute(Sender: TService);
begin
 while not Terminated do
  ServiceThread.ProcessRequests(True);
end;
nevertheless, with this line

Code: Select all

ServiceThread.ProcessRequests(False);
the param stands for "WaitForMessage"

and if it is set to False, installation continues as it should, but the service is still start pending. With the paremeter set to True, it cannot even install.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Service wont start during installation

Hi,

Sorry for my mistake. I corrected the link, can you check it now?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
flasher86
Posts: 10
Joined: Thu Jul 03, 2014 7:48 am

Re: Service wont start during installation

Hi, I checked it that solution but didn't work for me.

It makes it complete the installation setup, but the service is still "start pending". I also tried to run the setup as an EXE with "run as administrator" context-menu function.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Service wont start during installation

Hi,

Can you reproduce the behavior on multiple clean machines? If so, can you please send us a sample AIP file to support at advancedinstaller dot com, that we can build and test on our machines in order to find the problem?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
flasher86
Posts: 10
Joined: Thu Jul 03, 2014 7:48 am

Re: Service wont start during installation

I sent you an email, looking forward to answer from you.
flasher86
Posts: 10
Joined: Thu Jul 03, 2014 7:48 am

Re: Service wont start during installation

I have found a solution to the problem, and I think many people here had the same issue and the same reason as I did.

I created service in Embarcadero Delphi. I don't know how Windows Services are created in other environments but if you are using Delphi, there is an object TService and it's descendant (your particular TServiceClass)

In the design time there is abilibity to name your TService component, as well as the whole project service. The problem is that if you name your project service "MyService" you cannot name your Class Service with the same name, it will throw you Error that the name is already in use. The name of the TService class is the name which will be used in the system.

So when I couldnt name it with the same value, I chose to name my class "MyServiceService" (it's an example of course), everything compiles, test install works, yeah, let's do the installer now.

In the installer settings i saw edit field "NameService"... again? I thought I assigned those values in Delphi environment before compile. But whatever, let's put it on again. And I set Service Name to "MyService" not "MyServiceService". Creation of the MSI went perfect, let's try it out.

The installer stucks at "starting services"...

All I did to avoid stucking the service was to change the service name in the Advanced Installer to be different from "MyService" name which I choose in Delphi.

For all those who had problems with starting services you should make sure you don't make conflicts like this. Who knew, how many cases here can be cured by this way.

I hope my case will help others. Cheers!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Service wont start during installation

Hi,

I'm glad you got this working. Thank you for sharing the solution with us, I'm sure it will help other users in the future.

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

Return to “Common Problems”