Solved

Continue Setup after reboot

Posted on 1999-01-06
1
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
computer science syllabus 3 116
c++ syntax question 9 66
How to measure current at integrated circuit (IC) power pin using Current Probe ? 6 77
Bitwise and to sum elements 2 53
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

739 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