Microsoft windows restartmanager что это

About Restart Manager

The primary reason software installation and updates require a system restart is that some of the files that are being updated are currently being used by a running application or service. Restart Manager enables all but the critical applications and services to be shut down and restarted . This frees the files that are in use and allows installation operations to complete. It can also eliminate or reduce the number of system restarts that are required to complete an installation or update.

The Restart Manager stops applications in the following order, and after the applications have been updated, restarts applications that have been registered for restart in the reverse order.

  1. GUI applications
  2. Console applications
  3. Windows services
  4. Windows explorer

Restart Manager shuts down application or services only if the caller has permission to do so. Note that shutdown across sessions is not supported.

Applications that use the Windows Installer version 4.0 for installation and servicing automatically use the Restart Manager to reduce system restarts. Custom installers can also be designed to call the Restart Manager API to shut down and restart applications and services. In cases where a system restart is unavoidable, installers can use the Restart Manager API to schedule restarts in such a way that it minimizes the disruption of the user’s work flow.

For information about using the Restart Manager API during installation and updates, see Using Restart Manager.

Critical system services cannot be stopped and restarted by the Restart Manager without a system restart. For more information about identifying critical system services, see Critical System Services.

Your applications and services should be prepared to be shut down by the Restart Manager and save user data and state information that are needed for a clean restart. For more information about how to prepare your applications and services to work with the Restart Manager, see Guidelines for Applications and Services.

For reference information about the enumerations, structures, and functions of the Restart Manager API, see the Restart Manager Reference section

Restart Manager

Purpose

The Restart Manager API can eliminate or reduce the number of system restarts that are required to complete an installation or update. The primary reason software updates require a system restart during an installation or update is that some of the files that are being updated are currently being used by a running application or service. The Restart Manager enables all but the critical system services to be shut down and restarted. This frees files that are in use and allows installation operations to complete.

Where applicable

The Restart Manager DLL exports a public C interface that can be loaded by standard or custom installers. The installer can use the Restart Manager to register files that should be replaced during the installation of an application or update. Then during a subsequent update or installation, the installer can use the Restart Manager to determine which files cannot be updated because they are currently in use. Restart Manager can shut down and restart the non-critical services or applications that are currently using those files. Installers can direct the Restart Manager to shut down and restart applications or services based on the file in use, the process ID (PID), or the short-name of a Windows service.

Читайте также:  Extract pages from pdf linux

Restart Manager is intended for the development of desktop style applications.

Developer audience

This documentation is intended for developers of installation applications who want to take advantage of the installer capabilities in Windows Vista or Windows Server 2008. Applications that use the Windows Installer version 4.0 for installation and servicing automatically use the Restart Manager to reduce system restarts. Custom installers can also be designed to call the Restart Manager API to shut down and restart applications and services. In cases where a system restart is unavoidable, installers can use the Restart Manager API to schedule restarts in such a way that it minimizes the disruption of the user’s work flow.

Run-time requirements

The Restart Manager API is available beginning with Windows Vista and Windows Server 2008. Restart Manager consists of a single DLL that applications can load to access the Restart Manager API.

Restart Manager in Windows 10

Starting with Windows Vista, Microsoft has introduced a new application called as the Restart Manager to eliminate or reduce the number of system restarts that are required to complete an installation or update.

Windows Restart Manager

Let’s say, if an application or Windows 10/8/7/Vista itself, needs to update itself, the Installer calls upon the Restart Manager, to see if it can clear that part of the system so that it can be updated. If it can do that, it does so, and this happens without a reboot.

And if this cannot be done, then what it does is that it takes a snapshot of the system, together with the applications, at that very moment, and then it just updates and restarts the application, or in the case of an operating system update, it will bring the operating system back exactly where it was, after the reboot!

Let’s say a user is working on a Word document, say, winvistaclub.doc and the cursor was on coordinates, say col 5, line 7. And the system has to update either or both of them.

The Restart Manager does 5 things:

  1. It looks for all processes that are using this file.
  2. It then shuts down such processes
  3. Applies the updates
  4. Restarts those processes
  5. Preserves the exact state of each running process and then restores that state upon restarting the process.

Freeze Drying

This feature will re-open a closed document and restore the cursor to, say, col 5, line 7, the exact position it was, when the document was closed. This is called Freeze drying the program. The Restart Manager works in tandem with Microsoft Update, Windows Update, Microsoft Windows Server Update Services, Microsoft Software Installer and Microsoft Systems Management Server, to detect processes that have files in use and to stop and restart services without the need to restart the entire machine. The full functionality of ‘Restart Manager’ is presently available only to select applications written to take advantage of it. Microsoft Office is one of them.

Читайте также:  Не запускаются сетевые службы windows

Side-by-side compliant Dll files

For those programs which do not support Restart Manager, Windows has introduced what is called as the Side-by-side compliant dll’s. This enables a program to write a new version of a dll, to the hard disk, even if the old one is still in use. Only when you shut down the program does Windows replace the old version with the new one!

One, therefore, see’s fewer post-update reboots in Windows 10/8/7/Vista.

Microsoft Windows Vista. Механизмы обеспечения надежности приложений. Часть 2. Restart Manager

В предыдущей части данной статьи (см. КомпьютерПресс № 1’2007) мы начали рассмотрение ряда механизмов обеспечения надежности приложений, реализованных в новой версии операционной системы Microsoft — Windows Vista. Мы обсудили механизм Windows Feedback Platform, позволяющий компаниям-разработчикам централизованно получать данные о сбоях в приложениях и на основе анализа этих данных выпускать обновления, которые будут распространяться среди пользователей с помощью средств, реализованных в Windows Vista. Еще один механизм обеспечения надежности приложений — это набор программных интерфейсов и компонентов ядра операционной системы, известный под названием Restart Manager. Данный механизм может использоваться как программами установки (инсталляторами) для снижения необходимости перезагрузок операционной системы за счет отслеживания занятых приложениями ресурсов и перезапуска приложений, так и непосредственно прикладными программами для обеспечения возможности восстановления после сбоев и восстановления данных.

Механизм Restart Manager

В основе механизма Restart Manager лежат две функции. Вызов функции RegisterApplicationRestart() позволяет вашему приложению перезапуститься после сбоя и отсылки отчета о произошедшем сбое (используя рассмотренные ранее механизмы Windows Feedback Platfrom), таким образом обеспечивая пользователю возможность продолжить работу. Вызов еще одной функции из состава Restart Manager — RegisterApplicationRecoveryCallback() — позволит вам указать ядру Windows Vista, какую функцию вашего приложения нужно вызывать перед непосредственным перезапуском приложения — следовательно, у вас появляется возможность сохранения данных с их последующим восстановлением после перезапуска приложения.

При вызове функции RegisterApplicationRestart() указывается командная строка, применяемая для повторного запуска приложения, — таким образом, используя опции командной строки, параметры или другие способы, вы можете указать приложению на то, что оно запускается после сбоя, и инициировать процесс восстановления данных.

Функция RegisterApplicationRecoveryCallback() задает точку входа в приложение, которая вызывается ядром операционной системы после сбора данных, необходимых для генерации отчета о произошедшем сбое. При получении управления приложение должно попытаться сохранить данные на диске. В процессе сохранения данных необходимо вызывать функцию RecoveryInProgress() приблизительно каждые 5 с для того, чтобы операционная система помнила о том, что приложение находится в процессе сохранения данных, — в противном случае ядро операционной системы сочтет приложение зависшим и принудительно завершит его выполнение. Это необходимо в тех случаях, когда попытка сохранения данных приводит к дополнительному сбою в приложении и появляется возможность «зацикливания» обработки сбоев. По завершении сохранения данных вызывается функция RecoveryFinished().

Читайте также:  Udp to http прокси для windows

Сигналом для завершения работы Windows-приложения является получение сообщений WM_QUERYENDSESSION и WM_ENDSESSION со значением параметра LPARAM, равным ENDSESSION_CLOSEAPP (0x1).

Консольные приложения должны проверять нажатие комбинации клавиш Ctrl+C. Ниже показан пример обработчиков событий для Windows-приложения и консольного приложения.

hr = RegisterApplicationRestart(CommandLineParameter, NULL);

Microsoft Windows Vista. Механизмы обеспечения надежности приложений

В предыдущей части данной статьи (см. КомпьютерПресс № 1’2007) мы начали рассмотрение ряда механизмов обеспечения надежности приложений, реализованных в новой версии операционной системы Microsoft — Windows Vista. Мы обсудили механизм Windows Feedback Platform, позволяющий компаниям-разработчикам централизованно получать данные о сбоях в приложениях и на основе анализа этих данных выпускать обновления, которые будут распространяться среди пользователей с помощью средств, реализованных в Windows Vista. Еще один механизм обеспечения надежности приложений — это набор программных интерфейсов и компонентов ядра операционной системы, известный под названием Restart Manager. Данный механизм может использоваться как программами установки (инсталляторами) для снижения необходимости перезагрузок операционной системы за счет отслеживания занятых приложениями ресурсов и перезапуска приложений, так и непосредственно прикладными программами для обеспечения возможности восстановления после сбоев и восстановления данных.

Механизм Restart Manager

В основе механизма Restart Manager лежат две функции. Вызов функции RegisterApplicationRestart() позволяет вашему приложению перезапуститься после сбоя и отсылки отчета о произошедшем сбое (используя рассмотренные ранее механизмы Windows Feedback Platfrom), таким образом обеспечивая пользователю возможность продолжить работу. Вызов еще одной функции из состава Restart Manager — RegisterApplicationRecoveryCallback() — позволит вам указать ядру Windows Vista, какую функцию вашего приложения нужно вызывать перед непосредственным перезапуском приложения — следовательно, у вас появляется возможность сохранения данных с их последующим восстановлением после перезапуска приложения.

При вызове функции RegisterApplicationRestart() указывается командная строка, применяемая для повторного запуска приложения, — таким образом, используя опции командной строки, параметры или другие способы, вы можете указать приложению на то, что оно запускается после сбоя, и инициировать процесс восстановления данных.

Функция RegisterApplicationRecoveryCallback() задает точку входа в приложение, которая вызывается ядром операционной системы после сбора данных, необходимых для генерации отчета о произошедшем сбое. При получении управления приложение должно попытаться сохранить данные на диске. В процессе сохранения данных необходимо вызывать функцию RecoveryInProgress() приблизительно каждые 5 с для того, чтобы операционная система помнила о том, что приложение находится в процессе сохранения данных, — в противном случае ядро операционной системы сочтет приложение зависшим и принудительно завершит его выполнение. Это необходимо в тех случаях, когда попытка сохранения данных приводит к дополнительному сбою в приложении и появляется возможность «зацикливания» обработки сбоев. По завершении сохранения данных вызывается функция RecoveryFinished().

Сигналом для завершения работы Windows-приложения является получение сообщений WM_QUERYENDSESSION и WM_ENDSESSION со значением параметра LPARAM, равным ENDSESSION_CLOSEAPP (0x1).

Консольные приложения должны проверять нажатие комбинации клавиш Ctrl+C. Ниже показан пример обработчиков событий для Windows-приложения и консольного приложения.

hr = RegisterApplicationRestart(CommandLineParameter, NULL);

Оцените статью