• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Avoiding multiple installations of Swing based application

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am creating a Swing based application which will have some questions topic wise . How can I prevent multiple installations of my application ? How should I distribute it ?

Also the questions will be in a file . How should I encrypt them so that they are not copied/decrypted easily ?
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Normally if you want a single installation that users in multiple places want to use, then I would recommend a web-application. But since you already have a Swing application, how about a WebStart application?

Turning your application into a WebStart app normally doesn't require making any changes to it, although you do have some limitations wrt access to the file system. You just need to provide a file that basically says which jars your app needs, what is the main class, etc. (This is the JNLP file.)

I've never done anything with encryption, so I wouldn't know how to encrypt a file, stick it in a jar and decrypt it from your program. But you can put the file on a web-server (normal HTTP with regular username and password authentication which you hard-code into your app?) and retrieve it when the program runs.
 
Xia Lee
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul.

My application would be sent via email . I dont have a site to host my application as a Web application or via Webstart.

Kindly suggest me some way to prevent users installing the same application over multiple machines.
 
Paul Balm
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh I see. I thought the problem was you wanted to prevent users (or yourself) from having to make many installations on many different computers, for convenience basically. But you want some sort of copyright protection - even if users want to make multiple installations, you want to inhibit them from doing that.
Is that correct?

And you don't have any kind of server that you can have users connect to, to "activate" your program, such that each e-mail address is allowed to "activate" only once.

I know it can be done, because DRM (digital rights management) does this: You buy a song in the wrong music store, and if they want, they can only allow you to listen to it only n times. The idea would be that you use the same technique to allow installation only 1 time. But I don't know how it works. Anyone?

It's not really a Swing topic but more something of a security issue, by the way.
 
Xia Lee
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you are right Paul .

Anyone who can help me .

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two libraries -one open source, one commercial- for implementing license schemes in Java are listed in http://faq.javaranch.com/java/JavaIntermediateFaq#licensing

If the files are part of the application, then ultimately there is no way to protect them. You can make it harder using encryption and code obfuscation, but a determined attacker will be able to prevail. If the target audience is not very experienced very few may be able to do that, though; depends on who uses the application.
 
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not an advanced user and this may sound stupid, but for "file encription" I just use a custom method to turn whatever text file I want into a different base (let's say hex-16), I then do a bit shift on it x number of positions (pref odd number), and then I save the file with a .bmp extension and mislabel it. Why? Because who out there ever sees a .bmp file in a directory and thinks "I wonder if this picture is really the answers to this program just in disguise"? Also, even if they did try and open it in a Hex editor it would be shifted out of place... someone would have to know that the base was changed and the shift amount, and if someone is going through that much trouble then they can have it, lol. I wouldn't recommend this method for any corporate software or anything but if this is your own small project and you need a quick and dirty method that's what I use. :P

 
reply
    Bookmark Topic Watch Topic
  • New Topic