Solved

.NET Windows Service/external parameter file

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exit the loop 4 43
User Authentication using Digital Certificate 2 48
Keyboard 2 34
RegEx with optional part 4 26
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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