Author Topic: [Python] Self installing Windows service.  (Read 583 times)

0 Members and 1 Guest are viewing this topic.

Offline D4RKS3C

  • /dev/null
  • *
  • Posts: 12
  • Cookies: -29
    • View Profile
[Python] Self installing Windows service.
« on: August 24, 2015, 12:33:37 am »
Alright so i know how to make a Windows service in python but i'm unsure as to how to have it install itself. My end game is to compile the script and to have the program install itself as a service once the executable is clicked.

Normally you write your service and at the end include a call to the service handler like so:

Code: (python) [Select]
def ctrlHandler(ctrlType):
   return True

if __name__ == '__main__':   
   win32api.SetConsoleCtrlHandler(ctrlHandler, True)   
   win32serviceutil.HandleCommandLine(aservice)

I'm unsure however as to how to go about automating the process.

Thanks in advance.