Detecting your application's install path in Java?
- by Danny King
Hi,
I have made a small application in Java and I would like to make a windows installer for it using the Nullsoft Scriptable Install System (http://nsis.sourceforge.net/Main_Page).
The application I made needs to save user preferences somewhere and it currently saves it in the user's home directory (e.g. c:\Users\danny or /home/users/danny). However if the windows installer installs the application to e.g. c:\Program Files\whatever\ I should probably save the preferences file there too, right?
How would I detect that directory path in Java? What would be a good cross-platform approach to this without losing the benefits of a windows uninstaller for windows users e.g. start menu icons, installer option, etc?
Should I just continue saving my preferences in the user's home path and clutter it up?
Thanks very much,