hi folks - i've successfully deployed a simple unmanaged .NET-less C++ app, and during runtime this code tries to open and read a data file that was deployed along with the app. the application never finds the file, and i've tried a lot of different relative paths in the code... the file is there, correctly deployed and right where i expect it on the target machine, but the app just never finds it where it expects it.
on the dev machine, i have a project folder "A" and the dir structure
.../A/ all sources
.../A/runtime/ folder containing the data file
.../A/Release/ folder containing the application
if, in the code, i provide the filename to open as "./runtime/data.dat" the app finds the file if the app is run from inside visual studio ("Debug > Start Without Debugging"), but does not if i double-click on the app in windows explorer. so, somehow VS knows that the app is sitting in the Release folder and the base directory for any relative paths is the top or code folder.
if, in the code, i provide the filename to open as "../runtime/data.dat" the app does not find the file if the app is run from inside VS, but does find the file if i double-click on the app in windows explorer.
all this makes some sense to me.
but i then build the MSI file using a Setup and Deployment Project, and copy that to another machine, and install it. on the target computer, the file system is set up as
C:\Program Files\MyName\AppDir contains the application etc
C:\Program Files\MyName\AppDir\runtime\ contains the data file
no matter what relative path i try in the code, the deployed application never finds the data file. i've tried things like "runtime/data.dat", "./runtime/data.dat", plus similar versions but with backslashes, plus some i knew couldn't work like "../runtime/data.dat. i even tried using an absolute path in the code that correctly pointed to the location of the data file on the target machine.
no go.
would greatly appreciate any guidance.... cheers,
bill