Eureka! After much searching, I've found that it's possible to install a service from VB.NET using only a couple of lines of code. Here's the URL:
http://weblogs.asp.net/sebastianweber/archive/2004/03/10/87170.aspx
In summary...
You need to add a reference to System.Configuration.Install
To install:
Dim sInstallParams() As String = {"MyService.EXE"}
System.Configuration.Install.ManagedInstallerClass.InstallHelper(sInstallParams)
And to uninstall:
Dim sInstallParams() As String = {"/u", "MyService.EXE"}
System.Configuration.Install.ManagedInstallerClass.InstallHelper(sInstallParams)
http://weblogs.asp.net/sebastianweber/archive/2004/03/10/87170.aspx
In summary...
You need to add a reference to System.Configuration.Install
To install:
Dim sInstallParams() As String = {"MyService.EXE"}
System.Configuration.Install.ManagedInstallerClass.InstallHelper(sInstallParams)
And to uninstall:
Dim sInstallParams() As String = {"/u", "MyService.EXE"}
System.Configuration.Install.ManagedInstallerClass.InstallHelper(sInstallParams)
0 Comments:
Post a Comment
<< Home