- Command-line switches for Microsoft software update packages
- Summary
- More information
- How to Manually Install CAB and MSU Updates in Windows 10
- How to Manually Download the MSU Windows Update File
- Installing MSU Update File in Windows
- How to Extract a CAB File from an MSU Update Package
- Installing a CAB Update File in Windows 10
- Как использовать CAB и MSU файлы для обновления Windows 10 вручную
- Содержание
- Файлы обновления MSU для Windows 10
- Установка пакета обновления MSU
- Файлы обновления CAB для Windows 10
- Как установить обновление CAB
- Добавляем опцию «Установить» для файлов CAB
Command-line switches for Microsoft software update packages
This article describes the consistent set of command-line switches that Microsoft is adopting for deploying packages that contain software updates.
Original product version:  Windows 10 – all editions
Original KB number: В 824687
Summary
Microsoft is adopting a consistent set of command-line switches that you can use to deploy packages that contain software updates, such as security updates, critical updates, and hotfixes. This article describes these new command-line switches and their behaviors.
Packages that support these new command-line switches also support earlier command-line switches for backwards compatibility. However, usage of the earlier switches should be discontinued as this support may be removed in future software updates.
For additional information about command-line switches that are used by Windows software update packages, click the following article number to view the article in the Microsoft Knowledge Base:
262841 Command-line switches for Windows software update packages
For additional information about command-line switches used by Windows Installer, visit the following Microsoft Web site:
For additional information about the standard terminology that Microsoft is adopting to describe software updates, click the following article number to view the article in the Microsoft Knowledge Base:
More information
Microsoft is adopting the following command-line switches for software update packages:
/help; /h; /? — Displays a dialog box that shows the correct usage of the Setup command, including a list of all its command-line switches and their behaviors. You can display this help information in the command-line interface (CLI) or the graphical user interface (GUI). If you use any command-line switch incorrectly, this help switch is invoked and the correct usage is displayed. The dialog box also provides references to more online information.
/quiet — Runs the Setup program or the removal program in «quiet» mode. The program doesn’t prompt the user with any messages. The program enters all messages in a log file. By default, the program restarts the computer with no prompt or warning if the process requires a restart for the changes to take effect. To change the default restart behavior, use a different restart mode.
/passive — Runs the Setup program or the removal program in «passive» mode. The program doesn’t prompt the user with any error messages. The user sees a progress bar that indicates that the installation or the removal is occurring. The user can’t cancel the installation or the removal. By default, the program invokes the /warnrestart switch. If the program is installing multiple updates, the progress bar indicates the progress of the installation or the removal for each update.
/norestart — Doesn’t restart the computer after the installation or the removal, even if the process requires a restart for the changes to take effect.
/forcerestart — Restarts the computer after the installation or the removal, even if the process doesn’t require a restart for the changes to take effect. Restarting forces programs that are running to close.
/warnrestart[:x ] — Invokes a dialog box that warns the user that a restart will occur in x seconds (in 30 seconds if no value is specified). For example, to warn that a restart will occur in 60 seconds, type /warnrestart:60. The dialog box contains a Cancel button and a Restart Now button. If the user clicks Cancel, the computer isn’t restarted.
/promptrestart — Prompts the user that the computer must be restarted for the changes to take effect. The user can select whether to restart the computer.
/uninstall — Removes the package.
/log — Enables the user to define the path for the local log file. This switch invokes the default logging behavior.
/extract — Enables you to extract the installation files to a specified folder.
How to Manually Install CAB and MSU Updates in Windows 10
Windows updates are released as packages with the MSU or CAB extensions. If Windows Update service is not working (or specifically disabled), you can manually download and install the necessary cumulative or security updates for your system. In this article we’ll show how to download and offline install updates in the MSU or CAB file formats in Windows 10.
How to Manually Download the MSU Windows Update File
Initially, Microsoft released security updates and patches in the CAB (Windows cabinet) file format. This is how your computer receives updates from Microsoft update servers or a local WSUS server. To make manual distribution of separate updates using Microsoft Update Catalog more convenient, these CAB files are packed in a special MSU format (Microsoft Update Standalone Installer Package).
You can download MSU Windows updates files (sometimes also CAB files) or files for other Microsoft products from Microsoft Update Catalog (https://www.catalog.update.microsoft.com/). Go to Microsoft Update Catalog, find and download the update you need. For example, I want to install an Adobe Flash Player security update for Windows 10 x64 1507 – KB4056887. Click Download.
Move the file windows10.0-kb4056887-x64_fca8a311f0495e669715ae5aa0e0d8720f945049.msu you have downloaded to the C:\temp folder. Rename it, to get a shorter name: windows10.0-kb4056887-x64.msu
Installing MSU Update File in Windows
To start the installation of a Windows update package, just double-click the MSU file you have downloaded. If the update is applicable to this computer, a Windows Update Standalone Installer window will open, where you will be prompted to confirm the update installation.
You can also install an MSU update package using wusa.exe in the command prompt.
To install the update in a silent mode (a user won’t see any pop-up windows) with a later restart, open the command prompt as administrator and run the following command:
wusa.exe c:\Temp\windows10.0-kb4056887-x64.msu /quiet /norestart
In some time make sure that the update has been installed successfully by running this command:
wmic qfe list | findstr 4056887
Or in the Setup event log, find an entry with the Event ID 2 from the source WUSA and the following message:
Windows update “Security Update for Windows (KB4056887)” was successfully installed. (Command line: “wusa.exe c:\Temp\windows10.0-kb4056887-x64.msu /quiet /norestart”)
How to Extract a CAB File from an MSU Update Package
In some cases when Windows Update that is used by wusa works incorrectly (try to reset Windows Update agent settings first), you can’t install an update in the MSU format. In this case you can unpack MSU package manually, extract a CAB file from it and install it manually in your system.
To unpack an MSU package to C:\Temp\kb4056887 (you have to create this folder in advance), run this command:
expand _f:* “C:\Temp\windows10.0-kb4056887-x64.msu” C:\Temp\kb4056887
Microsoft (R) File Expansion Utility Version 10.0.10011.16384
Copyright (c) Microsoft Corporation. All rights reserved.
Adding C:\Tmp\kb4056887\WSUSSCAN.cab to Extraction Queue
Adding C:\Tmp\kb4056887\Windows10.0-KB4056887-x64.cab to Extraction Queue
Adding C:\Tmp\kb4056887\Windows10.0-KB4056887-x64-pkgProperties.txt to Extraction Queue
Adding C:\Tmp\kb4056887\Windows10.0-KB4056887-x64.xml to Extraction Queue
Expanding Files ….
Expanding Files Complete …
4 files total.
As you can see, 4 file types have appeared in the folder:
- An .xml file (Windows10.0-KB4056887-x64.xml) that contains MSU package metadata and used by wusa.exe;
- A .cab file (Windows10.0-KB4056887-x64.cab — one or more) is an archive with Windows update;
- *pkgProperties.txt file (Windows10.0-KB4056887-x64-pkgProperties.txt) that contains package properties (release date, architecture, package type, a link to the KB, etc.).
Installing a CAB Update File in Windows 10
You can install a CAB update file obtained from an MSU package in two ways.
The most common way to install an update from a CAB file is using DISM.exe. The installation command can look like this:
DISM.exe /Online /Add-Package /PackagePath:c:\Temp\kb4056887\Windows10.0-KB4056887-x64.cab
Deployment Image Servicing and Management tool
Version: 10.0.10240.16384
Image Version: 10.0.10240.16384
Processing 1 of 1 — Adding package Package_for_KB4056887
If you have to install a CAB package in a silent mode with a later restart, use the following DISM command:
start /wait DISM.exe /Online /Add-Package /PackagePath: c:\Temp\kb4056887\Windows10.0-KB4056887-x64.cab /Quiet /NoRestart
In Windows 8 and Windows 7, you can install an update using Pkgmgr. The command is:
start /w Pkgmgr /ip /m:c:»c:\Temp\kb4056887\Windows10.0-KB4056887-x64.cab»
Note: The PkgMgr.exe has been deprecated. Please update your scripts to use dism.exe to extract, install, uninstall, configure and update features and packages for Windows.
This guide on manual installation of cumulative or any other Windows updates is applicable to all supported Windows OS versions: Windows 10 / 8.1 / 7 and Windows Server 2016 / 2012 / R2 / 2008 / R2.
Как использовать CAB и MSU файлы для обновления Windows 10 вручную
Установка обновлений через Центр обновления для Windows 10 иногда может вызывать трудности. Загрузка может зависнуть на определенном этапе из-за проблем с сервером обновлений Windows или серверами сети доставки контента (CDN), на которых размещена копия обновления, предназначенная для дистрибуции в вашем регионе. Также проблемы могут быть связаны с конфигурацией центра обновления Windows и служб фоновой интеллектуальной передачи файлов (BITS) на локальной машине.
В любом случае персонал службы технической поддержки может посоветовать вам загрузить обновление в автономном режиме через каталог Центра обновления Майкрософт.
Каталог Центра обновления Майкрософт предлагает для скачивания обновления системы Windows 10, а также обновления драйверов, которые предназначены для распространения по сети. Кроме того, пакеты Центра обновления Windows, загруженные из каталога Центра обновления Майкрософт, можно свободно использовать для установки в отдельные системы.
Пакеты Центра обновления Windows поставляются в двух форматах: файл автономного установщика Центра обновлений Windows (расширение .msu) и архив Cabinet (расширение .cab).
Содержание
Файлы обновления MSU для Windows 10
Файл обновления Windows Update Standalone Installer (файл с расширением .msu) содержит следующие элементы:
- Метаданные Windows Update: описывают каждое обновление, содержащееся в файле. msu.
- Один или несколько файлов .cab: каждый CAB файл представляет собой отдельное обновление.
- Файл .xml: файл XML описывает пакет обновлений .msu.
- Файл свойств: данный файл включает строковые параметры, используемые Wusa.exe. Например, файл содержит заголовок статьи поддержки в Базе знаний Майкрософт, идентификатор KB и информацию о типе пакета.
Когда вы запускаете файл .msu, процесс автономного установщика Центра обновлений Windows (wusa.exe) извлекает содержимое пакета в папку, считывает метаданные Windows Update, чтобы выполнить поиск обновлений, подходящий для конкретной системы.
Предположим, что в вашей системе установлено более новое обновление или обновление, которые вы хотите применить, предназначено для другой архитектуры процессора (x86, а не x64) – тогда WUSA прекратит процесс установки и выдаст сообщение об ошибке.
Если WUSA определит, что обновление применимо к вашей системе, то запустится процесс установки с помощью компонента Windows Update Agent API.
Установка пакета обновления MSU
Для установки файла MSU, достаточно дважды кликнуть по файлу. Вы можете применить дополнительные параметры (например, /silent для фоновой установки). Полный список параметров доступен на странице описания автономного установщика Центра обновлений Windows.
Файлы обновления CAB для Windows 10
Файлы Cabinet (файлы с расширением .cab) представляют собой сжатые архивы, которые содержат системные файлы и драйверы. Иногда пакеты Центра обновления Windows выпускаются в формате CAB и не содержат механизма установки, файла XML и метаданных. Например, обновление KB4482887 для Windows 10 а канале Release Preview вышло в формате .cab вместо привычного формата .msu.
Как установить обновление CAB
Чтобы установить обновление CAB, нужно воспользоваться инструментом системы обслуживания образов развертывания и управления ими (DISM).
Запустите командную строку с правами администратора и введите команду:
Нажмите Enter. Приведенная для примера команда установит обновление KB4482887 для систем с 64-разрядными процессорами. Файл Windows10.0-KB4482887-x64_91972906e945d162992324224e703e89c208de3d.cab для удоства был переименован в Windows10.0-KB4482887-x64.cab .
Если обновление поставляется в двух форматах – CAB и MSU (например, KB4487044), то удобнее использовать MSU.
Добавляем опцию «Установить» для файлов CAB
Можно добавить команду «Установить» в контекстное меню для файлов CAB. В этом случае вам не придется вручную запускать команду DISM.
Скопируйте следующий код в Блокнот и сохраните его в формате .REG. Затем дважды щелкните по файлу, чтобы применить его содержимое к системному реестру:
После данных манипуляций, в меню правой кнопки мыши для файлов CAB будет доступна опция «Установить».