473,608 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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();
ServiceProcessI nstaller spi = new ServiceProcessI nstaller();
spi.Account = ServiceAccount. User;

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

si.StartType = ServiceStartMod e.Manual;
si.Committed += new InstallEventHan dler(CommittedE ventHandler);

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

installer.Insta ll(state);

but it throws:

Unhandled Exception: System.NullRefe renceException: Object reference not set
to
an instance of an object.
at System.ServiceP rocess.ServiceI nstaller.Instal l(IDictionary stateSaver)
at System.Configur ation.Install.I nstaller.Instal l(IDictionary 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 2608

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

Similar topics

4
386
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 in an other directory, but only to repair or remove the other version. I get arround this by simply copying the files of the first installed in a second directory.
5
1955
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 the software hoping that the instance would go with it. No such luck I tried a reistall, but no luck. I then tried to do a manual removal of the instance via regedit. I got most of the entries, but there were some "legacy" entries that...
0
2757
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 am unable to install again: Running a transacted installation. Beginning the Install phase of the installation.
3
56950
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 want to test this service on a Windows Server 2003 box that doesn't have the Visual Studio Command prompt. How do I go about installing the service on the Windows Server 2003 box? Thanks!
4
6121
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 actually install the service (MSDE does), but I want it set to Manual, and my app starts and stops it. I can Start and Stop the service, but need it to be Manual, and not Automatic
3
13776
by: Chris Wagner | last post by:
Anyone knows how to install/unistall service with VB.NET without using InstallUtil program? Thanks
2
6085
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 have received the following two messages on two separate occasions; An exception occurred during the Install phase. System.ComponentModel.Win32Exception: No mapping between account names and security IDs was done
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 correctly." Error Signature:
1
20366
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 serviceProcessInstaller;
0
8063
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8003
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8498
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8341
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6817
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6014
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3962
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2474
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
1
1598
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.