1

I have a set of python scripts that will potentially be shared with 3rd party users. When they were being used strictly internally, we had issues with our staff using deprecated versions of the script. I incorporated the following version check that forces users to update their scripts when an update is released.

CURRENT_VERSION = "61022050"

def version_check():
    try:
        response = urllib2.urlopen(url)
        html = response.read()
        d = json.loads(html)
    except Exception: #Version Check Failed.

    if (d["version"] != CURRENT_VERSION):
        #Version Check Outdated.  Provide link to download.

    #Version Check Passed.

This form of version check worked really well, but I was told that in some use cases, internet access will not be available, so this form of version check will automatically fail in those cases.

Are there other forms of version checking that don't require internet use that can ensure that users are using the latest release of the scripts? I've considered releasing new versions each week and hard coding a date into the code, but it is so easy to change the system date and get around that.

4
  • 4
    "and get around that" - You can't prevent stupid. Commented May 4, 2016 at 20:21
  • Are your third party users individuals using your program for personal use or companies using it for professional use? Are you making major functional changes weekly or just minor tweaks? Commented May 4, 2016 at 22:21
  • @BHawk It is for company use. Each revision I have released has corrected parsing issues that could have caused confusion later on. Commented May 4, 2016 at 22:52
  • Some users won't upgrade - and that's even less likely on the machines that don't have an internet connection. My suggestion is to stick with the current system, write a good terms-and-conditions, have the "check failed" option print a reminder, and let users be responsible for themselves... But honestly I'd love to learn about a nice, working, "smart-ish user"-proof method in this thread. Commented May 5, 2016 at 17:15

1 Answer 1

2

The date idea is not a bad one if you really think that writing an update each week is practical. In the case of commercial software it is usually the IT manager's responsibility to update their user's software in 3rd party cases, not the software's author.

You could set the date that the software initially runs using datetime.datetime.now() or time.time() and then save that variable out as a binary support file on the user's local drive (preferably somewhere not obvious). Then do a check for the reference file on launch with a check of time passed, as well as a check to see if the date has gone backwards.

As an additional layer of support you could write an update batch script that an IT manager could run from an internet connected computer that automatically downloads your update and distributes it to the LAN connected user base. The update script could even be run as a cron job/scheduled task so that it runs automatically once a week.

As Jared stated, someone who is desperate enough could always circumvent your best efforts. The goal is to make it just complicated enough to sabotage the system, that the user doesn't put in the effort.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.