473,394 Members | 2,100 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,394 software developers and data experts.

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 1733
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
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
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
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
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
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
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
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
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
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 ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.