Indigo Rose Software
  #1  
Old 10-01-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Setting my Application to Expire After Thirty Days

Setting my Application to Expire After Thirty Days

Setting my Application to Expire After Thirty Days

Document ID: IR10061
The information in this article applies to:
  • AutoPlay Media Studio 5.0 Standard Edition
  • AutoPlay Media Studio 5.0 Professional Edition

SUMMARY

This article describes how to set your application to expire after thirty days.

DISCUSSION

To make your application expire after thirty days, store the date the program was first run in the registry, and every consecutive time that the program is run, compare the registry to the expiry date (30 days after your program was first installed).

To accomplish this, insert the following code into the On Startup event of your project:

days_left = 30;
date_installed = Application.LoadValue("My Application", "Date Installed");
date_installed = String.ToNumber(date_installed);
time_limit = 30; --the length of the trial period, in days
if date_installed == 0 then
Application.SaveValue("My Application", "Date Installed", System.GetDate(DATE_FMT_JULIAN));
else
days_left = (date_installed + time_limit) - System.GetDate(DATE_FMT_JULIAN);
end

if days_left < 1 then
Dialog.Message("Trial Period Over", "This software has expired");
Application.Exit();
else
Dialog.Message("Trial Period", "You have "..days_left.." days left in your trial period.");
end

MORE INFORMATION

For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:

  • Program Reference | Actions | Application | Application.LoadValue
  • Program Reference | Actions | Application | Application.SaveValue
  • Program Reference | Actions | System | System.GetDate

KEYWORDS: AutoPlay Media Studio 5.0, Expire, Trial, Version


Last reviewed: October 1, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.

Last edited by Desmond; 12-01-2003 at 04:24 PM.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 02:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software