Question

I've recently discovered that my app malfunctions on Win 7 machines because it does not have permission to create files/sub directories in its install directory. This is something the app needs to be able to do and I found out that it behaves fine if it is run at an admin privilege level.

I would like to ensure the app can create the sub directories and files as required, in the simplest way possible - allowing permissions automatically if possible. Ideally this would be without having to ask the user to manually enable the "run as admin" feature on my executable.

What is the best way to automatically achieve this?

I found this question: How do I deploy applications in run as administrator mode?

Does it apply? Is that the best way?

It seems to me like this restriction is unnecessary in Win 7 - apps should be able to manipulate files, at least in their own directory.

Thanks

Was it helpful?

Solution

Your app likely installs under the program files directory and you have to assume that you can't write to that directory. You also should run without admin rights since some users won't have them. Thus you should follow the platform guidelines and store files that you need to modify in a location where standard uses can modify them. This issue will also affect you on Vista.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top