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

Windows Service Installation Registry Setting

I want my users to be able to specify where thier configuration files are
located for a windows service. Since having startup params don't seem to be
a real option here I want to use the registery...however...I can't seem to
get that working either. My installation file has the following bit of
code...

Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(" System");

key = key.OpenSubKey("CurrentControlSet");

key = key.OpenSubKey("Services");

key = key.OpenSubKey(this.serviceInstaller1.ServiceName, true);

key.SetValue("SqlConfig", Environment.CurrentDirectory +
\\SqlConfiguration.xml);

Now if I take out that last line, using installUtil works just
fine....including it and the installUtil rollsback. Any ideas here??

Thanks

-dec
Jul 21 '05 #1
1 4512
What is the error you get with the setvalue call in?

Todd Apley – Visual Basic Deployment Test Team
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| >From: "decrypted" <de*******@earthlink.net>
| >Subject: Windows Service Installation Registry Setting
| >Date: Fri, 12 Sep 2003 13:52:24 -0700
| >Lines: 26
| >X-Priority: 3
| >X-MSMail-Priority: Normal
| >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| >Message-ID: <#Z**************@TK2MSFTNGP10.phx.gbl>
| >Newsgroups: microsoft.public.dotnet.general
| >NNTP-Posting-Host: bdsl.66.14.114.147.gte.net 66.14.114.147
| >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108339
| >X-Tomcat-NG: microsoft.public.dotnet.general
| >
| >I want my users to be able to specify where thier configuration files are
| >located for a windows service. Since having startup params don't seem to
be
| >a real option here I want to use the registery...however...I can't seem
to
| >get that working either. My installation file has the following bit of
| >code...
| >
| >Microsoft.Win32.RegistryKey key =
| >Microsoft.Win32.Registry.LocalMachine.OpenSubKey( "System");
| >
| >key = key.OpenSubKey("CurrentControlSet");
| >
| >key = key.OpenSubKey("Services");
| >
| >key = key.OpenSubKey(this.serviceInstaller1.ServiceName, true);
| >
| >key.SetValue("SqlConfig", Environment.CurrentDirectory +
| >\\SqlConfiguration.xml);
| >
| >Now if I take out that last line, using installUtil works just
| >fine....including it and the installUtil rollsback. Any ideas here??
| >
| >Thanks
| >
| >-dec
| >
| >
| >

Jul 21 '05 #2

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

Similar topics

19
by: Mark C. | last post by:
The company I work for has been running Access 2000 on a Windows NT server with Opportunistic Locking turned off on the server without issue for almost a year. We have just switched to a Windows...
2
by: Brian Campbell | last post by:
Gretings... I have written a Windows Service that accesses a Web Service. Both run fine on my development machine.... After installing both the Windows Service and Web Service on my staging...
2
by: Mark | last post by:
I created an extremely simple windows service that only writes to the EventLogs on Stop and Pause. I installed it using the InstallUtil.exe program, the output of which is below. It appears to be...
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...
1
by: decrypted | last post by:
I want my users to be able to specify where thier configuration files are located for a windows service. Since having startup params don't seem to be a real option here I want to use the...
27
by: pisquem | last post by:
I am building an windows service that is to be deployed on a windows server 2003 and I want to have activity written to the event log, I want its own log called ('CustomLog') Below is what I...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... After I installed my .net windows service, I tried to control some of the behavior with the Start Parameters: in the services control parameter. I can put a value in the box but for some...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.