Yuri_07 Posted December 25, 2018 Share Posted December 25, 2018 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 More sharing options...
spudw2k Posted December 25, 2018 Share Posted December 25, 2018 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. Yuri_07 1 Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Yuri_07 Posted December 25, 2018 Author Share Posted December 25, 2018 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 More sharing options...
spudw2k Posted December 26, 2018 Share Posted December 26, 2018 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. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Yuri_07 Posted December 26, 2018 Author Share Posted December 26, 2018 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 More sharing options...
spudw2k Posted December 26, 2018 Share Posted December 26, 2018 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? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Yuri_07 Posted December 26, 2018 Author Share Posted December 26, 2018 # AutoIt3Wrapper_Compile_Both = y - Is this library in my case highlighted in black and not in purple, does it seem to be inactive? Link to comment Share on other sites More sharing options...
kaisies Posted December 26, 2018 Share Posted December 26, 2018 (edited) 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 December 26, 2018 by kaisies Link to comment Share on other sites More sharing options...
Yuri_07 Posted December 26, 2018 Author Share Posted December 26, 2018 I beg you to send a working version to install my application service Link to comment Share on other sites More sharing options...
Yuri_07 Posted December 26, 2018 Author Share Posted December 26, 2018 And once again I ask you to describe the sequence of actions. Link to comment Share on other sites More sharing options...
Yuri_07 Posted December 26, 2018 Author Share Posted December 26, 2018 Hello! nssm unfortunately does not fit in this solution. I have already considered it. Does not pass on safety Link to comment Share on other sites More sharing options...
Yuri_07 Posted December 26, 2018 Author Share Posted December 26, 2018 Thank you all for your feedback. Found a solution. Wrapped in SRVANY Missing libraries load extra. I build an automation process based on the results. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now