Solved

Continue Setup after reboot

Posted on 1999-01-06
1
213 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 50 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now