Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Continue Setup after reboot

Posted on 1999-01-06
1
Medium Priority
?
266 Views
Last Modified: 2010-04-02
In my setup I am checking for some system components..If they are not there I spawn the setup for that component - which asks the user to reboot their machine - when it returns I would like to continue with my setup program.  Any ideas on how to do that?
0
Comment
Question by:gpaige
1 Comment
 
LVL 11

Accepted Solution

by:
alexo earned 200 total points
ID: 1181653
When the user shuts down the system with your application’s window open, you may optionally store information in the registry so that the application’s state is restored when the user starts up Windows. (The system does this for folders.) To have your application’s state restored, store your window and application state information under its registry entries when the system notifies your application that it is shutting down. Store the state information in your application’s entries under HKEY_CURRENT_USER and add a value name–value pair to the RunOnce subkey that corresponds to your application. When the user restarts the system, it runs the command line you supply. Once your application runs, you can use the data you stored to restore its state.

HKEY_CURRENT_USER
    Software
        Microsoft
            Windows
                CurrentVersion
                    RunOnce application identifier = command line
 
If you have multiple instances open, you can include value name entries for each or consolidate them as a single entry and use command-line switches that are most appropriate for your application. For example, you can include entries like the following.

  WordPad Document 1 = C:\Program Files\Wordpad.exe Letter to Bill /restore
  WordPad Document 2 = C:\Program Files\Wordpad.exe Letter to Paul /restore
  Paint = C:\Program Files\Paint.exe Abstract.bmp Cubist.bmp
 
As long as you provide a valid command-line string that your application can process, you can format the entry in a way that best fits your application.

You can also include a RunOnce entry under the HKEY_LOCAL_ MACHINE key. When using this entry, however, the system runs the application before starting up. You can use this entry for applications that may need to query the user for information that affects how Windows starts. Just remember that any entry here will affect all users of the computer.

RunOnce entries are automatically removed from the registry once the system starts up. Therefore, you need not remove or update the entries, but your application must always save its state when the user shuts down the system. The system also supports a Run subkey in both the HKEY_CURRENT_USER and HKEY_LOCAL_ MACHINE keys. The system runs any value name entries under this subkey after the system starts up, but does not remove those entries from the registry. For example, a virus check program can be installed to run automatically after the system starts up. You can also support this functionality by placing a file or shortcut to a file in the Startup folder. The registry stores the location of the Startup folder, as a value in HKEY_CURRENT_USER\Software\Microsoft\ Windows\CurrentVersion\Explorer\Shell Folders.

Also see http://support.microsoft.com/support/kb/articles/q137/3/67.asp
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question