I have an application that must run without administrative privileges. I need the application to append to this log no matter the user that runs this application. The log is created by the application. Obviously the Program Files directory is out of the question, considering it requires administrator privs to create files in said directory. It seemed like ProgramData did the trick, and change the write permissions to all users, using File.setWritable(true, false); However, it seems dependent on the UAC settings across different systems, this operation could not be performed, due to lack of sufficient privileges. I confirm this using Windows Explorer, and to change the permissions would require Administrator privileges. So when Java creates the directory in ProgramData, it requires Administrator privileges to change permissions, however when I manually create the directory, I can change folder permissions without requiring administrator privileges. Considering the application is running as my user, why is this behavior different? So this is a two part question, is there a better directory to put this log, and if not, why is the behavior different, how can I set the permissions without requiring administrator privileges.
Thank you greatly