Jump to content

Created service error 1053


Yuri_07
 Share

Recommended Posts

 

Hello dear experts! Please help me. Trying to install the application as a service. The service is created but not started. When I try to start it manually, error 1053 comes out. I beg you to help me with the solution. System win 10. Attach the code to the description

#include "ServiceControl.au3"
#RequireAdmin
Dim $nRet
RegWrite ("HKLM \ SYSTEM \ CurrentControlSet \ Services [ServiceName]", "Type", "REG_DWORD", 0x110)
   $nRet = _CreateService("", _
                          "icmp_mash", _
                          "icmp_mash_2.1", _
                          "icmp_mash_2.1.exe", _
                          "LocalSystem", _
                          "", _
                          BitOR($SERVICE_WIN32_OWN_PROCESS, $SERVICE_INTERACTIVE_PROCESS))
   If $nRet Then
      MsgBox(4096,'debug:' , 'icmp_mash_2.1 service created') ;### Debug MSGBOX
      If _StartService("", "icmp_mash") Then
         MsgBox(4096,'debug:' , 'icmp_mash_2.1 service started') ;### Debug MSGBOX
      EndIf
   Else
      MsgBox(4096,'debug:' , 'Failed to create icmp_mash_2.1 service: ' & @error) ;### Debug MSGBOX
   EndIf

 

Link to comment
Share on other sites

I suspect the executable may not be designed to run as a proper service (interact with the Windows SCM).  I am not familiar with icmp_mash_2.1, and nothing meaningful showed up when I searched for it, so I can't say for sure. 

One thing you could do to troubleshoot from another perspective (rule out any issue with the AutoIt code) could be to create the service using the command line tool sc.exe [sc /create /?] and see if the service produces the same error.

If you get the same error code, you probably have to wrap the executable with another exe (SRVANY for example) that will interact properly with the SCM.  If icmp_mash happens to be something you wrote in AutoIt you could try to employ the _Service_UDF to make it a "valid service" executable.

Let us know if you get stuck.

Link to comment
Share on other sites

Thank you so much for your reply. Yes you are right. The executable file is also written in autoit, it is a cycle that records logs on server availability and creates a report. I installed this compiled script with the service using anyserv.exe when I tested it on my computer. This is a very good solution, but unfortunately it does not suit me because it does not start on these machines. Apparently for security reasons there are no necessary libraries in the system. I would be very grateful if you give an example with UDF4. How do I use it? I really need a solution to this problem. I even tried to implement it using C # to create MSI, but unfortunately I don’t have knowledge of this language and its specifics.
Link to comment
Share on other sites

I'd recommend starting with the example in the first post of that thread.  At the bottom of the first post are three .au3 files.  Two are for the UDF itself (Services.au3 and ServicesConstants.au3), and an Example script (Service_Examplev4.au3).  

Try poking and playing around with that first.

Link to comment
Share on other sites

 

Thanks for your reply! Tell me which version of autoit should I use? And which editor? I understand that Service_Examplev4.au3 needs to be precompiled and then run? I tried to compile it and execute I had the error "Line - 1: Error: Variable used without being desclared" Now I have installed the version autoit 3.3.0.0 and SciTE 1.7.7

Link to comment
Share on other sites

Looks like 3.3.8.1 is the minimum according to the first post.  Not sure what SciTE version dependencies there may be, if any.

If you run the example in SciTE without compiling, does it tell you which variable declaration is having the issue?

Link to comment
Share on other sites

For what it's worth, I wrote a service for a project using that udf, and it crashed (the service randomly stopped) a bit too much for my liking. I used nssm (just Google it) to install my application as a service, and I haven't had any issue since. Currently deployed on 500 machines. Just a simple service that sleeps for a few seconds, then looks for marker files and takes actions if they exist. 

Edited by kaisies
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...