Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Preferences persistent across installations
Preferences persistent across installations [message #754839] Fri, 04 November 2011 15:08 Go to next message
Paul Meehan is currently offline Paul Meehan
Messages: 8
Registered: October 2011
Location: Dublin, Ireland
Junior Member
Hi,

I am looking for a way to persist preferences across installations of successive versions of our product. Specifically, we need to "remember" a license key when a new version is installed. This version may or may not be installed to the same directory as the previous version.

Any pointers appreciated.

thanks
Paul C. Meehan
Re: Preferences persistent across installations [message #754841 is a reply to message #754839] Fri, 04 November 2011 15:10 Go to previous messageGo to next message
Paul Meehan is currently offline Paul Meehan
Messages: 8
Registered: October 2011
Location: Dublin, Ireland
Junior Member
Ideally preferences stored in the Windows registry or an equivalent store on other OS's would seem to make most sense. A globally unique product ID could be the key in the registry, that way all versions of the product would look-up the same entry?
Re: Preferences persistent across installations [message #754847 is a reply to message #754841] Fri, 04 November 2011 15:32 Go to previous messageGo to next message
Paul Meehan is currently offline Paul Meehan
Messages: 8
Registered: October 2011
Location: Dublin, Ireland
Junior Member
Just remembered this can be done with Java Preferences (java.util.prefs.Preferences).

thanks
Re: Preferences persistent across installations [message #755086 is a reply to message #754839] Mon, 07 November 2011 10:44 Go to previous messageGo to next message
Eclipse User
W dniu 2011-11-04 16:08, Paul Meehan pisze:
> Hi,
>
> I am looking for a way to persist preferences across installations of
> successive versions of our product. Specifically, we need to "remember"
> a license key when a new version is installed. This version may or may
> not be installed to the same directory as the previous version.
>

PlatformUI.getPreferenceStore()

and

-data @user.home/.directory/ in Platform arguments
Re: Preferences persistent across installations [message #755622 is a reply to message #754839] Wed, 09 November 2011 03:34 Go to previous messageGo to next message
Michael Pellaton is currently offline Michael Pellaton
Messages: 289
Registered: July 2009
Senior Member
Hi

Why not just store the license key in a file in .eclipse/ in the user's
home directory. There are other plug-ins that exactly do that (Equinox
secure store, ...)

Michael
Re: Preferences persistent across installations [message #755977 is a reply to message #755622] Thu, 10 November 2011 11:22 Go to previous messageGo to next message
Paul Meehan is currently offline Paul Meehan
Messages: 8
Registered: October 2011
Location: Dublin, Ireland
Junior Member
Michael Pellaton wrote on Tue, 08 November 2011 22:34
Hi

Why not just store the license key in a file in .eclipse/ in the user's
home directory. There are other plug-ins that exactly do that (Equinox
secure store, ...)

Michael


I have moved to the idea of storing the license key in a file.

*Problem is I want the same license key file to be available to all users of a machine*

e.g. on Windows 7, no matter what user you log on as you get the same license key. I can't save to the installation directory root as it's in Program Files on Windows 7 which cannot be written to unless your program is "elevated".

So I need a system wide location to read/write the license file, the users home directory won't cut it as it's not visible to ohter users of the same machine.

Paul C. Meehan
Re: Preferences persistent across installations [message #755986 is a reply to message #755977] Thu, 10 November 2011 12:04 Go to previous messageGo to next message
Paul Meehan is currently offline Paul Meehan
Messages: 8
Registered: October 2011
Location: Dublin, Ireland
Junior Member
No Message Body
Re: Preferences persistent across installations [message #755988 is a reply to message #755986] Thu, 10 November 2011 12:06 Go to previous messageGo to next message
Paul Meehan is currently offline Paul Meehan
Messages: 8
Registered: October 2011
Location: Dublin, Ireland
Junior Member
I'm thinking the root of C drive might be best location for a system wide license key file. But is it always guaranteed to be mapped on Windows? What about Linux and OSX?
Re: Preferences persistent across installations [message #755991 is a reply to message #755988] Thu, 10 November 2011 12:23 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
On 2011-11-10 13:06, Paul Meehan wrote:
> I'm thinking the root of C drive might be best location for a system
> wide license key file. But is it always guaranteed to be mapped on
> Windows? What about Linux and OSX?

I cannot speak for non-Windows systems, but I can ensure you, that
storing something like this on the C root directory is a very bad idea
for several reasons.

a) The choice of C doesn't ensure that this is the drive where the
Windows OS is installed.

b) If it is installed there, this drive is often under special write
protection and you shouldn't break that.

On Windows systems you should use something like %ALLUSERSPROFILE% or
%PROGRAMDATA% for that purpose. This exist for exactly that purpose: To
share files among users. Don't forget to assign read access to all users
while installing it.

HTH & Greetings from Bremen,

Daniel Krügler
Re: Preferences persistent across installations [message #756189 is a reply to message #755977] Fri, 11 November 2011 12:42 Go to previous messageGo to next message
Hagen
Messages: 90
Registered: April 2010
Member
On 11/10/2011 12:22 PM, Paul Meehan wrote:
> So I need a system wide location to read/write the license file, the
> users home directory won't cut it as it's not visible to ohter users
> of the same machine.

AFAIK, most license managers solve the problem like:
- they have a default location (%system%\licdata\xyz.lic)
- this default can be overrridden by an environment
and/or registry setting
(possibly also with more than one directory).
Re: Preferences persistent across installations [message #756190 is a reply to message #755988] Fri, 11 November 2011 12:43 Go to previous messageGo to next message
Hagen
Messages: 90
Registered: April 2010
Member
On 11/10/2011 1:06 PM, Paul Meehan wrote:
> I'm thinking the root of C drive might be best location for a system
> wide license key file. But is it always guaranteed to be mapped on
> Windows? What about Linux and OSX?

Also it is a pain in the back if an admin locks the location for a user
to store data there. You need the location configurable by the user.
Re: Preferences persistent across installations [message #756206 is a reply to message #756190] Fri, 11 November 2011 13:34 Go to previous message
Paul Meehan is currently offline Paul Meehan
Messages: 8
Registered: October 2011
Location: Dublin, Ireland
Junior Member
Thanks all
Previous Topic:Spreadsheet-like cell Editor problem
Next Topic:How to enable my RCP application to use Automatic updates?
Goto Forum:
  


Current Time: Thu Oct 23 11:48:58 GMT 2014

Powered by FUDForum. Page generated in 0.03471 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software