473,513 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relative paths break after install

Sorry about the cross posting to this group but I posted this question for a
coworker last week in the setup board and got no help:
hi,

If my project has subfolders and I have relative paths into those folders
(for images, xml files, etc.), after installing the application on the target
machine, the relative paths are different and nothing works.

This is because during development, the .exe is located in
appFolder/bin/Debug but after install, it is located in appFolder (the
deployment wizard puts it there by default). During development, a path of
"..\..\images" works fine, but after install it should be "\images". What is
the proper .NET way of handling this sort of thing?

I can't seem to change the location where the exectuable is located without
also changing where the subfolders go so that doesn't seem to be the solution.

Any help would be greatly appreciated.

Nov 17 '05 #1
4 1736
I would change the output directory of your project to not be bin/debug but
be some top level directory like MyProjectDirectory, then under this
directory you can copy your image directory.

When you install the product, you images should still be in the correct
relative location because you were no longer building to bin/debug during
development but to the same directory structure (not necessarily the same top
level directory) but the overall directory structure is the same during
development and deployment..

Hope that helps
Mark R Dawson

"Richard" wrote:
Sorry about the cross posting to this group but I posted this question for a
coworker last week in the setup board and got no help:
hi,

If my project has subfolders and I have relative paths into those folders
(for images, xml files, etc.), after installing the application on the target
machine, the relative paths are different and nothing works.

This is because during development, the .exe is located in
appFolder/bin/Debug but after install, it is located in appFolder (the
deployment wizard puts it there by default). During development, a path of
"..\..\images" works fine, but after install it should be "\images". What is
the proper .NET way of handling this sort of thing?

I can't seem to change the location where the exectuable is located without
also changing where the subfolders go so that doesn't seem to be the solution.

Any help would be greatly appreciated.

Nov 17 '05 #2
I would change the output directory of your project to not be bin/debug but
be some top level directory like MyProjectDirectory, then under this
directory you can copy your image directory.

When you install the product, you images should still be in the correct
relative location because you were no longer building to bin/debug during
development but to the same directory structure (not necessarily the same top
level directory) but the overall directory structure is the same during
development and deployment..

Hope that helps
Mark R Dawson

"Richard" wrote:
Sorry about the cross posting to this group but I posted this question for a
coworker last week in the setup board and got no help:
hi,

If my project has subfolders and I have relative paths into those folders
(for images, xml files, etc.), after installing the application on the target
machine, the relative paths are different and nothing works.

This is because during development, the .exe is located in
appFolder/bin/Debug but after install, it is located in appFolder (the
deployment wizard puts it there by default). During development, a path of
"..\..\images" works fine, but after install it should be "\images". What is
the proper .NET way of handling this sort of thing?

I can't seem to change the location where the exectuable is located without
also changing where the subfolders go so that doesn't seem to be the solution.

Any help would be greatly appreciated.

Nov 17 '05 #3
Seamse to be a good idea; does anyone know about problems arising from that?

Christof.

"Mark R. Dawson" <Ma*********@discussions.microsoft.com> schrieb im
Newsbeitrag news:4E**********************************@microsof t.com...
I would change the output directory of your project to not be bin/debug but
be some top level directory like MyProjectDirectory, then under this
directory you can copy your image directory.

When you install the product, you images should still be in the correct
relative location because you were no longer building to bin/debug during
development but to the same directory structure (not necessarily the same
top
level directory) but the overall directory structure is the same during
development and deployment..

Hope that helps
Mark R Dawson

"Richard" wrote:
Sorry about the cross posting to this group but I posted this question
for a
coworker last week in the setup board and got no help:
hi,

If my project has subfolders and I have relative paths into those folders
(for images, xml files, etc.), after installing the application on the
target
machine, the relative paths are different and nothing works.

This is because during development, the .exe is located in
appFolder/bin/Debug but after install, it is located in appFolder (the
deployment wizard puts it there by default). During development, a path
of
"..\..\images" works fine, but after install it should be "\images".
What is
the proper .NET way of handling this sort of thing?

I can't seem to change the location where the exectuable is located
without
also changing where the subfolders go so that doesn't seem to be the
solution.

Any help would be greatly appreciated.

Nov 17 '05 #4
Seamse to be a good idea; does anyone know about problems arising from that?

Christof.

"Mark R. Dawson" <Ma*********@discussions.microsoft.com> schrieb im
Newsbeitrag news:4E**********************************@microsof t.com...
I would change the output directory of your project to not be bin/debug but
be some top level directory like MyProjectDirectory, then under this
directory you can copy your image directory.

When you install the product, you images should still be in the correct
relative location because you were no longer building to bin/debug during
development but to the same directory structure (not necessarily the same
top
level directory) but the overall directory structure is the same during
development and deployment..

Hope that helps
Mark R Dawson

"Richard" wrote:
Sorry about the cross posting to this group but I posted this question
for a
coworker last week in the setup board and got no help:
hi,

If my project has subfolders and I have relative paths into those folders
(for images, xml files, etc.), after installing the application on the
target
machine, the relative paths are different and nothing works.

This is because during development, the .exe is located in
appFolder/bin/Debug but after install, it is located in appFolder (the
deployment wizard puts it there by default). During development, a path
of
"..\..\images" works fine, but after install it should be "\images".
What is
the proper .NET way of handling this sort of thing?

I can't seem to change the location where the exectuable is located
without
also changing where the subfolders go so that doesn't seem to be the
solution.

Any help would be greatly appreciated.

Nov 17 '05 #5

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

Similar topics

7
2770
by: Doug | last post by:
If I were to write an include with a relative path like include("../conf/config.php"); What is the use? As far as I understand it, the path is relative to the first script that is called by...
5
4096
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it...
1
1570
by: olorin_press | last post by:
I have an Access 2000 database in which I display various graphics for each record. I store all the images in a folder ("Images") which is a subdirectory to the directory in which the .mdb is...
0
261
by: Richard | last post by:
Sorry about the cross posting to this group but I posted this question for a coworker last week in the setup board and got no help: hi, If my project has subfolders and I have relative paths...
2
1848
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include...
8
2592
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as the...
15
6434
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
2
4280
by: BD | last post by:
Hi there. Using 8.2 on Windows. I have a situation where I have a db backup, which I want to deploy to a group of developer workstations. The target directory for the database files will be...
2
4295
by: Peted | last post by:
Hi i have a circumstance where a user unzips a file, with a certain layer of directories to get to a textfile. So in any directory on the HDD they may end up with something like ...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7534
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5094
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1601
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.