Question

I have a VDProj project which I use to create a setup program for my application. I've had to install Visual Studio 2010 (on another machine) to allow me to run this, as it has been removed from VS2012.. very annoying.. but that's a different thread.

When the end user installs the program, it creates the files in the c:\program files\mycompany\ folder, which inherits the security from the parent directory, which has no write access for the user.

The problem is, that when my program runs, it creates some log files, and also does a software update if required. So my application requires write access to the directory.

I'm guessing that I could install the software into the 'MyDocuments' folder, or another folder which has write access, but was wondering if there's a better way of doing this?

No correct solution

OTHER TIPS

When your program needs to write to protected locations like Program Files, you can launch it using ShellExecute functionality and the runas verb/operation. That will trigger a consent dialog from UAC to require an administrator to give permission for the elevation. That would be annoying if it happens too often, so only do it when necessary.

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