Create windows installer log

Create windows installer log

Отладочные логи для msi-пакетов можно получить стандартными средствами Windows Installer, запустив установку через командную строку с определенными параметрами.

  1. С зажатым Shift нажимаем на msi-пакет правой кнопкой мыши и выбираем из предложенного диалога Копировать как путь — это в команде будет в место «installer.msi»;
  2. Открываем Командную строку (Заходим в Пуск набираем cmd и Ввод или Win+R вводим cmd и нажимаем OK );
  3. В Командной строке, вводим команду:
  1. Для удобства, создаем рядом с msi -пакетом txt файл и называем его log, так же копируем путь до файла (как в пункте 1 Копировать как путь) — путь до этого файла у нас будет, в место «log.log»;
  2. Нажимаем в Командной строке, ввод, производим установку;
  3. После завершении установки, можно смотреть log.txt.

Предложенный выше способ, подходит если требуется взять диагностический лог для небольшого количества msi-пакетов, если диагностические логи будут требоваться часто, то нам надо включить ведения журнала работы установщика Windows для всех запущенных msi-пакетов:

Вручную создав ветку реестра:

  1. Открываем Редактор реестра (Заходим в Пуск набираем regedit и Ввод или Win+R вводим regedit и нажимаем OK );
  2. Открываем путь HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\ (путь будет одинаковый для x64 и x86);
  3. Нажимаем правой кнопки мыши по папке Windows, выше указанного пути и нажимаем СоздатьРаздел и называем его Installer;
  4. Выделяем раздел Installer, внутри него нажимаем СоздатьСтроковый параметр и называем его Logging;
  5. Открываем параметр Logging и присваиваем ему значение iwearucmopv ;
  6. После этого выполняем установку msi-пакетов;
  7. Файлы логов будет расположены в каталоге TEMP (данную директорию можно открыть зайдя в Пуск набираем %TEMP% и Ввод или Win+R вводим %TEMP% и нажимаем OK)
  8. По завершению сбора логов, обязательно удалите параметр Logging, так как это окажет неблагоприятное воздействие на производительность системы и заполнит дисковое пространство;

Выполнив файл, для автоматической настройки:

  1. Скачиваем архив msi_log.zip;
  2. Открываем скаченный архив, внутри два файла:
    • MSI_log_on.reg — при запуске этого файла, будет включено ведение логов;
    • MSI_log_off.reg — при запуске этого файла, будет отключено ведение логов;
  3. После этого выполняем установку msi-пакетов;
  4. Файлы логов будет расположены в каталоге TEMP (данную директорию можно открыть зайдя в Пуск набираем %TEMP% и Ввод или Win+R вводим %TEMP% и нажимаем OK);
  5. По завершению сбора логов, обязательно выполнить MSI_log_off.reg, так как это окажет неблагоприятное воздействие на производительность системы и заполнит дисковое пространство;

Расшифровка параметров Logging:

Буквы в поле значения могут быть указаны в любом порядке. Каждая буква включает определенный режим записи в журнал. Для MSI версии 1.1 каждая буква имеет следующую текущую функцию:

v – полный вывод
o – сообщения о нехватке места на диске
i — Сообщения состояния
c — Исходные параметры пользовательского интерфейса
e — Все сообщения об ошибках
w – предупреждения об ошибках, не являющихся критичными
a – запуск действий
r — записи, относящиеся к конкретным действиям
m – информация о нехватке памяти или аварийном завершении
u — запросы пользователя
p — свойства терминала
+ — добавить в существующий файл
! — выравнивание строк в журнале
x — дополнительная отладочная информация. Отметка x отображается только в системе Windows Server 2003 или более поздней версии, а также в распространяемом компоненте MSI версии 3.0 или более поздней.

«*» — подстановочный знак: Запись в журнал всей информации, за исключением результатов работы функций v и x. Чтобы включить функции v и x, укажите «/l*vx».

Включения ведения журнала установщика Windows

Windows включает службу ведения журнала с активацией реестра, которая помогает диагностировать проблемы установки Windows. В этой статье описывается, как включить эту службу ведения журнала.

Оригинальная версия продукта: Windows 10 — все выпуски, Windows Server 2012 R2
Исходный номер КБ: 223300

Запись реестра в этой статье действительна для всех операционных систем Windows.

Ведение журнала установщика Windows

Установщик Windows может использовать ведение журнала для устранения неполадок при установке пакетов программного обеспечения. Этот журнал включен путем добавления ключей и значений в реестр. После того как записи были добавлены и включены, можно повторить установку проблемы, и установщик Windows будет отслеживать ход и размещать ее в папке Temp. Имя файла нового журнала является случайным. Однако первыми буквами являются Msi, а имя файла имеет расширение журнала. Чтобы найти папку Temp, введите следующую строку в командной строке:

Читайте также:  Наблюдение за системой windows

Чтобы включить ведение журнала установщика Windows вручную, см. в следующем разделе.

Включить ведение журнала установщика Windows вручную

В этот раздел, описание метода или задачи включены действия, содержащие указания по изменению параметров реестра. Однако неправильное изменение параметров реестра может привести к возникновению серьезных проблем. Поэтому следует в точности выполнять приведенные инструкции. Для дополнительной защиты создайте резервную копию реестра, прежде чем редактировать его. Так вы сможете восстановить реестр, если возникнет проблема. Дополнительные сведения о том, как создать и восстановить реестр, см. в этой информации, как создать и восстановить реестр в Windows.

Чтобы включить ведение журнала установки Windows самостоятельно, откройте реестр с помощью Regedit.exe, а затем создайте следующие подкайки и клавиши:

  • Путь: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer
  • Тип: Reg_SZ
  • Значение: ведение журнала
  • Данные: voicewarmupx

Буквы в поле значения могут идти в любом порядке. Каждая буква включает отдельный режим ведения журнала. Фактическая функция каждой буквы следующим образом для версии MSI 1.1:

  • v — выход verbose
  • o — сообщения из дискового пространства
  • i — Сообщения о состоянии
  • c . Исходные параметры пользовательского интерфейса
  • e . Все сообщения об ошибках
  • w — Предупреждения, не несуществующие смертельным исходам
  • a . Запуск действий
  • r — Записи, определенные для действий
  • m — сведения о выходе из памяти или с летальным исходом
  • u . Запросы пользователей
  • p — Свойства терминала
  • + — Приложение к существующему файлу
  • ! — Смыть каждую строку в журнал
  • x . Дополнительные сведения об отладки. Флаг x доступен только в Windows Server 2003 и более поздних операционных системах, а также в MSI-версии 3.0, а также в более поздних версиях MSI, которые можно перераспределить.
  • * — Под диктовка. Войдите все сведения, кроме параметра v и x. Чтобы включить параметр v и x, укажите /l*vx.

Это изменение должно использоваться только для устранения неполадок и не должно быть оставлено на месте, так как оно будет иметь негативные последствия для производительности системы и дискового пространства. При каждом использовании элемента Добавить или Удалить программы в панели управления создается новый файл Msi*.log. Чтобы отключить ведение журнала, удалите значение реестра журнала.

Включить ведение журнала установщика Windows с помощью групповых политик

Вы можете включить ведение журнала с помощью групповых политик, редактировать соответствующую политику группы OU или Directory. В соответствии с групповой политикой расширяйте конфигурацию компьютера, расширяйте административные шаблоны, расширяйте компоненты Windows, а затем выберите установщик Windows.

Дважды щелкните журнал журнала и нажмите кнопку Включено. В поле Ведение журнала введите параметры, которые необходимо ввести в журнал. Файл журнала Msi.log отображается в папке Temp тома системы.

Дополнительные сведения о журнале MSI см. в справке по Windows. Для этого выберите поиск с помощью журнала msi фразы, а затем выберите параметры управления для компьютеров с помощью групповой политики.

Добавление флага x доступно в Windows Server 2003 и более поздних операционных системах, в MSI-версии 3.0, а также в более поздних версиях MSI, которые можно перераспределить.

Enable Windows Installer logging

Windows includes a registry-activated logging service to help diagnose Windows Installer issues. This article describes how to enable this logging service.

Original product version: В Windows 10 — all editions, Windows Server 2012 R2
Original KB number: В 223300

The registry entry in this article is valid for all Windows operating systems.

Windows Installer logging

Windows Installer can use logging to help assist in troubleshooting issues with installing software packages. This logging is enabled by adding keys and values to the registry. After the entries have been added and enabled, you can retry the problem installation and Windows Installer will track the progress and post it to the Temp folder. The new log’s file name is random. However, the first letters are Msi and the file name has a .log extension. To locate the Temp folder, type the following line at a command prompt:

To enable Windows Installer logging manually, see the following section.

Читайте также:  Compressor mac os download

Enable Windows Installer logging manually

This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.

To enable Windows Installer logging yourself, open the registry by using Regedit.exe, and then create the following subkey and keys:

  • Path: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer
  • Type: Reg_SZ
  • Value: Logging
  • Data: voicewarmupx

The letters in the value field can be in any order. Each letter turns on a different logging mode. Each letter’s actual function is as follows for MSI version 1.1:

  • v — Verbose output
  • o — Out-of-disk-space messages
  • i — Status messages
  • c — Initial UI parameters
  • e — All error messages
  • w — Non-fatal warnings
  • a — Start up of actions
  • r — Action-specific records
  • m — Out-of-memory or fatal exit information
  • u — User requests
  • p — Terminal properties
  • + — Append to existing file
  • ! — Flush each line to the log
  • x — Extra debugging information. The x flag is available only in Windows Server 2003 and later operating systems, and on the MSI redistributable version 3.0, and on later versions of the MSI redistributable.
  • * — Wildcard. Log all information except the v and the x option. To include the v and the x option, specify /l*vx.

This change should be used only for troubleshooting and should not be left on because it will have adverse effects on system performance and disk space. Each time that you use the Add or Remove Programs item in Control Panel, a new Msi*.log file is created. To disable the logging, remove the Logging registry value.

Enable Windows Installer logging with Group Policies

You can enable logging with Group Policies by editing the appropriate OU or Directory Group Policy. Under Group Policy, expand Computer Configuration, expand Administrative Templates, expand Windows Components, and then select Windows Installer.

Double-click Logging, and then click Enabled. In the Logging box, enter the options you want to log. The log file, Msi.log, appears in the Temp folder of the system volume.

For more information about MSI logging, see Windows Help. To do this, search by using the phrase msi logging, and then select Managing options for computers through Group Policy.

The addition of the x flag is available natively in Windows Server 2003 and later operating systems, on the MSI redistributable version 3.0, and on later versions of the MSI redistributable.

How do I create an installation log?

Windows Installer logging

Windows Installer handles its installations through Msiexec.exe. The logging options offered by this tool allow you to create different types of logs, depending on the information you need about the installation. These options are:

  • i — Status messages
  • w — Nonfatal warnings
  • e — All error messages
  • a — Start up of actions
  • r — Action-specific records
  • u — User requests
  • c — Initial UI parameters
  • m — Out-of-memory or fatal exit information
  • o — Out-of-disk-space messages
  • p — Terminal properties
  • v — Verbose output
  • x — Extra debugging information
  • + — Append to existing log file
  • ! — Flush each line to the log
  • * — Log all information, except for v and x options

The logging command is issued by the /L parameter. The above options can be used only after this parameter (the options cannot be used by themselves).

Create a log

The most used logging command is /L*V. This command will create a verbose log which offers a lot of information about the installation. Here are the steps for creating a log:

  1. find out the path of the MSI file, for example C:\MyPackage\Example.msi
  2. decide the path of the log, for example C:\log\example.log
  3. open cmd.exe (you can use any command shell)
  4. use the msiexec command line to launch the MSI with logging parameters

For creating an installation log, you can use a command line which looks like this:

Читайте также:  Как снести windows 10 с ноутбука asus

The /i parameter will launch the MSI package. After the installation is finished, the log is complete.

The example command line uses the sample paths in this How-To. For your package you must use the path of your MSI file.

Note that any logging command line should have this form:

After you use the logging command, you need to specify the log’s complete path. If you want the log to be created next to the MSI, you can specify only the name of the log file:

When the package is included in an EXE bootstrapper, the command line no longer uses «msiexec». For example, the command line can look like this:

In order to create a log for an uninstall process, you can replace the /i parameter with /x. Therefore, a command line which creates a log for an uninstall can look like this:

The package path can also be replaced by the package Product Code (it can be obtained by using the Project -> Options menu inside the project). The command line would look like this:

When the package is included in an EXE bootstrapper and it’s already installed on the machine, you can launch the installer again with the logging command. For example:

This will make the package go into maintenance mode and you can choose to uninstall it. Since the package was launched with logging, an uninstall log will be generated.

Patch Install Log

You can create a log for a patch installation by using the /p parameter instead of /i:

Use the EXE boostrapper

Another approach is to create a log file by using the /L*V parameters in the command line of the Advanced Installer Bootstrapper. Also, these parameters can be always passed to the MSI when the package is launched through the EXE bootstrapper.

If you want your installation package to always create a log, you can follow these steps:

  1. open your installation package’s Advanced Installer project
  2. go to the Builds page and select the Configuration Settings Tab tab
  3. check the EXE setup option
  4. set the MSI Command Line field to: /L*V «C:\package.log»

This way, when the user launches the installation through the bootstrapper, an installation log («package.log») will be created automatically in the «C:\» drive.

The command line received by the bootstrapper overrides the command line in the «MSI Command Line» field. Therefore, if you launch an EXE package with logging parameters, these parameters will be used for creating the log.

Automated logging with the Windows Installer Logging Policy

The logging policy is particularly useful for troubleshooting Active Directory/Group Policy deployments, in which case the installation is carried out without a user interface and there is no possibility to specify a command line for the MSI package.

In order to enable this option, you need to import the registry settings below. Please create a new text file with a «.reg» extension and then copy the following lines into it. After this, double click the «.reg» file you just created and answer «Yes» to the confirmation prompt.

The .LOG file will be created in the currently logged on user’s Temp folder and will have a name in the following format: «MSI*.LOG» .

In case of a Active Directory/GPO deployment, there will be no logged on user at the time the installation occurs. In this case the log file will be created in the «Windows\Temp» folder.

This option should not be left active since every install/uninstall operation of an MSI package will create a new log file, thus unnecessarily occupying disk space. Therefore, this option should only be used for debugging purposes.

In order to disable the debugging policy, you can delete the registry values you have previously added using «RegEdit.exe» or you can import the following .reg file as you did with the previous one:

For information on how to make a custom event appear in the log, please see How to write a specific event in the log

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