|
|
Write software that expires?
|
|
|
|
Forum Regular
Join Date: Oct 1999
Location: Baltimore, MD
Status:
Offline
|
|
How is software written that expires (such as Safari betas)? I searched on google and couldn't find anything that really answered my question - and I'm looking for a Mac approach (rather than Windows software). Does anyone have any ideas?
And how would one go about ensuring that the software _stays_ expired?? Just creating a text file somewhere won't solve the problem...
Just curious. Of course I realize a complete format of a drive and reinstall of the OS are impossible to counter, but I'm just looking for an answer to the average case (on the Mac at least) where users don't format/reinstall the OS every week.
Thanks for any help!
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
You have basically two options.
The first is a text file. This can work pretty well if you make it invisible, put it somewhere obscure, and name it in such a way that it's not easily identified. For example, RealBasic makes a file called " Icon" in your preferences folder where the first character is nonprintable and the file is invisible.
The second is to write code that modifies its own binary. Just change a value in a resource that sets it to expired. This is tricky though and works better if your app is a bundle than if it's not.
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
Junior Member
Join Date: May 2002
Location: Okinawa, Japan (Kadena AB)
Status:
Offline
|
|
It also depends on what you want to do. If you want to do a 30 day trial, then the above post is what you should do (one of those two options). If you want to set up your application so that it shut's down on a certain date (say October 1, 2003), then you have to programmatically add that to your program (do a check on startup, if this date doesn't equal "10/01/03" then quit).
Good luck,
- Daniel
|
Daniel Howard | Mac OS X (10.2.2) | TiBook867 /\ iSub w/ Soundsticks /\ iPod
www.midnite-liteman.com | ideaSpiral 1.5.3 / DVD Rack 1.0.2
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
If you're talking about a fixed, one-time expiration -- e.g. this beta version expires on November 1 for everybody -- the simplest way is to just hard-code a date and check against it on startup. In Cocoa...
Code:
NSCalendarDate *expirationDate;
expirationDate = [NSCalendarDate dateWithYear:2003 month:11 day:1 hour:0 minute:0 second:0 timeZone:[NSTimeZone systemTimeZone]];
if ([[NSDate date] compare:expirationDate] == NSOrderedAscending)
// show 'software expired' dialog and quit
Actually, it might also be good to check the date at other times, like when a new document is created, if you're concerned about the app being left running for a long time.
At Omni, expiration dates are a feature of our licensing system; when you buy a license from our online store you get one that never expires, but we can also generate expiring licenses (such as the ones you get from the 'Trial license' links on our store). When we do an expiring beta version of one of our apps, we set a compile-time switch that makes the app not run without a valid license, and then ship it with an expiring license.
If you're looking at making expiring trial versions of your software, then it gets a little more tricky. Usually people expect an "expires N days after you download it" approach. The problem there is that the expiration date then has to be set dynamically by the software itself, instead of set at compile time by the developer. You'd need to record the date somewhere the first time you run the app, and then check against that later to see if you've expired. If you don't record the date securely (or obscurely) enough, some users will realize that they can delete a certain file and keep using your expiring software forever.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 1999
Location: Baltimore, MD
Status:
Offline
|
|
Great responses - got what I needed. Thanks everyone!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|