473,327 Members | 2,112 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,327 software developers and data experts.

Installing a service through code.

UJ
I have a situation where I want to upgrade/add a service on a machine
automatically. If the service is already there, I need to remove it. I then
need to install a new version of the service. How do I go about this in
code?

TIA - Jeff.
Feb 21 '06 #1
5 1289
Unless you want to take another approach, you would normailly write an MSI
Windows installer (Deployment Project) and set the "Remove Previous Versions"
property to true.
Your installer would also need to have some custom commands to stop and
uninstall the previous version, and install and start the new version. Some
study will be required, there are a few articles out there that will help.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"UJ" wrote:
I have a situation where I want to upgrade/add a service on a machine
automatically. If the service is already there, I need to remove it. I then
need to install a new version of the service. How do I go about this in
code?

TIA - Jeff.

Feb 21 '06 #2
UJ
Thanks Peter. But I need to have it done silently behind the scenes. A
program will figure out there's a new version and run without human
intervention.

Jeff.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:06**********************************@microsof t.com...
Unless you want to take another approach, you would normailly write an MSI
Windows installer (Deployment Project) and set the "Remove Previous
Versions"
property to true.
Your installer would also need to have some custom commands to stop and
uninstall the previous version, and install and start the new version.
Some
study will be required, there are a few articles out there that will help.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"UJ" wrote:
I have a situation where I want to upgrade/add a service on a machine
automatically. If the service is already there, I need to remove it. I
then
need to install a new version of the service. How do I go about this in
code?

TIA - Jeff.

Feb 21 '06 #3
Check this link out. I posted some code which I use to install
windows service programatically. You should be able to adapt it to
your purposes. I think it is in VB but should be fairly straight
forward to convert.

http://tinyurl.com/7382d

Feb 21 '06 #4
In that case, you will probably want to study the AppUpdater Application Block.
The basic concept is, a process will check a webservice periodically to see
if there is a new version. If so, it will silently download and install it.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"UJ" wrote:
Thanks Peter. But I need to have it done silently behind the scenes. A
program will figure out there's a new version and run without human
intervention.

Jeff.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:06**********************************@microsof t.com...
Unless you want to take another approach, you would normailly write an MSI
Windows installer (Deployment Project) and set the "Remove Previous
Versions"
property to true.
Your installer would also need to have some custom commands to stop and
uninstall the previous version, and install and start the new version.
Some
study will be required, there are a few articles out there that will help.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"UJ" wrote:
I have a situation where I want to upgrade/add a service on a machine
automatically. If the service is already there, I need to remove it. I
then
need to install a new version of the service. How do I go about this in
code?

TIA - Jeff.


Feb 21 '06 #5
UJ
Well isn't that just a kick in the head. That's exactly what I was looking
for.

Thanks.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:BE**********************************@microsof t.com...
In that case, you will probably want to study the AppUpdater Application
Block.
The basic concept is, a process will check a webservice periodically to
see
if there is a new version. If so, it will silently download and install
it.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"UJ" wrote:
Thanks Peter. But I need to have it done silently behind the scenes. A
program will figure out there's a new version and run without human
intervention.

Jeff.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in
message
news:06**********************************@microsof t.com...
> Unless you want to take another approach, you would normailly write an
> MSI
> Windows installer (Deployment Project) and set the "Remove Previous
> Versions"
> property to true.
> Your installer would also need to have some custom commands to stop and
> uninstall the previous version, and install and start the new version.
> Some
> study will be required, there are a few articles out there that will
> help.
> Peter
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "UJ" wrote:
>
>> I have a situation where I want to upgrade/add a service on a machine
>> automatically. If the service is already there, I need to remove it. I
>> then
>> need to install a new version of the service. How do I go about this
>> in
>> code?
>>
>> TIA - Jeff.
>>
>>
>>


Feb 21 '06 #6

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

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
11
by: Ceri Williams | last post by:
I followed the excellent MSDN article "Code Generation in the .NET Framework Using XML Schema" to build a substitute for the limited xsd.exe. My code works fine under .NET framework 1.1, but after...
4
by: Claire | last post by:
Hi, I know this isn't strictly C# language related, but my service IS written in c# and I checked out the list of microsoft newsgroups for win2000 and couldn't really see one that applies. I'm...
11
by: tshad | last post by:
I have a small Windows Service program that just has a timer on it and it built fine. I try to install it using InstallUtil and I get the following message: ...
2
by: J | last post by:
hi, I'm having a problem installing a service created in vb.net 2003 on a windows 2000 server. I have installed the service on a few XP machines with out any problems...but the 2 servers (win...
5
by: Andrea Vincenzi | last post by:
Help me please, I'm totally stuck! My Visual Studio 2003 debugger stopped working after I installed Windows XP Service Pack 2. Here is what happens (with any project, even a "Hello, world"...
0
by: Anonieko Ramos | last post by:
Self Installing Service Enter a topic name to show or a new topic name to create; then press Enter .. Start by writing a service. This involves deriving a class from...
3
by: Mukesh | last post by:
Hi friends i wants to install a service (MS application Block) on the server using a web application. Can i do this if yes then how can i do this I m using MS VisualStudio.net 2003, C#, .net1.1...
15
by: =?Utf-8?B?RWxpb3Ro?= | last post by:
I try to install Windows Services but it show this error during the installation process, "Insufficient System resources exist to complete the requested service." I created this Services in VB...
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...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.