Portable IDE loosing permissions in Program Files Folder

I am using a Portable Arduino IDE in a modified scratch programming software. When I install the software with the Portable Arduino IDE into the Program Files (x86) folder, then the permissions on the Portable/preferences.txt file get changed from “user-modify” to “user-read and execute” and the Portable Arduino IDE will not start. In this case the Portable Arduino IDE hangs after preparing boards and closes with this error java.io.FileNotFoundException: C:\Program Files (x86)\QpetScratch\Arduino\portable\preferences.txt (Access is denied)

If I manually change the permission of the preferences.txt back to user-modify after installing into the Program Files (86) directory, then the Portable Arduino IDE starts file. But I need an automated installation for this software without having to change the permissions manually after installing.

The Portable Arduino IDE is in widespread use I think, so I wonder how others have overcome this problem.
How can you let the Portable Arduino IDE preferences.txt file keep its user-modify settings after installing it into the Porgram Files (x86) directory?
Thanks, Drew

When using the portable IDE, you should not install it under program files, but rather to a location which you have full permissions for. Windows User Account Control places special protections on the Program Files folders - non-administrator users are not allowed to freely modify the files in these locations (that would mean that one user changing settings would impact the settings for all users; this is contrary to the new windows security model introduced in Windows Vista).

That's why the non-portable installation stores these settings under app data, rather than in the install location like it used to. Microsoft intentionally tries to prevent user processes from modifying anything under program files or other protected locations.