ADeveloperNamedTim

My app consists of a Window Service and a WinForm UI app. Because of the service I can't use ClickOnce so my plan is to have the WinForm check for updates for the service and the WinForm. My question is there is a new version of the service, how can I do I uninstall the old version before I install the new version Or can I have the service update itself Thanks for the help

Re: .NET Framework Setup Auto Update on Windows Service?

OmegaMan

Have the service remote to an installed item that contains the biz logic and is easier to update.





Re: .NET Framework Setup Auto Update on Windows Service?

LMiranda

Cant he programatically stop the service, update necessary binaries (dll's), and then restart the service If the .exe itself is being updated then im guessing you may have to programatically installutil /u and the installutil it again... hopefully its the first case.



Re: .NET Framework Setup Auto Update on Windows Service?

ADeveloperNamedTim

I thought about doing it that way but was not sure if you could call installutil /u programatically. Anyone know if you can Also I haven't started looking at how this will work with Vista, but I will have to support it.





Re: .NET Framework Setup Auto Update on Windows Service?

LMiranda

well, if you cannot do it programatically, you can have a batch file that contains the correct commands. then, the 'upgrade.exe' application you make, can invoke the batch file

the batch file will need to stop, uninstall/override any dll's, and restart the service

if you want to do this ALL in the service, then yes, im thinking the only thing you can update are dll's... and if anything looks like you will need to somehow 'unload' them from memory first... im thinking the first option may be do-able...





Re: .NET Framework Setup Auto Update on Windows Service?

sthotakura

You can just stop the service programmatically and then replace the service binary (exe)..

Cheers,

Suresh





Re: .NET Framework Setup Auto Update on Windows Service?

OmegaMan

sthotakura wrote:

You can just stop the service programmatically and then replace the service binary (exe)..

Cheers,

Suresh



Maybe make a service that monitors for the condition of update. When found stop the target service, copy the exe and restart it.