Indigo Rose Software
  #1  
Old 09-26-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Running my Application Only Once

Running my Application Only Once

Running my Application Only Once

Document ID: IR10013
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 prevent your application from running more than once.

DISCUSSION

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:

--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, Pro Edition users 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).

MORE INFORMATION

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

  • Program Reference | Actions | TextFile | TextFile.WriteFromString

KEYWORDS: AutoPlay Media Studio 5.0, Actions, Write, Text, File, Overwrite, Append, Disk


Last reviewed: September 26, 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 04:48 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