P
Phill W.
Is it [still] possible to write a Windows Service such that it can
install /itself/ based on a command-line argument?
I've got my Service (in VB'2005) with its own, integral Installer which
/works/ when fed into InstallUtil but, for .. "Reasons" .. I'd prefer to
"drive" this all from the executable. I can't work out how to "invoke"
the installer from Sub Main of the service. I keep getting
NullReferenceExceptions from inside the ServiceInstaller's Install method:
' Create my service's installer (added via the IDE)
' This invokes initializeComponent(), which adds
' /two/ Installers (ServiceInstaller and ServiceProcessInstaller)
Dim installer as New ProjectInstaller()
' Something to hold "state" in
Dim state as IDictionary = new Hashtable()
Try
If bInstall Then
installer.Install(state) <- BOOM!
NullReferencEexception
at System.ServiceProcess.ServiceInstaller.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at (namespace) ... Program.SelfInstallService(Boolean install)
in (source file) ...\\Program.vb:line 68
Any suggestions?
TIA,
Phill W.
install /itself/ based on a command-line argument?
I've got my Service (in VB'2005) with its own, integral Installer which
/works/ when fed into InstallUtil but, for .. "Reasons" .. I'd prefer to
"drive" this all from the executable. I can't work out how to "invoke"
the installer
NullReferenceExceptions from inside the ServiceInstaller's Install method:
' Create my service's installer (added via the IDE)
' This invokes initializeComponent(), which adds
' /two/ Installers (ServiceInstaller and ServiceProcessInstaller)
Dim installer as New ProjectInstaller()
' Something to hold "state" in
Dim state as IDictionary = new Hashtable()
Try
If bInstall Then
installer.Install(state) <- BOOM!
NullReferencEexception
at System.ServiceProcess.ServiceInstaller.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at (namespace) ... Program.SelfInstallService(Boolean install)
in (source file) ...\\Program.vb:line 68
Any suggestions?
TIA,
Phill W.