Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Service Install problem

Status
Not open for further replies.

InstantZonk

Programmer
May 14, 2007
4
GB

I've created a Windows Service which works fine and installs OK using command line installutil. However, I need to create a separate application which does the equivalent of installutil. I've tried using System.Diagnostics.Process.Start( with the same parameters that used with the command line installutil, but it fails because I can't find the location of installutil.

Any suggestions please ?
 
Create a dos batch file to run ~path to installUtil~ + InstallUtil then execute the batch file. It was one of those things where the solution was staring me in the face but it took a while to see it.
 
I know of that solution, but it's not reliable enough because the path could be different :( This is a program for a fairly large business, and I need to avoid any potential problems like that.

I found the below link, but the service isn't placed into the services list as it's supposed to be. I think they forgot something, or I'm missing something even though I've done it several times :(


Thanks
 
Personally I cheat and copy the InstallUtil to the exe directory, use it then delete it. You could easily do this in a batch file.

Hope this helps

"Just beacuse you're paranoid, don't mean they're not after you
 
Interesting.

How about including installutil.exe and installutil.dll in my installation package, and then run the batch file once the installation is almost complete?

One potential problem: is installutil different for different versions of the .NET framework??? I ask because some computers may have .net 1.1, and others may have .net 2.

If installutil doesn't differ from the different frameworks, this is a workable solution. I don't have .net 2 anywhere to check, and downloading it right now isn't feasible - stuck on dialup for the next few days (Yuck)

Thanks!
 
The customer for this specific application was only .Net 1.1, and I put Installutil into the installation package so I had a known path. Future releases will need to be either .net 1, 2 or 3, so I'm reckoning that I may need specific releases for the appliction, but I haven't tried it

In this case the installation and conditions for running the Windows Service are controlled by a separate Configuration package which has to set registry values for other start up paths and URLS for Web services so I have quite a lot of control over the siutation.
 
My customer isn't capable of handling multiple releases - it just has to work...

This is frustrating.
 
Have you considered writing your own installer? That way you can detect what version of the framework they have installed and use the correct files/configuration needed.

 
Sorry for taking so long to reply. I had another pressing program to finish, and now need to figure out this quickly, so please read the Notice below.

Zaith: I DID do that. See the link I posted a few replies up. However, no matter what I do, following the examples exactly, trying to do it myself, altering the examples, using default names and settings for everything, etc. Nothing works. No matter what I try, the service doesn't appear in the services.msc list.

I've uploaded a very basic example I created using VB.NET 2003. It's the project files only, no executables, so you will have to compile it to test it. You can download it from here:


NOTICE:
By Oct 18, 2007, the FIRST PERSON that does all of the following will be paid $50 via PayPal:

1) Downloads the project from the link above and figures out whatever my problem(s) is(are) in the service, service installer, and/or deployment.

2) Fixes my project and posts it back as a working downloadable version (use mediafire.com or other free storage service) so that I can compile it and then install it and after installation the service becomes visible in the Windows Services list

3) Documents what was wrong and why (so that I can understand the problem)

4) Posts all of that back here and gives me their paypal email address so I can send payment. Or you can call me at 910-398-4288. Be aware: If you call me I'll ask you to post something specific back here so I can verify who I'm talking to on the phone so I don't pay the wrong person.

Limitations:
* Solutions which require running any 3rd party program or a batch file are not acceptable.

*If I cannot compile, install, and see the service in services.msc on my computers, or if you cannot explain why it didn't work in the first place, I am not required to pay (though if it works completely, I may still pay).

*No other methods of payment other than PayPal will be offered. Payment via PayPal is guaranteed to the first person with a solution that meets all the above requirements.

Thank you
 
Ok, I think I may have figured it out on my own. Stupid me. I missed something each and every time in that tutorial, though on many of the others out there it isn't mentioned.

When creating the setup service, you have to add a custom action. The custom action is the install of the service. All you do is Open the custom install dialog, double click Application Folder, and double click Primary output from Service1.

Man I feel stupid. Of course the payment is off, as I figured it out myself.

Thanks for looking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top