Indigo Rose Software

Go Back   Indigo Rose Software Forums > Setup Factory 8.0 > Setup Factory 8.0 FAQ

Reply
 
Thread Tools Display Modes
  #1  
Old 04-28-2008
Adam's Avatar
Adam Adam is offline
Indigo Rose Staff Member
 
Join Date: May 2000
Location: Indigo Rose Software
Posts: 2,154
How can I make a Program Run Every Time the System Starts

Question
How can I make a Program Run Every Time the System Starts

Answer
Certain programs run each time the system starts; some are necessary for the operating system to function, and others to provide convenience to the end user. It may be necessary that your program be launched each time the system starts; fortunately Setup Factory can accomplish this easily.

Note: It is considered poor etiquette to do this on a user's system unless it is an essential process, service, or they have agreed to it.

Making your program run every time the system starts amounts to nothing more then creating a Registry entry in the: "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\ \CurrentVersion\\Run" Registry key. The Registry value that you create can be called anything (as long at its length is less then 32 characters), and its value should be the full path to the executable that will be launched when the computer boots.

Note: Since you will be modifying the "HKEY_LOCAL_MACHINE" Registry key make sure that your user has administrative permissions.

Example

Here is an example of a Modify Registry action that will set our program "%AppFolder%\\MyProgram.exe" to run each time the computer starts.

Note: You can place this action on any event during your installation, however it is recommended that this action be placed on the "Before Installing" or "After Installing" event:

Code:
Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "My Program", SessionVar.Expand("%AppFolder%\\MyProgram.exe"), REG_SZ);
This action creates an entry in the "Run" key, which will make our program "MyProgram.exe" launch each time the computer reboots. Since we created this Registry value using an action we will also have to remove the value using an action during the uninstall. If we do not remove this value the user will receive error messages informing them that "MyProgram.exe" could not be found.

Put this action on either the "Before Uninstalling" or "After Uninstalling" event:
Code:
Registry.DeleteValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "My Program");
MORE INFORMATION

For more information please see the following topics in the Setup Factory Help:

Command Reference | Actions | Registry | Registry.GetValue
Command Reference | Actions | Registry | Registry.DeleteValue

Last edited by Adam; 04-29-2008 at 01:35 PM.
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
How to I make this file open with program ptillb1006 AutoPlay Media Studio 6.0 3 08-23-2007 04:04 PM
Check system date/ time every 30 Minutes patrick6 AutoPlay Media Studio 5.0 11 06-16-2004 06:54 PM
access 2000 run time jennersc AutoPlay Media Studio 4.0 0 07-31-2003 01:09 PM
HOWTO: Make an AutoPlay Application Expire Support AutoPlay Media Studio 4.0 Examples 0 10-09-2002 11:10 AM
System Time njlech AutoPlay Menu Studio 3.0 0 07-19-2001 02:24 PM


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