473,549 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSI to install and start a service

I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service after
install. How do I do that?

Thanks,
Russ
Jul 21 '05 #1
8 1819
implement a Commit override in your installer class and use
ServiceControll er to do that.

"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service after install. How do I do that?

Thanks,
Russ

Jul 21 '05 #2
See the MSDN Topic "Walkthroug h: Creating a Windows Service Application in the
Component Designer". Maybe you already did, but that refers to a custom action
that installs your service. In the Install method (override it) use
ServiceControll er to start it.

(If your company happens to use a commercial tool from InstallShield, Wise etc
etc, you don't need any of the above. They create the right entries in the MSI
file, ServiceInstall and ServiceControl tables, that get the Windows Installer
to do literally all of that stuff without you needing to write code).
--
Phil Wilson [MVP Windows Installer]
----
"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service after
install. How do I do that?

Thanks,
Russ

Jul 21 '05 #3
You're right, Commit is a better place than the Install method.
--
Phil Wilson [MVP Windows Installer]
----
"konsu" <ko***@hotmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
implement a Commit override in your installer class and use
ServiceControll er to do that.

"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service

after
install. How do I do that?

Thanks,
Russ


Jul 21 '05 #4
Thanks for your answers guys. Did it with the following code in
ProjectInstalle r.vb

Protected Overrides Sub OnAfterInstall( ByVal savedState As IDictionary)

MyBase.OnAfterI nstall(savedSta te)

Try

Microsoft.Visua lBasic.Shell("n et start IpNotifyService ")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@un isys.spamcom> wrote in message
news:eJ******** *****@TK2MSFTNG P10.phx.gbl...
See the MSDN Topic "Walkthroug h: Creating a Windows Service Application in the Component Designer". Maybe you already did, but that refers to a custom action that installs your service. In the Install method (override it) use
ServiceControll er to start it.

(If your company happens to use a commercial tool from InstallShield, Wise etc etc, you don't need any of the above. They create the right entries in the MSI file, ServiceInstall and ServiceControl tables, that get the Windows Installer to do literally all of that stuff without you needing to write code).
--
Phil Wilson [MVP Windows Installer]
----
"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service after install. How do I do that?

Thanks,
Russ


Jul 21 '05 #5
Is there a reason why you decided not to use the ServiceControll er class?

konst

"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:uK******** ******@TK2MSFTN GP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstalle r.vb

Protected Overrides Sub OnAfterInstall( ByVal savedState As IDictionary)

MyBase.OnAfterI nstall(savedSta te)

Try

Microsoft.Visua lBasic.Shell("n et start IpNotifyService ")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@un isys.spamcom> wrote in message
news:eJ******** *****@TK2MSFTNG P10.phx.gbl...
See the MSDN Topic "Walkthroug h: Creating a Windows Service Application in
the
Component Designer". Maybe you already did, but that refers to a custom action
that installs your service. In the Install method (override it) use
ServiceControll er to start it.

(If your company happens to use a commercial tool from InstallShield,

Wise etc
etc, you don't need any of the above. They create the right entries in
the MSI
file, ServiceInstall and ServiceControl tables, that get the Windows

Installer
to do literally all of that stuff without you needing to write code).
--
Phil Wilson [MVP Windows Installer]
----
"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service

after install. How do I do that?

Thanks,
Russ



Jul 21 '05 #6
Is there a reason why you decided not to use the ServiceControll er class?

konst

"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:uK******** ******@TK2MSFTN GP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstalle r.vb

Protected Overrides Sub OnAfterInstall( ByVal savedState As IDictionary)

MyBase.OnAfterI nstall(savedSta te)

Try

Microsoft.Visua lBasic.Shell("n et start IpNotifyService ")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@un isys.spamcom> wrote in message
news:eJ******** *****@TK2MSFTNG P10.phx.gbl...
See the MSDN Topic "Walkthroug h: Creating a Windows Service Application in
the
Component Designer". Maybe you already did, but that refers to a custom action
that installs your service. In the Install method (override it) use
ServiceControll er to start it.

(If your company happens to use a commercial tool from InstallShield,

Wise etc
etc, you don't need any of the above. They create the right entries in
the MSI
file, ServiceInstall and ServiceControl tables, that get the Windows

Installer
to do literally all of that stuff without you needing to write code).
--
Phil Wilson [MVP Windows Installer]
----
"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service

after install. How do I do that?

Thanks,
Russ




Jul 21 '05 #7
Interesting - I wonder if there's a command prompt screen popping up?
--
Phil Wilson [MVP Windows Installer]
----
"konsu" <ko***@hotmail. com> wrote in message
news:vr******** ****@corp.super news.com...
Is there a reason why you decided not to use the ServiceControll er class?

konst

"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:uK******** ******@TK2MSFTN GP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstalle r.vb

Protected Overrides Sub OnAfterInstall( ByVal savedState As IDictionary)

MyBase.OnAfterI nstall(savedSta te)

Try

Microsoft.Visua lBasic.Shell("n et start IpNotifyService ")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@un isys.spamcom> wrote in message
news:eJ******** *****@TK2MSFTNG P10.phx.gbl...
See the MSDN Topic "Walkthroug h: Creating a Windows Service Application

in
the
Component Designer". Maybe you already did, but that refers to a custom

action
that installs your service. In the Install method (override it) use
ServiceControll er to start it.

(If your company happens to use a commercial tool from InstallShield,

Wise
etc
etc, you don't need any of the above. They create the right entries in

the
MSI
file, ServiceInstall and ServiceControl tables, that get the Windows

Installer
to do literally all of that stuff without you needing to write code).
--
Phil Wilson [MVP Windows Installer]
----
"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
> I'm using a Setup Project in VB.NET 2003 Standard to install a windows
> service application. I would like this installer to start the service

after
> install. How do I do that?
>
> Thanks,
> Russ
>
>



Jul 21 '05 #8
Yes, a command prompt screen does popup.

Russ

"Phil Wilson" <ph*********@un isys.spamcom> wrote in message
news:OL******** ******@TK2MSFTN GP11.phx.gbl...
Interesting - I wonder if there's a command prompt screen popping up?
--
Phil Wilson [MVP Windows Installer]
----
"konsu" <ko***@hotmail. com> wrote in message
news:vr******** ****@corp.super news.com...
Is there a reason why you decided not to use the ServiceControll er class?
konst

"Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
news:uK******** ******@TK2MSFTN GP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstalle r.vb

Protected Overrides Sub OnAfterInstall( ByVal savedState As IDictionary)
MyBase.OnAfterI nstall(savedSta te)

Try

Microsoft.Visua lBasic.Shell("n et start IpNotifyService ")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@un isys.spamcom> wrote in message
news:eJ******** *****@TK2MSFTNG P10.phx.gbl...
> See the MSDN Topic "Walkthroug h: Creating a Windows Service Application
in
the
> Component Designer". Maybe you already did, but that refers to a
custom action
> that installs your service. In the Install method (override it) use
> ServiceControll er to start it.
>
> (If your company happens to use a commercial tool from InstallShield, Wise
etc
> etc, you don't need any of the above. They create the right entries
in the
MSI
> file, ServiceInstall and ServiceControl tables, that get the Windows
Installer
> to do literally all of that stuff without you needing to write

code). > --
> Phil Wilson [MVP Windows Installer]
> ----
> "Russ Green" <ru**@NO-SPAMrussgreen.n et> wrote in message
> news:eG******** ******@TK2MSFTN GP09.phx.gbl...
> > I'm using a Setup Project in VB.NET 2003 Standard to install a windows > > service application. I would like this installer to start the service after
> > install. How do I do that?
> >
> > Thanks,
> > Russ
> >
> >
>
>



Jul 21 '05 #9

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

Similar topics

0
1549
by: Jane | last post by:
Hello, I have a windows service applicat written in VB.net. Everything works fine if I install it by using InstallUtil.exe in Command Propt window on both development and target machine. But If I install it by using 'Install' in VS.net IDE (right click on setup project, get a popup menu, click on Install) or run setup.exe in deubg folder...
2
7973
by: Fan Wang | last post by:
Hi All, I wrote a windows service with C# as below. But I can't install it with installutil.exe. I got an error message " Exception occurred while initializing the installation: System.IO.FileNotFoundException: File or assembly name windowsservice1, or one of its dependencies, was not found.. " I am new to C# environment. Any idea any clue...
8
9934
by: Russ Green | last post by:
I'm using a Setup Project in VB.NET 2003 Standard to install a windows service application. I would like this installer to start the service after install. How do I do that? Thanks, Russ
1
7882
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument. I have to do it this way as the consumer of the service should not be able to change the argument - except by uninstalling and reinstalling the...
4
3165
by: kkt49 | last post by:
# vim: et sw=4 ts=8 sts from wxPython.wx import * import sys, os, time import pywintypes import win32serviceutil import win32service import win32event import win32process
3
3067
by: JM | last post by:
Hi, I have created a Solution in VS 2005 with 2 simple projects. First project is simple Windows Service which writes an entry into event log when it starts and when it stops. Nothing else. I have added a projectinstaller also for that. I have used following settings for it (developed in VS 2005 only): 1. For Service1.cs file, I have...
5
7707
by: Ajith Menon | last post by:
I have to install .NET framework 3.0. I already have .NET Framework 1.1 installed on my machine. I don't want to remove framework 1.1 since some of the critical applications are using it. While installing .NET framework 3.0 I got the error: "Microsoft .NET Framework 3.0 x86 has encountered a problem during setup. Setup did not complete...
0
2629
by: Ikado | last post by:
Hi everyone, I am new to PostgreSQL and trying to install it, My login account belongs to "Administrator Group" But I tried after creating newone as User Account(limited).. First i downloaded; postgresql-8.2.msi postgresql-8.2-int.msi upgrade.bat README.TXT
1
20349
by: =?Utf-8?B?Qi5BaGxzdGVkdA==?= | last post by:
Hi all, This is something that I have been toying with for about a week now. What I want to achieve is Install a Service with Customised parameters (using InstallUtil.exe) for User Name. Example (C#); public class MyServiceInstaller : System.Configuration.Install.Installer { private System.ServiceProcess.ServiceProcessInstaller...
0
7548
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7472
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7743
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7986
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5391
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3518
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.