Reputation: 1979
I wrote one program that load a text file. it work well. I try to put my program in installer(visual studio .Net2008 ), when I run my program in x64 bit windows 7,my program cannot work because, it try to read below location but it can not access to the file, would you please advice me?
** path of the file creating dynamically!!!
string FILEPATH = Directory.GetCurrentDirectory() + "\\GameData\\savedata.ahd";
the result is this!from this pass my program cannot load the txt file! but in C:\program Files\FTE\Co... I dont have any problem!
C:\Program Files (x86)\FTE\CoTM\GameData\savedata.ahd
Upvotes: 0
Views: 56
Reputation: 14660
You're having access problems, because Windows 7 won't let you access the Program Files directory, see here for more information, and where you should store the files: http://windowsteamblog.com/windows/b/developers/archive/2009/08/04/user-account-control-data-redirection.aspx
Upvotes: 2
Reputation: 5358
you should add the file as a resource to the installer or put it within the same directory level of the installer. Hard coding file paths within setups dont work on machines other than yours.
Upvotes: 0