Is it possible to install a windows service written in C++(using CreateService WINAPI) by calling assemblyInstaller.Install from a C# code. Here is Assembly Installer class that I am talking about - http://msdn.microsoft.com/en-us/library/system.configuration.install.assemblyinstaller.install.aspx
Asked
Active
Viewed 368 times
1 Answers
0
I am pretty sure, that the answer is no. AssemblyInstaller will try to use metadata of the assembly.
Why do you want to mix two different platforms? If you are able to write a sevice with C++ and Win32 API, you should be able to install it creating a few registry key, shouldn't you? Using AssemblyInstaller.Install simply is not worth it in this case.

Sergey Sirotkin
- 1,668
- 11
- 7
-
I need to do it because I am running tests in C#. What is the best way to install the C++ service from C#. Any samples would be great. – Vishu Oct 24 '11 at 16:57
-
Check Win32 API functions that deal with services; start with OpenSCManager: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684323(v=VS.85).aspx and then use CreateService. – Sergey Sirotkin Oct 24 '11 at 17:31
-
Probably, answer to similar question on stackoverflow is what you need: http://stackoverflow.com/questions/358700/how-to-install-a-windows-service-programmatically-in-c – Sergey Sirotkin Oct 24 '11 at 17:33