473,320 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Programatically uninstall/install a service.

UJ
How could I have a program uninstall a service and then install a newer
version of the same service? This assumes I've already got the files in the
appropriate directory to be able to install the new version of the service.

TIA - Jeff.
Jan 30 '07 #1
4 3976

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

Peter has a cool way to do it, you can probably pull the code from there.

...

The aritcle is about msmq , but in the code is the windows service
installer/uninstaller.

"UJ" <fr**@nowhere.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
How could I have a program uninstall a service and then install a newer
version of the same service? This assumes I've already got the files in
the
appropriate directory to be able to install the new version of the
service.
>
TIA - Jeff.


Jan 30 '07 #2
Hi,
"UJ" <fr**@nowhere.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
| How could I have a program uninstall a service and then install a newer
| version of the same service? This assumes I've already got the files in
the
| appropriate directory to be able to install the new version of the
service.

There is an option tin the setup project template where you can check for a
previous version and just install the new over it. Did you try it?
--
Ignacio Machin
machin AT laceupsolutions com
Jan 30 '07 #3
UJ
Thanks but I need to do it programmatically. I have a program that is going
to check for updates on our server and if there is a newer version it will
download it, uninstall the current service and replace it with the new one.

"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi,
"UJ" <fr**@nowhere.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
| How could I have a program uninstall a service and then install a newer
| version of the same service? This assumes I've already got the files in
the
| appropriate directory to be able to install the new version of the
service.

There is an option tin the setup project template where you can check for
a
previous version and just install the new over it. Did you try it?
--
Ignacio Machin
machin AT laceupsolutions com


Jan 31 '07 #4
Hi,

"UJ" <fr**@nowhere.comwrote in message
news:OJ**************@TK2MSFTNGP04.phx.gbl...
| Thanks but I need to do it programmatically. I have a program that is
going
| to check for updates on our server and if there is a newer version it will
| download it, uninstall the current service and replace it with the new
one.

I know there is a way of doing that in code, just that I do not know it,
take a look in the archives.

A workaround would be:
1- stop the service
2- copy the new files over the old one
3- restart the service
All the above actions are easily implemented in code
--
Ignacio Machin
machin AT laceupsolutions com
Jan 31 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: tuuky | last post by:
I've created a Windows Service in C# and an installer project for it. I installed the service using the packaged installer project and the service was installed correctly and it runs fine. ...
1
by: UJ | last post by:
I have code to start up a service and delete (uninstall) a service. I'm looking for help on stopping a service. I've noticed that if a service is running and you delete it, it still is running but...
3
by: Johan Karl Larsen | last post by:
I made a sample service in C++ and installed it with myservice -Install Now I want to remove it, tried myservice -Uninstall Definitely not working. What is the correct remove option...
0
by: Daniel Pratt | last post by:
(originally posted to microsoft.public.dotnet.framework) Hi All, I have a Windows Service project that contains an "Installer" class that is used to install and uninstall the service. The...
2
by: WWengert | last post by:
I am developing a Windows application using VS2005 Pro (VB). The solution includes a setup project. I sent the setup files to a tester and he installed and used the program successfully. I then...
3
by: Marcel Brekelmans | last post by:
Hi, I was wondering if it's possible to install/uninstall a service from code without using the InstalUtil.exe tool with the /i and /u flags. As far as I can Google everyone is doing it that...
3
by: DC | last post by:
Hi, I have developed a windows service in C# and I am using a Visual Studio 2003 installer to install it. When I am updating the service, I usually stop the service in control panel, close...
0
by: Nattydreadlock | last post by:
Hello, I'm having some problems installing Visual Studio 2005. I'll briefly explain what's the history of the problem here. First I installed VS 2005 beta 2. I uninstalled it later via the...
7
by: Steve Cross | last post by:
I have a problem with ASP.Net 2.0 that I think needs a re-install. When I go to the control panel and try to uninstall, the Microsoft .Net Framework 2.0 Setup dialog comes up and tells me the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.