Giridhar Damodaram

I new to .net My project involves developing a windows service application using VB .NET. I have installed the service successfuly on the first attempt using the installutil provided by the frame work. When i uninstalled the application the it gave me the following result.

System.ComponentModel.Win32Exception: The specified service does not exist as an installed service
An exception occurred while uninstalling. This exception will be ignored and the
uninstall will continue. However, the application might not be fully uninstalle
d after the uninstall is complete.

The uninstall has completed.

When i tried to install the app again it gave me the following error

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The specified service already exists

I removed the application from the list of application event log entries in the registry(HKEY\LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application) ant tried installing the app agin it installed successfully. Why is uninstalling the service not removing the entry from the registry. Is that i should change some properties of the installer component.

Any help would be highly appretiated.




Re: Visual Basic Language Error while using Installutil for installing windows service application.

Ashish Basran

Hello Giridhar,

Actually there should not be any issue while installing/uninstalling windows service using installutill. I am not sure why you are getting that. Well, you may like to use msi installation for webservice installation. It should be easy and better then using installutill.






Re: Visual Basic Language Error while using Installutil for installing windows service application.

Jared Parsons MSFT

If you run into this issue again, try looking in the eventlog and see if it has more helpful information about the error. If so, please post the contents of that message.




Re: Visual Basic Language Error while using Installutil for installing windows service application.

Giridhar Damodaram

Thanks for the response Ashish Basran. My application is not a web service application. Can i still use this msi installation. Is this utility a part of .NET FrameWork package.




Re: Visual Basic Language Error while using Installutil for installing windows service application.

Giridhar Damodaram

Hi Jared Parsons MSFT. I tried uninstalling once again and Checked event Viewer for any new messages in Application and system Event Logs but there was no new messages.




Re: Visual Basic Language Error while using Installutil for installing windows service application.

Jared Parsons MSFT

Do you have any custom uninstall logic in your MSI






Re: Visual Basic Language Error while using Installutil for installing windows service application.

Ashish Basran

Hello Giridhar,

You can create msi for Windows Service installation. For this you need to create a setup project in your Visual Studio. Add the outpput of your project to folders/files of setup project. In custom actions section, add your executable in install and uninstall events. The install and uninstall logics you can have in your windows service project in your installer (you must have added an installer while creating windows service).






Re: Visual Basic Language Error while using Installutil for installing windows service application.

Giridhar Damodaram

No i dont have any custom uninstall logic.




Re: Visual Basic Language Error while using Installutil for installing windows service application.

Vadim B. Guzev

Did you use the "Repair" functionality I've noticed that by default it doesn't work and can cause the problem which you described above





Re: Visual Basic Language Error while using Installutil for installing windows service application.

hannous

I have this problem when using 'Repair'.

My Visual Studio solution consists of two Windows Services and one Setup project. The setup project encapsulates both windows services.

What's happening is that Install/Uninstall works fine. However, if I use 'Repair' after installation the installer works a little and then shows a message "The specified service already exists" and rolls back. I look in the Services list and one of the two services is gone! I try to uninstall and I get the message "An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete. --> The specified service does not exist as an installed service." and it rolls back.

Now if I use 'Repair' again the missing service is re-installed.

Why is one of the services uninstalling on the first 'Repair'






Re: Visual Basic Language Error while using Installutil for installing windows service application.

Hassan Annous

I have fixed this problem by removing the Primary Output from the Rollback Custom Actions.




Re: Visual Basic Language Error while using Installutil for installing windows service application.

Momos

You probably installed the service under name X, then changed the name of the service (.ServiceName) in code to name Y, build that and then tried to un-install service X.