0

I believe I have an error in creating a service in Windows XP Computers, because after my installation is finished I don't see any of my services installed.
This is how I create a service in my installer:

Filename: {sys}\sc.exe; Check: (IsAdminLoggedOn or IsPowerUserLoggedOn); Parameters: "create Example start= delayed-auto binPath= ""{app}\Example.exe"""; Flags: runhidden

This line works in all Windows besides Windows XP for some reason.
Am I doing anything wrong?

yuval
  • 2,848
  • 4
  • 31
  • 51

1 Answers1

1

If you had tried your command on Windows XP command line, you would clearly see why it fails:

C:\>C:\WINDOWS\system32\sc.exe create Example start= delayed-auto binPath="C:\WINDOWS\system32\notepad.exe"  
invalid start= field
...

Your start= parameter is invalid. You have to use one of the valid values:

 start= <boot|system|auto|demand|disabled>

The delayed-auto is supported since Windows Vista and newer only. You have to use a different start option on Windows XP.

If you want to use delayed-auto on Windows Vista and newer and another option on Windows XP, see How to install a service with the delayed-auto startup type in Windows XP.

Community
  • 1
  • 1
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • I cannot use startup type demand because it would require the users to manually start the service. I edited my question so please take a look. – yuval Mar 06 '16 at 14:14
  • I moved my question here http://stackoverflow.com/questions/35828041/how-to-install-a-service-with-the-delayed-auto-startup-type-in-winodws-xp – yuval Mar 06 '16 at 14:26