0

I have packaged a .exe file which when executed will execute a .bat file. I need to install this .exe file as a Windows service.

I have used Sc and InstallUtil.exe to do this.

  1. I used SC and installed this .exe file as windows service, But When i try to start the service it throws me Error 1053: Service did not respond to start in timely fashion.

  2. When i tried to install using installutil.exe, I am unable to install, it throws error

    C:\Windows\Microsoft.NET\Framework64\v2.0.50727>InstallUtil.exe c:\Meiyappan\code-apr2\datadirector\bin\agent.exe Microsoft (R) .NET Framework Installation utility Version 2.0.50727.5420 Copyright (c) Microsoft Corporation. All rights reserved.

    Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file:///c:\Meiyappan\code-apr2\datadirector\bin\agent.e xe' or one of its dependencies. The module was expected to contain an assembly manifest..

I could find some other alternatives like Firedeamon pro and srvany.exe, But my concern is would it be a generic across all machine.

I would like to find a generic solution for this. Any help would be greatly appreciated.

Mike Trusov
  • 1,958
  • 1
  • 15
  • 23
  • Can you please share the SC command and the parameters passed? – Travis G May 03 '13 at 05:26
  • I'm not sure what you mean by a "generic solution" in this context. But if you want your executable to be a service, write it as a service. http://msdn.microsoft.com/en-us/library/ms681921%28v=vs.85%29.aspx – Harry Johnston May 03 '13 at 05:28
  • Is this a managed ot unmanaged .exe http://stackoverflow.com/questions/11343867/c-sharp-the-module-was-expected-to-contain-assembly-manifest – Preet Sangha May 03 '13 at 06:31

0 Answers0