How to perform version checking and registration...

edited August 2017 in Library Questions

Hello -

I've been working on getting a beta version of my processing app out to potential users and I've been working on some features that will help keep the customer up to date and also provide some 'registration' capabilities in this beta version. I imagine that eventually we will be rebuilding this program in C++ or Python and bundling it with some kind of installer or other compiling capabilities but for now, we are working with the processing beta version.

I have two questions:


I've come up with a pretty good solution (I think) that allows for the program to check if they are using the most recent version. It's pretty simple;

I use loadStrings() to check a .txt file hosted on a remote server. The file consists of two lines. The most recent version number and the address where the user can visit to download the latest version.

float currentVersion = .3;
float newestVersion;
String updateURL;

boolean showUpdate = false;

ControlP5 updateBtn;

void checkVersion(){
  String[] lines = loadStrings(".txt file link");
  if (float(lines[0]) > currentVersion) { 
    showUpdate = true; 
    newestVersion = float(lines[0]);
    updateURL = lines[1];;

void showUpdateDialouge(){
   rect(width/2, height/2, 300, 300);
   textAlign(CENTER, CENTER);
   text("There is a new version of available! You are currently using v." + currentVersion +". The most recent update is v."+ newestVersion +
     ".  to update click the UPDATE Button.", width/2, height/2, 300, 150);

void UPDATE(){
  showUpdate = false;

void LATER(){
   showUpdate = false;

Question #1: Does this approach leave any major security vulnerabilities for my program. If so, are there any other suggestions for how to accomplish this?


I was hoping to use a similar approach for "registration" purposes. Is there a way to encode a unique serial number onto each copy of the app and try to allow the app to only be installed on a limited number of computers, etc?

My current rough idea is to;

  1. hard code a "serial number" on each app sent to a customer
  2. when the app starts up, write a file (encrypted) to the users HD with a unique code.
  3. write to a .txt file on a remote server the serial number
  4. On each startup, the program checks the remote .txt and cross references the 'serial' with the unique HD code
  5. The HD code on the remote server must match the unique code stored on the users HD and serial number of the program

The most obvious flaw is that the user can just copy the .txt file to a new computer. But this would take a pretty savvy user and I see it as a small contingency.

Question #2: Is there a better way to approach this or is it even possible? If this is the best way to approach it, what is the best way to start? I have been looking at writing to a remote .txt file using processing and AJAX or JQuery but I'm not entirely sure how to get into this? Do I need to set up server-side scripting for this? Any other thoughts?



Sign In or Register to comment.