Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

windows service written in c# .NET 4 vs2010 will not install on Server 2008 R2 Enterprise

I've written many versions of windows services and installed them on a 64-Bit system with 32 GB running Server 2008 R2 Enterprise.

I create the services using this recipe:
http://msdn.microsoft.com/en-us/zt39148a.aspx
"Walkthrough: Creating a Windows Service Application in the Component Designer"

I create the .msi and corresponding setup.exe on my Win 7 laptop (c#, vs2010 SP1, .NET 4).

NORMAL BEHAVIOUR

after testing a Windows service on my laptop, I copy the .msi and setup.exe to a folder on the win2008 R2 Enterprise server (using copy and paste via remote desktop); I use the server's Control Panel to uninstall, right click the .msi and choose Install, then walk through the Setup Wizard. No problem. Works most of the time.

ABNORMAL BEHAVIOUR

The install runs for perhaps 15 minutes or longer; it never finishes; eventually a dialog states
"(?) Installer is no longer responding."
with options to [Retry] or [Cancel].

At this point, the progress bar is a short as it could possibly be and at the far left, beneath the "P" of "Please wait...".

Clicking Retry does not help. It's been over 30 minutes and counting since I clicked Retry and the progress bar has not advanced even a pixel.

MORE INFORMATION

(a) the service installs without any problem on another server, a Win 2008 R2 web edition.
(b) as mentioned above, the Windows service both installs and works properly on my Win 7 development and testing environment.

HISTORY / SPECULATION

a couple of weeks ago, I was unable to install a service from the win 2008 R2 Enterprise server. I could not find it in Control Panel/Uninstall even though the .msi claimed it to be installed and the service also continued to appear in the services.msc console. Even disabling the service did not help. For that reason, I cloned the code, changed the service name slightly, and successfully installed that service which has been running for while without issues.

Today, a similar event happened, the only difference being that I can see that service in Control Panel Uninstall. Because it would not uninstall, I tried my same cloning trick but this time it failed.

Next step: using the above walkthrough, I created a do nothing Windows service and made it useful by importing my client classes into it from the original c# project file.

The re-built from the ground up Windows service works as designed on my laptop but refuses to install on the R2 Enterprise server.

Any ideas?

Please and thank you.

P.S.: i posted this at so because imho it's more likely something that a developer is likely to encounter prior to handing off her/his code to a sysadmin.

BTW, I could not find anything related at so; ditto via Google.

like image 417
gerryLowry Avatar asked Mar 21 '11 23:03

gerryLowry


1 Answers

in this particular case, it is some very weird server rights condition

MORE INFORMATION

although my server account is not Administrator, I'm a member of both local and domain Administrators for this 2008 R2 box.

I had tried many ideas, including creating the example in the walkthrough and trying it. No luck.

The boxe's Administrator was able to install my service using installutil.exe so I tried installutil.exe but it would only work for me using the Administrator's credentials.

For that reason, I suspected it might be a rights issue, so I tried with my credentials installing the walkthrough example on the H:\ drive. Success. Next, I tried installing the troublesome Windows service on C: in a different location. Again, success.

What is strangest about this issue is that many times I had no problem then suddenly a problem arose to block my development efforts.

A sign that a Windows service will install is when a dialog asking permission to continue appears almost immediately after starting the install. Another clue that success is possible is being able to successfully uninstall any previous version via Control Panel.

I appreciate everyone's efforts to help me with this. Thank you.

like image 66
gerryLowry Avatar answered Sep 27 '22 02:09

gerryLowry