473,326 Members | 2,013 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,326 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 4508
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.