0

I have an odd situation that I am not sure how to resolve. I have an executable, let's say cat.exe located at C:\Program Files\MyPath\cat.exe

Trying to use sc create failed each time, I was not sure why this was happening, and after reading online I found that InstallUtil.exe was a better solution.

So I used that, and from command prompt: C:\Windows\Microsoft.Net\Framework\v 2.0.50727\InstallUtil.exe "C:\Program Files\MyPath\cat.exe"

This installed the service correctly. I then went into services, and changed the start mode to Automatic, and then started the service. A few minutes later, the service crashed. After the crash the service would never start again, each time it hit a timeout limit. The application is in 3.5 so thoughts were to remove the service and then install using v4 installutil.

I then tried to remove the service, using: C:\Windows\Microsoft.Net\Framework\v 2.0.50727\InstallUtil.exe /u "C:\Program Files\MyPath\cat.exe"

This did not remove the service. The only way I was able to remove the service was to do: sc delete "CAT"

This removed the service fine, but now no matter what I do, all attempts to re-add using InstallUtil fail, regardless of which framework directory I try from. Also, I cannot add new services such as C:\Windows\Microsoft.Net\Framework\v 2.0.50727\InstallUtil.exe "C:\Program Files\MyPath\dog.exe"
or in v4 C:\Windows\Microsoft.Net\Framework\v 4.3.30319\InstallUtil.exe "C:\Program Files\MyPath\dog.exe"

I get no errors indicating that errors have occurred creating the service. Any ideas on why this is failing or what I can do to attempt to remedy the situation ?

Nyra
  • 859
  • 1
  • 7
  • 27
  • Attach the debugger or look in the event log. – leppie May 19 '15 at 19:06
  • I do not understand what you mean. Event logs there is nothing. Output shows no errors. I changed parameter /LogToConsole = true and still no error messages. I am getting this in my log file `No public installers with the RunInstallerAttribute.Yes attribute could be found` which searching more seems to indicate that that is the issue... But this has not been an issue in the past. We are migrating legacy systems to Win7 OS... Is this a new requirement? It doesn't seem like it should have an issue on this OS if it didn't on XP (embedded) systems. Or am I off base on that assumption? – Nyra May 19 '15 at 19:16
  • Additional info: This is not a Windows Service project, it is a Windows Forms project being launched as a service. The code is being compiled as a service. I know this is not ideal to not have as a Windows Service project but it is an upgrade of legacy applications. I have no idea how to add the Project Installer which seems to be needed. The articles and examples I've found all reference a Windows Service project so to `R-Click -> Add Installer` is not an option. – Nyra May 20 '15 at 11:55

0 Answers0