When I install my .NET program to C:\Program Files and I run it, it doesn't ask for Admin Rights (Win7), but it can't open any file in the application's directory unless I give admin rights to it manually. If it's not on C, it works well.
I know I can add a custom manifest file to my application to ask the user for admin rights, but it'd ask it always, even when it's not required.
I read on SO that that the software shouldn't write anything to Program Files after it has been installed, but it can't even read a file (for example, language files). I have a database file too, which is read and written by the program, so where should I place this file?
So I'm wondering if it is normal not to have access to read a file without admin rights. How can I make the program ask for admin rights only if it's necessary?
EDIT I'm logged on as system admin.
A normal User does not have write privileges in the Progrem Files folder. You should be able to read (content) files however. How do you open you for-reading files?
The proper way is to use a designated folder. Using WinForms that would be something like
string dataFolder = Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationData);