View Single Post
 
Old 09-20-2016, 05:25 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,519
Default

When a program is using a relative path to a file it is relative to the current directory. That is only the same as App.Path when you get lucky: they can easily be entirely different things.

I agree, App.Path is not the proper place to put any data files unless they are read-only. You can get away with that for throwaway programs dumped into any random full access part of the filesystem, but it fails for properly installed programs.

If you leave your programs as "legacy" then appcompat usually bypasses the security violation by applying filesystem virtualization. But you don't really want either of those things to occur. The cleanest thing is to use a "Vista aware" manifest and put data files in the proper folders.

Ultimately that's more of a deployment question than a programming question, but the code needs to look in the right place too.
Reply With Quote