473,385 Members | 1,343 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,385 software developers and data experts.

Setup Project File Path Options

Does anyone know how to set a .NET Setup Project to have it look in
the target directory where the installed files land up, and NOT in "C:
\WINNT\system32"?

After my Windows Service starts up i get the error: "Could not find
file 'C:\WINNT\system32\ConfigFile.txt'" (as it's not there, it's in
the user specified target directory). I.e. my Windows Service has a
config file that it needs to read upon startup...

I tried posting this on .dotnet.general with no responses and I'm
really stuck!

thanks so much, dave

Oct 30 '07 #1
2 5152
Dave wrote:
Does anyone know how to set a .NET Setup Project to have it look in
the target directory where the installed files land up, and NOT in "C:
\WINNT\system32"?

After my Windows Service starts up i get the error: "Could not find
file 'C:\WINNT\system32\ConfigFile.txt'" (as it's not there, it's in
the user specified target directory). I.e. my Windows Service has a
config file that it needs to read upon startup...

I tried posting this on .dotnet.general with no responses and I'm
really stuck!

thanks so much, dave
By default all services seem to run with the startup path set to
%system32%\.

Have a look at the Assembly class.
In particular:
Assembly.GetExecutingAssembly()
Assembly.CodeBase

You should be able to figure out your physical location and read from
there, you may not have permission though.

Why are you not using an app.config file instead, this avoids this whole
problem?

JB
Oct 31 '07 #2
On Oct 30, 10:05 pm, John B <jbngs...@yahoo.comwrote:
Dave wrote:
Does anyone know how to set a .NET Setup Project to have it look in
the target directory where the installed files land up, and NOT in "C:
\WINNT\system32"?
After my Windows Service starts up i get the error: "Could not find
file 'C:\WINNT\system32\ConfigFile.txt'" (as it's not there, it's in
the user specified target directory). I.e. my Windows Service has a
config file that it needs to read upon startup...
I tried posting this on .dotnet.general with no responses and I'm
really stuck!
thanks so much, dave

By default all services seem to run with the startup path set to
%system32%\.

Have a look at the Assembly class.
In particular:
Assembly.GetExecutingAssembly()
Assembly.CodeBase

You should be able to figure out your physical location and read from
there, you may not have permission though.

Why are you not using an app.config file instead, this avoids this whole
problem?

JB
i was avoiding app.config as i didn't want to have to learn all that
is involved with using app.config. i may have to bite the bullet if
it can fix my woes though.

i also need to write to tracing / logging file, and would like to not
write to the system32 directory. files get created there by default
also, but this is secondary in importance to the config file issues.

Oct 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Takuya Matsumoto | last post by:
Greetings to all, I am creating a setup project for a COM component I created in C#, but I can't get the component to be registered in the client system. What I would like to achieve is an...
2
by: serge calderara | last post by:
Dear all, I have build a setup project for my VB.NET application, I need to know the installation path of an application in order to add file in it. How can do that inside my setup project ?...
4
by: Howard Kaikow | last post by:
When I build a setup project, the dependency in the setup project is tied to the version in which it was built. Is there a way to build a setup project that can be used in both versions of the...
0
by: Thom | last post by:
I need a little help in understanding what is happening here. I have been playing with the dbcomm project available from gotdotnet. I try to make a setup project and fail with the following :...
0
bartonc
by: bartonc | last post by:
You can find the original author of the script by ggling " Py2Exe version 6.3 setup" The cool thing about this is that it calls py2exe, just in case you're uncomfortable with the command line. I had...
3
by: sanghavi | last post by:
how to create a set up project in vb.net..how to run an application on a different machine
0
by: henkya | last post by:
Language Used: C# Project Typed: Setup Project (for .NET Window Service) Hi Bump into this issue and seriously have a hunch that this is a bug in the .NET setup project. These are the scenario:...
0
by: dot | last post by:
I spent a few headache filled days trying to use GMP on windows (XP pro) I finally got it to work and since I found little help on the Web I thought someone might find what i did useful. ...
1
by: Blau | last post by:
While trying to learn from some sample projects i'm running into a problem. The setup that I have is One Solution with two projects. (usually a library that is being developed along side an...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.