• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

.NET Windows Service/external parameter file

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
bjohns33
Asked:
bjohns33
  • 3
  • 2
1 Solution
 
gregoryyoungCommented:
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
 
bjohns33Author Commented:
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
 
gregoryyoungCommented:
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
 
gregoryyoungCommented:
Did this work ?
0
 
bjohns33Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now