HOW TO: Control System Restarts in a Setup Project That You Created by Using Visual Studio .NET (827020)
The information in this article applies to:
- Microsoft Windows Installer
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
- Microsoft Platform Software Development Kit (SDK) 1.0
SUMMARYThis step-by-step article describes how to control system
restarts in a setup project that you create by using Microsoft Visual Studio .NET. To
control system restarts, you must use Orca (a Microsoft Windows Installer Development Tool) to modify the property table of the Microsoft Windows Installer file that is created when you build your project. Orca is included with Microsoft Platform Software Development Kit (SDK). It is a good idea to restart your computer if an installation replaces any files that
are in use during the installation process. You can control system restarts in your
Windows Installer file by specifying the value of the REBOOT
property as Force. back to the topRequirementsThe following list outlines the recommended hardware, software,
network infrastructure, and service packs that you need:
- Microsoft Windows 2000, Microsoft Windows XP, or Microsoft
Windows Server 2003
- Microsoft Visual Studio .NET
- Microsoft Platform Software Development Kit
(SDK)
This article assumes that you are familiar with the following
topics:
- System Reboots
- Visual Studio .NET Setup Projects
- Orca.exe
back to the topInstall OrcaTo download and then install Platform SDK (including Orca), visit
the following Microsoft Web site: After
you install Platform SDK, run the Orca.msi file to install Orca. This file is located in the Bin
folder of the installation folder. back to the topCreate a Setup Project- Start Visual Studio .NET.
- On the File menu, point to
New, and then click Project.
- Under Project Types, click
Setup and Deployment Projects.
- Under Templates, click
Setup Project.
- In the Name text box, type
MyRebooter.
- Click OK.
back to the topAdd a File, and then Build Your Setup Project- Create a file that is named Readme.txt. To do this, follow
these steps:
- Start a text editor (such as Notepad).
- Type the following text in the text
editor:
When you install this application, you will be
prompted to restart your computer. - On the File menu, click
Save.
- In the Save As dialog box, locate the
folder where you created the MyRebooter project in step 6 of the "Create a Setup Project" section of this
article.
- In the File name text box, type
Readme.txt.
- Click Save.
- Switch to Visual Studio .NET.
- On the Project menu, point to
Add, and then click File.
- In the Add Files dialog box, locate and
then click the Readme.txt file that you created in step
1.
- Click Open.
The Readme.txt file is added
to the MyRebooter project. - On the Build menu, click Build
MyRebooter.
back to the topModify the Windows Installer File for Your Project by Using Orca- Start Orca.
- On the File menu, click
Open.
- In the Open dialog box, locate and then
click the MyRebooter.msi file that you built in step 6 of the
"Add a File, and Then Build Your Setup
Project" section of this article.
The MyRebooter.msi file
is located in a folder that is named Debug. This Debug folder is located in the
MyRebooter folder where you created your MyRebooter setup project in step 6 of
the "Create a Setup Project" section
of this article. - Click Open.
The MyRebooter.msi file is
opened for editing. - In the left pane, click Property to select
the property table.
- On the Tables menu, click Add
Row.
The Add Row dialog box appears. - In the Property text box, type
REBOOT.
- In the Name field, click
Value.
- In the Value text box, type
Force.
- Click OK.
The REBOOT property and the
associated value are added to the property table. - On the File menu, click
Save.
- On the File menu, click
Exit to quit Orca.
back to the topVerify That Your Application Works- In Microsoft Windows Explorer, locate the Setup.exe file that you built in step 6 of the
"Add a File, and Then Build Your Setup
Project" section of this article.
The Setup.exe file is
located in the same folder as your MyRebooter.msi file. - Run the Setup.exe file.
- In the MyRebooter dialog box, click
Next three times to start installing MyRebooter on your
computer.
- On the Installation Complete page, click
Close to quit your installation.
The
MyRebooter dialog box appears and prompts you to restart your computer. - Click Yes to restart your
computer.
back to the
topREFERENCESFor more
information, visit the following Microsoft Developer Network (MSDN) Web
sites: back to the top
Modification Type: | Minor | Last Reviewed: | 7/11/2005 |
---|
Keywords: | kbtable kbSDK kbProperties kbMiscTools kbPDWizard kbIDEProject kbsetup kbDeployment kbAppSetup kbHOWTOmaster KB827020 kbAudDeveloper |
---|
|
|
©2004 Microsoft Corporation. All rights reserved.
|
|