Detecting your application's install path in Java?
Posted
by Danny King
on Stack Overflow
See other posts from Stack Overflow
or by Danny King
Published on 2010-04-19T19:44:36Z
Indexed on
2010/04/19
19:53 UTC
Read the original article
Hit count: 443
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,
© Stack Overflow or respective owner