Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > AutoPlay Media Studio 5.0 > AutoPlay Media Studio 5.0 Examples

 
 
Thread Tools Display Modes
  #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 a Certain Number of Executions

AutoPlay Media Studio 5.0 Knowledge Base

Setting my Application to Expire After a Certain Number of Executions

Document ID: IR10062
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 a certain amount of executions.

DISCUSSION

To make your application expire after a certain number of executions, store a value in the registry the first time the program is run, and increment it every consecutive time the program is run. Then, every time the program is run, check the stored value.

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

times_allowed = 30;

times_run = Application.LoadValue("My Application", "Has Been Run");

times_run = String.ToNumber(times_run);

times_remaining = (times_allowed - times_run)



if times_run == "" then

Application.SaveValue("My Application", "Has Been Run", "1");

else

Application.SaveValue("My Application", "Has Been Run", (times_run + 1));

end



if times_run >times_allowed then

Dialog.Message("Trial Period Over", "This software has expired");

Application.Exit();

else

Dialog.Message("Trial Period", "You can run this program "..times_remaining.." more times.");

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, Executions


Last reviewed: October 1, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
 

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 06:56 PM.


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