I need to install a COMPILED windows service .exe

R

Rogelio

here's my problem: I have an obfuscated, compiled .exe , that is a windows
service, and I need it to install using a setup project. since its already
compiled, I can't just go to "custom actions" and add primary output from the
service. my setup project doesnt see it. so how the heck do I do it?

I was thinking of using a DOS .bat file that uses sc.exe or installutil.exe,
but I am still having trouble making it work. anyone got a tutorial or
something. that would be awwesome. thanks.
 
S

sloan

Go here:

http://www.eggheadcafe.com/articles/20041204.asp

1) I made the ServiceManager a "self-installing" service a- la Craig
Andera's excellent example code. You only need to run "ServiceManager.exe
/install" or "ServiceManager.exe /uninstall" and you are good to go. This is
relatively easy to do, and it eliminates the need to rely on that nasty
InstallUtil.exe thing.

Which is aka for
MyWindowsService.exe /install
MyWindowsService.exe /uninstall

Ignore the msmq stuff, and focus on #1.

I found that by accident, and that is my goto windows service installer
method now.

Shout out to Peter (again) for that one.

...
 
R

Rogelio

maybe I'm missing somethere here..
my setup project has 2 files. a windows app .exe, and a win service.exe. no
projects.

that's it. I dont have any additional projects or anything. so how would I
make it install the service and remove the service on install.
 
P

Peter Bromberg [C# MVP]

That's difficult, because the whole idea of a setup project is to take
unbuilt solution projects and build them into the MSI installer. When you try
to make a setup project using only prebuilt executables, you will find it
difficult at best. I'm sure it can be done, but that isn't what your basic
setup project was designed for (as you have already found out).
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
 
J

JamesB

Rogelio said:
maybe I'm missing somethere here..
my setup project has 2 files. a windows app .exe, and a win service.exe.
no
projects.

that's it. I dont have any additional projects or anything. so how would
I
make it install the service and remove the service on install.

I'm in the midst of service-ifying my application at the moment - rather
than installing the service at setup-time, I am letting my management forms
app do so (the first time you run it, it looks for the service, and if it's
not found, it asks if you'd like to install it).

I found a nice class to take care of all this but I seem to have lost the
link, but if it's of use, I can post some code...
 

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