Solved

.NET Windows Service/external parameter file

Posted on 2004-04-28
5
286 Views
Last Modified: 2008-03-17
I've got a windows service that installs fine using installutil.exe, but in the deployment I want to include a text file that's going to store a number of parameters that will change on each install.

Maybe a text file isn't the best way of doing this, so am open to other ideas, but if it is, how do I get it to be installed as part of the deployment so that I can reference it as "parameters.txt" rather than "c:\...\...\parameters.txt"?

Thanks
Ben
0
Comment
Question by:bjohns33
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10940356
well it would have to be in the current working directory of your webservice

http://www.codeproject.com/Purgatory/FilesandDirectories.asp explains how to get and set this value using System.IO.Directory
0
 
LVL 1

Author Comment

by:bjohns33
ID: 10941006
Sorry Gregory - yes it would have to be there, but the question is how do I get it there as part of the projectinstaller/installutil installer.

Thanks
Ben
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 10941088
http://www.devarticles.com/c/a/C-Sharp/Creating-a-.NET-Windows-Installer--Part-1/6/ this covers it ... and is overall a good tutorial on the installer

http://www.devarticles.com/c/a/C-Sharp/Creating-a-.NET-Windows-Installer--Part-1/7/ 
"Support files" is exactly what you are looking for
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11002205
Did this work ?
0
 
LVL 1

Author Comment

by:bjohns33
ID: 11003399
Hi Gregory

Sorry for the tardy response.

I've ended up going the registry route, but thanks for the pointers, very useful couple of articles.

Cheers
Ben
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question