Solved

.NET Windows Service/external parameter file

Posted on 2004-04-28
5
282 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now