Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
My Application became Readonly, Installed in windows 7's C:\Program Files\

923153
Member Posts: 10
Hi guys I have created some programs for just learning purpose using Swing, SWT and JavaFx 2.0. I created a installer for them. They work fine after installation except when they are installed in C:\Program files\ in windows7. It become readonly and does not edit the supporting files and even the Sqlite3 database.
Well I know the root of the problem. It is the UAC permission system that requires the Application to run in elevated permission mode to edit any file in C:\Program Files\ folder.
but how to solve it??
Well I know the root of the problem. It is the UAC permission system that requires the Application to run in elevated permission mode to edit any file in C:\Program Files\ folder.
but how to solve it??
Answers
-
Don't install in a protected folder if files need to be modified.
A better solution is to make a clear separation between read only files and writable files. Read only files can go anywhere, as long as files that need to be writable go in the user's home folder where you are guaranteed that the logged in user can write. If you want to be 100% robust you'd give the user the choice of where to put files of course. -
Thanks for the reply.
I agree with your solution but then again the solution raises a concern that if I prompt the user to save the files to where he want then I have to store the location of the files in another file which in turn is to be saved in some writable location..... -
Not necessarily, you could use the java preferences API to store the location for files.
http://docs.oracle.com/javase/1.4.2/docs/guide/lang/preferences.html
It is OS specific where this information is stored; under Windows it will go into the registry for example. -
Thanks a lot....
Preference API looks helpful
This discussion has been closed.