Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

Licence code storing for java app

Thread view: 
mark - 05 Nov 2006 12:32 GMT
Hello,

I want to create a app which will have something similar to licence
(i.e. user have to enter licence code to run the app). The problem
arises when I want to make it that user have to specify it only once.
So I need to store somewhere the information, that the app has already
been activated. I am thinking about main jar file (as something which
can work ,although it is nothing sophisticated), but when I add extra
characters at the end then my jar was corrupted :(. Do you know any
nice way to do this:)? Thank you!

Regards, mark
Ian Wilson - 06 Nov 2006 14:38 GMT
> Hello,
>
[quoted text clipped - 3 lines]
> So I need to store somewhere the information, that the app has already
> been activated.

I'd store it in a java.util.Properties file in the user directory
appropriate for the platform.

On *nix that might be ~username/.appname.properties

On Windows that might be C:\Documents and Settings\username\Application
Data\YourCo\YourApp\appname.properties

See also java.util.prefs.Preferences.

> I am thinking about main jar file (as something which
> can work ,although it is nothing sophisticated), but when I add extra
> characters at the end then my jar was corrupted :(. Do you know any
> nice way to do this:)? Thank you!

I'm pretty sure Application jar files are not intended to be used for
storing volatile data like user preferences.
LaieTechie - 08 Nov 2006 08:42 GMT
> when I add extra characters at the end then my jar was corrupted :(. Do
> you know any nice way to do this:)? Thank you!

You cannot just add raw characters to the end of a JAR - they must be
contained in a file within that JAR.  This is a hassle to do inside Java,
so follow the advice of others by creating an extra file.

One software that I use creates a text file in my home directory with a
license code (this also contains expiration information, and whether it is
a trial or purchased version).  Upon invocation, this software does a
checksum on that license code (make sure it wasn't tampered with) and
extracts the other encoded information.  It also sends out a broadcast
message to make sure no other copies with that same license code are
currently in use on the network.

HTH,
La`ie Techie


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.