Indigo Rose Software
  #1  
Old 12-14-2007
Adam's Avatar
Adam Adam is offline
Indigo Rose Staff Member
 
Join Date: May 2000
Location: Indigo Rose Software
Posts: 2,154
Running my Application Only Once

To run your application only once (i.e. the first time the user inserts your CD-ROM, and no other time), place the following code in the On Startup event of your project:
Code:
--retrieve value from the registry. If the key does not exist, result = ""
result = Application.LoadValue("Application_Name", "First_Time");

--if there was no key, the program has never been run
if result == "" then --if there is no value set, the string will be empty
   Application.SaveValue("Application_Name", "First_Time", "yes");
   Dialog.Message("title", "this is the first time this program has run");
else
    Application.Exit();
end
As an alternative you can use Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE) in place of Application.Exit(). This will close the window before the window draws itself (i.e. the user will see nothing).
Reply With Quote
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application Losing Focus when TrueUpdate is running Elleah TrueUpdate 2.0 1 07-06-2005 08:07 AM
Running an Application After Rebooting Desmond AutoPlay Media Studio 5.0 Examples 0 09-26-2003 10:15 AM
Running my Application Only Once Desmond AutoPlay Media Studio 5.0 Examples 0 09-26-2003 09:46 AM
INFO: Dynamically Resizing an Application at Runtime Support AutoPlay Media Studio 4.0 Examples 0 10-21-2002 03:23 PM
HOWTO: Make an AutoPlay Application Expire Support AutoPlay Media Studio 4.0 Examples 0 10-09-2002 11:10 AM


All times are GMT -6. The time now is 10:59 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