Installing a Windows Service

A

Andrew Chalk

I want to use a .Net class to install a service written in unmanaged C++.
Are there .Net classes to do this? It appears the classes only allow you to
install a service written in .Net.

Thanks.
 
M

Michael Nemtsev

Hello Andrew,

You need to use WinAPI CreateService method to install unmanaged service
http://msdn2.microsoft.com/en-us/library/ms683500.aspx

Alternative option, is to produce "verifiable component" which can be used
with managed installer http://msdn2.microsoft.com/en-us/library/ms384352(VS.71).aspx
But I've never tried to install this way

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

AC> I want to use a .Net class to install a service written in unmanaged
AC> C++. Are there .Net classes to do this? It appears the classes only
AC> allow you to install a service written in .Net.
AC>
AC> Thanks.
AC>
 
M

Michael Nemtsev

Hello Andrew,

BTW, you can call your servce with -install param, like myservice.exe -install

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

AC> Thanks. At the moment I am calling Process.Start() to run SC.EXE.
AC>
AC> - A
AC> "Michael Nemtsev said:
Hello Andrew,

You need to use WinAPI CreateService method to install unmanaged
service http://msdn2.microsoft.com/en-us/library/ms683500.aspx

Alternative option, is to produce "verifiable component" which can be
used
with managed installer
http://msdn2.microsoft.com/en-us/library/ms384352(VS.71).aspx But
I've
never tried to install this way
---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

AC> I want to use a .Net class to install a service written in
unmanaged
AC> C++. Are there .Net classes to do this? It appears the classes
only
AC> allow you to install a service written in .Net.
AC> AC> Thanks.
AC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top