kietvta
Posts: 16
Joined: Thu Dec 08, 2016 8:44 am

Can't start service automatically

Thu Dec 08, 2016 9:10 am

Dear all

Would anyone could help me to solve my problem. I can't start windows service automatically after install it, the service is appear on Windows 7 Service list on Control panel but it didn't start. I already tried with solution below but It doesn't work.
(Custom action/ launch file ( after finisih execution) (see detail in the image attached here)
Link for soluttion had tried : http://www.advancedinstaller.com/user-g ... -file.html

I also enclosed here .AIP so you can reference.

Thanks in advance.
Attachments
Launch File.png
Launch File.png (40.22KiB)Viewed 8776 times
PACS WORKSTATION.aip
(951.35KiB)Downloaded 467 times

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

Re: Can't start service automatically

Thu Dec 08, 2016 11:43 am

Hi and welcome to Advanced Installer forums.

The BAT file from your project is not referenced correctly in the "File to launch" field of your custom action (it should be: [#startservice.bat]). To select a file from the project you can simply right-click in that field and use the "File..." option. Also, that command you written in the "Command line" field should be written in your BAT file, not into that field.

In order to start a service you can also use a "Control Operation" in the "Services" page instead of a custom action..

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

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

kietvta
Posts: 16
Joined: Thu Dec 08, 2016 8:44 am

Re: Can't start service automatically

Fri Dec 09, 2016 2:37 am

Dear Eusebiu

Thank you so much for your quick response. I had changed .bat file name as you showed me but i didn't work.
.Before I post this request I already used function "Control Operations" with check on option "Start" ( action "On Install") and the installer raised an error
"Service 'xxxx' failed to start. Verify that you have sufficient privileges to start system services."
It's very kindly appreciate if you could give me a recommend to solve my issue.

Thank you very much.

kietvta
Posts: 16
Joined: Thu Dec 08, 2016 8:44 am

Re: Can't start service automatically

Fri Dec 09, 2016 2:50 am

Dear Sir

In addition, my service can easily start as I type it manually in command line.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Can't start service automatically

Fri Dec 09, 2016 3:47 pm

Hello,

The service could fail to start when using our "Services" page if the service application has some dependecies (e.g. a .NET assembly) that were not already installed before the "StartServices" action. The .NET assemblies are registered after the "StartServices" action during installation. In this case the correct approach will be to use a custom action like you already tried.

If the BAT file you already added in "Files and Folders" page contains the following command line:

Code: Select all

net start "PACS.client"
then you should not duplicate this in the "Command Line" field of your "Launch File" custom action. Just leave the "Command Line" filed empty. Also, please uncheck the "Run as administrator" option of your "Launch file" action. Since the main setup has the "Run as administrator" option enabled in "Install Parameters" page it is redundant to enable the same option for your action too. When the "Run as administrator" option from "Install Parameters" page is used the whole installation process will run elevated from the beginning to end.

Finally, please go to "Services" page and delete the service control operation you configured to start your service on install.

Let us know if this helped.

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

kietvta
Posts: 16
Joined: Thu Dec 08, 2016 8:44 am

Re: Can't start service automatically

Mon Dec 12, 2016 3:34 am

Dear Sir
I had solve problem by fixing .bat file format in UTF8, it had been saved in wrong format. I run .bat to in start service in custom action.
Thank you so much again.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Can't start service automatically

Mon Dec 12, 2016 11:13 am

You're welcome.

Thank you for sharing the solution with us. Certainly this info will be useful to future users facing similar errors.

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

Return to “Feature Requests”