473,490 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
Create 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 1813
implement a Commit override in your installer class and use
ServiceController to do that.

"Russ Green" <ru**@NO-SPAMrussgreen.net> wrote in message
news:eG**************@TK2MSFTNGP09.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 "Walkthrough: 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
ServiceController 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.net> wrote in message
news:eG**************@TK2MSFTNGP09.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****************@TK2MSFTNGP12.phx.gbl...
implement a Commit override in your installer class and use
ServiceController to do that.

"Russ Green" <ru**@NO-SPAMrussgreen.net> wrote in message
news:eG**************@TK2MSFTNGP09.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
ProjectInstaller.vb

Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)

MyBase.OnAfterInstall(savedState)

Try

Microsoft.VisualBasic.Shell("net start IpNotifyService")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@unisys.spamcom> wrote in message
news:eJ*************@TK2MSFTNGP10.phx.gbl...
See the MSDN Topic "Walkthrough: 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
ServiceController 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.net> wrote in message
news:eG**************@TK2MSFTNGP09.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 ServiceController class?

konst

"Russ Green" <ru**@NO-SPAMrussgreen.net> wrote in message
news:uK**************@TK2MSFTNGP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstaller.vb

Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)

MyBase.OnAfterInstall(savedState)

Try

Microsoft.VisualBasic.Shell("net start IpNotifyService")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@unisys.spamcom> wrote in message
news:eJ*************@TK2MSFTNGP10.phx.gbl...
See the MSDN Topic "Walkthrough: 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
ServiceController 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.net> wrote in message
news:eG**************@TK2MSFTNGP09.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 ServiceController class?

konst

"Russ Green" <ru**@NO-SPAMrussgreen.net> wrote in message
news:uK**************@TK2MSFTNGP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstaller.vb

Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)

MyBase.OnAfterInstall(savedState)

Try

Microsoft.VisualBasic.Shell("net start IpNotifyService")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@unisys.spamcom> wrote in message
news:eJ*************@TK2MSFTNGP10.phx.gbl...
See the MSDN Topic "Walkthrough: 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
ServiceController 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.net> wrote in message
news:eG**************@TK2MSFTNGP09.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.supernews.com...
Is there a reason why you decided not to use the ServiceController class?

konst

"Russ Green" <ru**@NO-SPAMrussgreen.net> wrote in message
news:uK**************@TK2MSFTNGP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstaller.vb

Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)

MyBase.OnAfterInstall(savedState)

Try

Microsoft.VisualBasic.Shell("net start IpNotifyService")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@unisys.spamcom> wrote in message
news:eJ*************@TK2MSFTNGP10.phx.gbl...
See the MSDN Topic "Walkthrough: 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
ServiceController 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.net> wrote in message
news:eG**************@TK2MSFTNGP09.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*********@unisys.spamcom> wrote in message
news:OL**************@TK2MSFTNGP11.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.supernews.com...
Is there a reason why you decided not to use the ServiceController class?
konst

"Russ Green" <ru**@NO-SPAMrussgreen.net> wrote in message
news:uK**************@TK2MSFTNGP12.phx.gbl...
Thanks for your answers guys. Did it with the following code in
ProjectInstaller.vb

Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)
MyBase.OnAfterInstall(savedState)

Try

Microsoft.VisualBasic.Shell("net start IpNotifyService")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

"Phil Wilson" <ph*********@unisys.spamcom> wrote in message
news:eJ*************@TK2MSFTNGP10.phx.gbl...
> See the MSDN Topic "Walkthrough: 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
> ServiceController 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.net> wrote in message
> news:eG**************@TK2MSFTNGP09.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
1541
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...
2
7969
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:...
8
9928
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
7876
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....
4
3158
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
3057
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...
5
7702
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...
0
2627
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; ...
1
20320
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...
0
6974
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...
0
7146
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,...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4878
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...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
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 ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
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...

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.