473,395 Members | 1,656 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,395 software developers and data experts.

manual install of system service

Hello.

I want to install new system service, but not using instalutil, but manualy,
from my application. There is my code, that should do this:

Installer installer = new Installer();
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.User;

ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "TJ";
si.DisplayName = "Test Janos";

si.StartType = ServiceStartMode.Manual;
si.Committed += new InstallEventHandler(CommittedEventHandler);

installer.Installers.Add(si);
installer.Installers.Add(spi);
ListDictionary state = new ListDictionary();

installer.Install(state);

but it throws:

Unhandled Exception: System.NullReferenceException: Object reference not set
to
an instance of an object.
at System.ServiceProcess.ServiceInstaller.Install(IDi ctionary stateSaver)
at System.Configuration.Install.Installer.Install(IDi ctionary stateSaver)
at test.MainClass.Main(String[] args) in Main.cs:line 34

Have anybody any idea, what can i do wrong?

regards,
Pawel Janik

Nov 16 '05 #1
0 2592

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

Similar topics

4
by: DraguVaso | last post by:
Hi, I developped a Windows Service in VB.NET (2005). I need to have it installed two times on 1 machine. When I want to install it a second time, the setup doesn't allow me to install it again...
5
by: Tim V. | last post by:
I was doing a FP8 (8.2) update on my db (Win XP 8.1 fp3) and the process hung (3 hours - no activity) at the end. The system was in la-la land and the instance wouldn't start, so I removed the all...
0
by: Stuart Whelan | last post by:
I am writing a service in C# with an internal service installer. I am running XP Pro SP with VS7.1 and .NET 1.1 It installed okay the first time, but during uninstall the app crashed. Now I...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
4
by: Paul Aspinall | last post by:
Hi I have a service installed, but I want to programatically set it to 'Manual' startup, rather than 'Automatic'. I cannot do this with 'System.serviceProcess.ServiceInstaller()' as I don't...
3
by: Chris Wagner | last post by:
Anyone knows how to install/unistall service with VB.NET without using InstallUtil program? Thanks
2
by: John | last post by:
Hi I have a vb.net service app which I have set to run as user. When I try to install the service via InstallUtil, I provide user/pass for the administrator but the service fails to install. I...
5
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...
1
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
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...
0
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
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...

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.