Windows installer msi command line

The Windows Installer technology uses Msiexec.exe
for installing MSI and MSP packages. But what is Msiexec.exe? Msiexec.exe is a process present on any modern Windows operating system that is triggered whenever an MSI or MSP is executed.

Msiexec

Using the built in msiexec switches, you gain full control over the installation process, giving you the ability to set:

  • install options (install, uninstall, administrative install,
    advertise a product)
  • display options (full, basic or no UI during the
    installation)
  • restart options (if the machine will be restarted after the
    installation)
  • logging options
  • update options (apply or remove updates)
  • repair options (only for an installed package)
  • public properties which are used
    by the installation

The usual form of the msiexec command line is this:

msiexec.exe <install_option> <path_to_package> [package_parameters]

Install Options

When launching an installation package, you can set the install type through multiple msiexec.exe switches. Here you have the ability to enable a normal install or uninstall. In addition, you can create an administrative install which helps you create an image of the program on a defined share location which can later be used to actually trigger the install. Also you can benefit of advertising the product to the user under which the installation occurs.

These msiexec switches are:

msiexec.exe [/i][/a][/j{u|m|/g|/t}][/x] <path_to_package>
  • /i — normal installation
  • /a — administrative install
  • /j — advertise the product
    • u
      advertise to the current user
    • m — advertise to all users
    • /g — the language identifier used by the advertised
      package
    • /t — apply transform to advertise
      package
  • /x — uninstall the package

Sample command line:

msiexec.exe /i "C:\Example.msi"

NoteWant to create MSI’s, EXE bundles, or MSIX
packages? Download
Advanced Installer now.

Display Options

The user interface level of the installation can be configured according to the target environment. For example, a package distributed to clients should have a full UI, while a package deployed through Group Policy or Configuration Management tools such as InTune, Endpoint Manager, MECM, SCCM, should have no user interface. In enterprise environments where administrators handle the software deployment, a silent installation is needed.

Msiexec.exe sets the UI level of the installation through these switches:

msiexec.exe /i <path_to_package> [/quiet][/passive][/q{n|b|r|f}]
  • /quiet — quiet mode (there is no user
    interaction)
  • /passive — unattended mode (the installation shows
    only a progress bar)
  • /q — set the UI level:
    • n — no
      UI
    • n+ — no UI except for a modal dialog box displayed
      at the end.
    • b — basic UI
    • b+ — basic UI with a modal dialog box displayed at
      the end. The modal box is not displayed if the user cancels the
      installation. Use qb+! or qb!+ to hide the [ Cancel ]
      button.
    • b- — basic UI with no modal dialog boxes. Please
      note that /qb+- is not a supported UI level. Use qb-! or qb!- to
      hide the [ Cancel ] button.
    • r — reduced UI
    • f — full UI

Sample command line:

This command line executes a silent install with a progress bar display. The user has no cancel button.

msiexec.exe /i "C:\Example.msi" /qb!

Progress bar display

This command line gives no display. It executes a silent install in the background.

msiexec.exe /i "C:\Example.msi" /qn

Restart Options

Sometimes an installation overwrites files which are in use or
needs to reboot the machine in order to finish it. The reboot policy
used by the installation can be set through these options:

msiexec.exe /i <path_to_package> [/norestart][/promptrestart][/forcerestart]
  • /norestart — the machine will not be restarted after
    the installation is complete
  • /promptrestart — the user will be prompted if a
    reboot is required
  • /forcerestart — the machine will be restarted after
    the installation is complete

Sample command line:

msiexec.exe /i "C:\Example.msi" /norestart

Logging Options

When debugging an installation package you can use multiple
logging parameters in order to create a
log. Also, when deploying a package in an enterprise environment via any configuration manager tool, it is best to always include the log file switch. This log file will contain different information for each parameter you use:

msiexec.exe [/i][/x] <path_to_package> [/L{i|w|e|a|r|u|c|m|o|p|v|x+|!|*}][/log]
<path_to_log>
  • /L — enable logging
    • i — include
      status messages
    • w — include non-fatal warnings
    • e — include all error messages
    • a — mention when an action is started
    • r — include action-specific records
    • u — include user requests
    • c — include the initial UI parameters
    • m — include out-of-memory or fatal exit
      information
    • o — include out-of-disk-space messages
    • p — include terminal properties
    • v — verbose output
    • x — include extra debugging information
    • + — append to an existing log file
    • ! — flush each line to the log
    • * — log all information, except for v
      and x options
  • /log — the equivalent of /l*

Sample command line:

msiexec.exe /i "C:\Example.msi" /L*V "C:\package.log"

Update Options

The Windows Installer command line can apply or remove updates
(patches for example) through these msiexec.exe switches:

msiexec.exe [/p][/update][/uninstall[/package<product_code_of_package>]]
<path_to_package>
  • /p — install an MSP patch. When installing a patch
    silently, you need to set REINSTALLMODE property to «ecmus» and
    REINSTALL to «ALL». Otherwise the patch will simply update the MSI
    cached on the target machine.
  • /update — apply updates (if there are multiple
    updates, you can separate them through the «;»
    character).
  • /uninstall — remove an update for a product (if there
    are multiple updates, you can separate them through the
    «;» character)

    • /package — specifies
      the package for which the update is removed.

Sample command lines:

msiexec.exe /p "C:\MyPatch.msp"
msiexec.exe /p "C:\MyPatch.msp" /qb REINSTALLMODE="ecmus" REINSTALL="ALL"
msiexec.exe /update "C:\MyPatch.msp"
msiexec.exe /uninstall {1BCBF52C-CD1B-454D-AEF7-852F73967318}
  /package {AAD3D77A-7476-469F-ADF4-04424124E91D}

NoteIn the above command line the first GUID is the Patch identifier
GUID and the second one is the Product Code of the MSI for which the
patch was applied.

Repair Options

If you have an installed package, you can use the Windows
Installer command line for repairing it using the folowing msiexec.exe switches:

msiexec.exe [/f{p|o|e|d|c|a|u|m|s|v}] <product_code>
  • /f — repair a package
    • p — repair
      only if a file is missing
    • o — repair if a file is missing or an older version
      is installed
    • e — repair if file is missing or an equal or older
      version is installed
    • d — repair if a file is missing or a different
      version is installed
    • c — repair if a file is missing or the checksum
      does not match the calculated value
    • a — forces all files to be reinstalled
    • u — repair all the required user-specific registry
      entries
    • m — repair all the required computer-specific
      registry entries
    • s — repair all existing shortcuts
    • v — run from source and recache the local
      package

Sample command line:

msiexec.exe /fa {AAD3D77A-7476-469F-ADF4-04424124E91D}

NoteIn the above command line the GUID is the Product Code of the MSI
which will be repaired.

Set public properties

The name of a public property contains only uppercase letters
(for example PROPERTY). This type of properties can
be set through the command line like this:
PROPERTY=»value».

Sample command line:

msiexec.exe /i "C:\Example.msi" MY_PROP="myValue"

Video tutorial — Msiexec.exe switches

  • 13.02.2020
  • 30 825
  • 0
  • 04.10.2021
  • 17
  • 16
  • 1

MSIEXEC - описание команды и примеры использования

  • Содержание статьи
    • Описание
    • Установка и настройка продукта
      • Синтаксис
      • Параметры
      • Примечания
      • Примеры
    • Использование режима административной установки
      • Синтаксис
      • Параметры
      • Примечания
      • Примеры
    • Восстановление продукта
      • Синтаксис
      • Параметры
      • Примечания
      • Примеры
    • Удаление продукта
      • Синтаксис
      • Параметры
      • Примечания
      • Примеры
    • Объявление продукта
      • Синтаксис
      • Параметры
      • Примечания
      • Примеры
    • Установка уровня ведения журнала
      • Синтаксис
      • Параметры
      • Примечания
      • Примеры
    • Справочная информация
    • Добавить комментарий

Описание

MSIEXEC — Средство установки, изменения и выполнения операций установщика Windows из командной строки.

Эта команда поддерживается в CMD.EXE и в PowerShell.

Установка и настройка продукта

Синтаксис

msiexec /i {пакет|код_продукта}

Параметры

  • /i — Установка или настройка продукта.
  • пакет — Имя файла пакета установщика Windows.
  • код_продукта — Глобальный уникальный идентификатор (GUID) пакета установщика Windows.

Примечания

  • Регистр букв при вводе параметров командной строки установщика Windows не учитывается.

Примеры

Чтобы установить продукт из файла A:\Example.msi, введите:

msiexec /i A:\Example.msi

Использование режима административной установки

Синтаксис

msiexec /a пакет

Параметры

  • /a — Выбор режима административной установки.
  • пакет — Имя файла пакета установщика Windows.

Примечания

  • Регистр букв при вводе параметров командной строки установщика Windows не учитывается.

Примеры

Чтобы установить продукт из файла A:\Example.msi в режиме административной установки, введите:

msiexec /a A:\Example.msi

Восстановление продукта

Синтаксис

msiexec /f [p][o][e][d][c][a][u][m][s][v]{пакет|код_продукта}

Параметры

  • /f — Включение одного или нескольких параметров командной строки, перечисленных в следующей таблице.
  • пакет — Имя файла пакета установщика Windows.
  • код_продукта — Глобальный уникальный идентификатор (GUID) пакета установщика Windows.
Параметр Описание
p Переустановка только в случае отсутствия файла.
o Переустановка при отсутствии файла или если установлена его старая версия.
e Переустановка при отсутствии файла или если установлена его текущая либо старая версия.
d Переустановка в случае отсутствия файла или если установлена другая его версия.
c Переустановка в случае отсутствия файла или в случае, если контрольная сумма не совпадает с вычисленным значением.
a Принудительная переустановка всех файлов.
u Перезапись всех необходимых пользовательских записей реестра.
m Перезапись всех необходимых записей реестра компьютера.
s Перезапись всех имеющихся ярлыков.
v Запуск файлов из источника и повторное кэширование локального пакета.

Примечания

  • Параметром по умолчанию для этой командной строки является параметр /fpecms.
  • Регистр букв при вводе параметров командной строки установщика Windows не учитывается.

Примеры

Чтобы восстановить пакет установки, введите:

msiexec /fpecms Example.msi

Удаление продукта

Синтаксис

msiexec /x {пакет|код_продукта}

Параметры

  • /x — Удаление продукта.
  • пакет — Имя файла пакета установщика Windows.
  • код_продукта — Глобальный уникальный идентификатор (GUID) пакета установщика Windows.

Примечания

  • Регистр букв при вводе параметров командной строки установщика Windows не учитывается.

Примеры

Чтобы удалить или отменить установку пакета, введите:

msiexec /x Example.msi

Объявление продукта

Синтаксис

msiexec /j [{u|m}] пакет
msiexec {u|m} пакет /t список_преобразований
msiexec {u|m} пакет /g код_языка

Параметры

  • /j — Объявление продукта. u — Объявление для текущего пользователя. m — Объявление для всех пользователей компьютера.
  • пакет — Файл пакета установщика Windows.
  • /g код_языка — Служит для задания языка.
  • /t список_преобразований — Применение преобразований к объявляемому пакету.

Примечания

  • При необходимости установить приложение с повышенными привилегиями используйте параметр /jm.
  • Регистр букв при вводе параметров командной строки установщика Windows не учитывается.

Примеры

Чтобы объявить пакет для всех пользователей этого компьютера, введите:

msiexec /jm Example.msi

Установка уровня ведения журнала

Синтаксис

msiexec /L [i][w][e][a][r][u][c][m][p][v][+][!]файл_журнала.txt

Параметры

  • /L — Путь к файлу журнала.
  • i — Занесение в журнал сообщений о состоянии.
  • w — Занесение в журнал некритических предупреждений.
  • e — Занесение в журнал сообщений об ошибках.
  • a — Занесение в журнал выполнения действий.
  • r — Занесение в журнал записей со сведениями о действиях.
  • u — Занесение в журнал запросов пользователей.
  • c — Занесение в журнал исходных параметров пользовательского интерфейса.
  • m — Занесение в журнал нехватки памяти.
  • p — Занесение в журнал свойств терминала.
  • v — Занесение в журнал подробных сведений. Для использования параметра v следует задавать /L*v.
  • + — Добавление в существующий файл.
  • ! — Сброс в журнал каждой строки.
  • * — Занесение в журнал всех сведений, кроме параметра v. Это подстановочный знак.
  • файл_журнала.txt — Имя и путь к текстовому файлу журнала.

Примечания

  • Регистр букв при вводе параметров командной строки установщика Windows не учитывается.
  • Чтобы включить в файл журнала параметр v при использовании подстановочного знака, введите в командной строке /L*v.
  • Параметры файла журнала установщика Windows могут также использоваться для процессов удаления и восстановления.

Примеры

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

msiexec /i Example.msi /L ime logfile.txt

Справочная информация

msiexec /Option <обязательный параметр> [необязательный параметр]

Параметры установки
</package | /i> Установка или настройка продукта
/a Административная установка — установка продукта в сеть
/j<u|m> [/t <список преобразований>] [/g <код языка>]
Объявление о продукте: «m» — всем пользователям; «u» — текущему пользователю
</uninstall | /x> Удаление продукта
Параметры отображения
/quiet
Тихий режим, без взаимодействия с пользователем
/passive
Автоматический режим — только указатель хода выполнения
/q[n|b|r|f]
Выбор уровня интерфейса пользователя
n — Без интерфейса
b — Основной интерфейс
r — Сокращенный интерфейс
f — Полный интерфейс (по умолчанию)
/help
Вывод справки по использованию
Параметры перезапуска
/norestart
Не перезапускать после завершения установки
/promptrestart
Запрашивать перезапуск при необходимости
/forcerestart
Всегда перезапускать компьютер после завершения установки
Параметры ведения журнала
/l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <файл_журнала>
i — сообщения о состоянии
w — сообщения об устранимых ошибках
e — все сообщения об ошибках
a — запуски действий
r — записи, специфические для действий
u — запросы пользователя
c — начальные параметры интерфейса пользователя
m — сведения о выходе из-за недостатка памяти или неустранимой ошибки
o — сообщения о недостатке места на диске
p — свойства терминала
v — подробный вывод
x — дополнительные отладочные сведения
+ — добавление в существующий файл журнала
! — сбрасывание каждой строки в журнал
* — заносить в журнал все сведения, кроме параметров «v» и «x»
/log <файл_журнала>
Равнозначен /l* <файл_журнала>
Параметры обновления
/update [;Update2.msp]
Применение обновлений
/uninstall <Код_Guid_обновления>[;Update2.msp] /package Удаление обновлений продукта
Параметры восстановления
/f[p|e|c|m|s|o|d|a|u|v] Восстановление продукта
p — только при отсутствии файла
o — если файл отсутствует или установлена старая версия (по умолчанию)
e — если файл отсутствует или установлена такая же либо старая версия
d — если файл отсутствует или установлена другая версия
c — если файл отсутствует или контрольная сумма не совпадает с подсчитанным значением
a — принудительная переустановка всех файлов
u — все необходимые элементы реестра, специфические для пользователя (по умолчанию)
m — все необходимые элементы реестра, специфические для компьютера (по умолчанию)
s — все существующие ярлыки (по умолчанию)
v — запуск из источника с повторным кэшированием локальных пакетов

Standard Installer Command-Line Options

The executable program that interprets packages and installs products is Msiexec.exe.

Note  Msiexec also sets an error level on return that corresponds to
System Error Codes.

The following table identifies the standard command-line options for this program. Command-line options are case insensitive.

Windows Installer 2.0:  The command-line options that are identified in this topic are available beginning with Windows Installer 3.0. The Windows Installer Command-Line Options are available with Windows Installer 3.0 and earlier versions.

Option Parameters Meaning
/help  

Help and quick reference option. Displays the correct usage of the setup command including a list of all switches and behavior. The description of usage can be displayed in the user interface.
Incorrect use of any option invokes this help option.

Example: msiexec /help

Note  The equivalent Windows Installer Command-Line Option is /?.

/quiet  

Quiet display option.
The installer runs an installation without displaying a user interface.
No prompts, messages, or dialog boxes are displayed to the user.
The user cannot cancel the installation. Use the /norestart or /forcerestart standard command-line options to control reboots. If no reboot options are specified, the installer restarts the computer whenever necessary without displaying any prompt or warning to the user.

Examples:

msiexec /package Application.msi /quiet

Msiexec /uninstall Application.msi /quiet

Msiexec /update msipatch.msp /quiet

Msiexec /uninstall msipatch.msp /package Application.msi / quiet

Note  The equivalent Windows Installer Command-Line Option is /qn.

/passive  

Passive display option. The installer displays a progress bar to the user that indicates that an installation is in progress but no prompts or error messages are displayed to the user.
The user cannot cancel the installation. Use the /norestart or /forcerestart standard command-line options to control reboots. If no reboot option is specified, the installer restarts the computer whenever necessary without displaying any prompt or warning to the user.

Example: msiexec /package Application.msi /passive

Note  The equivalent Windows Installer Command-Line Option is /qb!- with REBOOTPROMPT=S set on the command line.

/norestart  

Never restart option. The installer never restarts the computer after the installation.

Example: msiexec /package Application.msi /norestart

Note  The equivalent Windows Installer command line has REBOOT=ReallySuppress set on the command line.

/forcerestart  

Always restart option. The installer always restarts the computer after every installation.

Example: msiexec /package Application.msi /forcerestart

Note  The equivalent Windows Installer command line has REBOOT=Force set on the command line.

/promptrestart  

Prompt before restarting option. Displays a message that a restart is required to complete the installation and asks the user whether to restart the system now. This option cannot be used together with the /quiet option.

Note  The equivalent Windows Installer command line has REBOOTPROMPT = «» set on the command line.

/uninstall <Package.msi|ProductCode>

Uninstall product option. Uninstalls a product.

Note  The equivalent Windows Installer Command-Line Option is /x.

/uninstall /package <Package.msi | ProductCode> /uninstall <Update1.msp | PatchGUID1>[;Update2.msp | PatchGUID2]

Uninstall update option. Uninstalls an update patch.

Note  The equivalent Windows Installer Command-Line Option is /I with MSIPATCHREMOVE=Update1.msp | PatchGUID1[;Update2.msp | PatchGUID2]
set on the command line.

/log <logfile>

Log option. Writes logging information into a log file at the specified existing path. The path to the log file location must already exist. The installer does not create the directory structure for the logfile.

The following information is entered into the log:

  • Status messages
  • Nonfatal warnings
  • All error messages
  • Start up of actions
  • Action-specific records
  • User requests
  • Initial UI parameters
  • Out-of-memory or fatal exit information
  • Out-of-disk-space messages
  • Terminal properties

Note  The equivalent Windows Installer Command-Line Option is /L*.

Note  For more information about all the methods that are available for setting the logging mode, see Normal Logging in the Windows Installer Logging section.

/package <Package.msi|ProductCode>

Install product option. Installs or configures a product.

Note  The equivalent Windows Installer Command-Line Option is /I.

/update <Update1.msp>[;Update2.msp]

Install patches option. Installs one or multiple patches.

Note  The equivalent Windows Installer command line has PATCH = [msipatch.msp]<;PatchGuid2> set on the command line.

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.

To install Horizon 7 components silently, you must use Microsoft Windows Installer (MSI) command-line options and properties. The Horizon 7 component installers are MSI programs and use standard MSI features.

For details about MSI, see the Microsoft Web site. For MSI command-line options, see the Microsoft Developer Network (MSDN) Library Web site and search for MSI command-line options. To see MSI command-line usage, you can open a command prompt on the Horizon 7 component computer and type msiexec /?.

To run a Horizon 7 component installer silently, you begin by silencing the bootstrap program that extracts the installer into a temporary directory and starts an interactive installation.

At the command line, you must enter command-line options that control the installer’s bootstrap program.

Table 1.
Command-Line Options for a Horizon 7 Component’s Bootstrap Program

Option Description
/s Disables the bootstrap splash screen and extraction dialog, which prevents the display of interactive dialogs.

For example: VMware-viewconnectionserver-y.y.yxxxxxx.exe /s

The /s option is required to run a silent installation.

/v» MSI_command_line_options« Instructs the installer to pass the double-quote-enclosed string that you enter at the command line as a set of options for MSI to interpret. You must enclose your command-line entries between double quotes. Place a double quote after the /v and at the end of the command line.

For example: VMware-Horizon-Agent-x86-y.y.y-xxxxxx.exe /s /v»command_line_options«

To instruct the MSI installer to interpret a string that contains spaces, enclose the string in two sets of double quotes. For example, you might want to install the Horizon 7 component in an installation path name that contains spaces.

For example: VMware-viewconnectionserver-y.y.yxxxxxx.exe /s /v»command_line_options INSTALLDIR=»»d:\abc\my folder»»»

In this example, the MSI installer passes on the installation-directory path and does not attempt to interpret the string as two command-line options. Note the final double quote that encloses the entire command line.

The /v»command_line_options« option is required to run a silent installation.

You control the remainder of a silent installation by passing command-line options and MSI property values to the MSI installer, msiexec.exe. The MSI installer includes the Horizon 7 component’s installation code. The installer uses the values and options that you enter in the command line to interpret installation choices and setup options that are specific to the Horizon 7 component.

Table 2.
MSI Command-Line Options and MSI Properties

MSI Option or Property Description
/qn Instructs the MSI installer not to display the installer wizard pages.

For example, you might want to install Horizon Agent silently and use only default setup options and features:

VMware-Horizon-Agent-x86-y.y.y-xxxxxx.exe /s /v»/qn»

Alternatively, you can use the /qb option to display a basic progress dialog box in a noninteractive, automated installation.

The /qn or /qb option is required to run a silent installation.

For information about additional /q parameters, see the Microsoft Dev Center website.

INSTALLDIR Specifies an alternative installation path for the Horizon 7 component.

Use the format INSTALLDIR=path to specify an installation path. You can ignore this MSI property if you want to install the Horizon 7 component in the default path.

This MSI property is optional.

ADDLOCAL Determines the component-specific options to install.

In an interactive installation, the Horizon 7 installer displays custom setup options that you can select or deselect. In a silent installation, you can use the ADDLOCAL property to selectively install individual setup options by specifying the options on the command line. Options that you do not explicitly specify are not installed.

In both interactive and silent installations, the Horizon 7 installer automatically installs certain features. You cannot use ADDLOCAL to control whether or not to install these non-optional features.

Type ADDLOCAL=ALL to install all custom setup options that can be installed during an interactive installation, including those that are installed by default and those that you must select to install, except NGVC. NGVC and SVIAgent are mutually exclusive.

The following example installs Core, BlastProtocol, PCoIP, UnityTouch, VmVideo, PSG, and all features that are supported on the guest operating system: VMware-Horizon-Agent-x86-y.y.y-xxxxxx.exe /s /v»/qn ADDLOCAL=ALL»

If you do not use the ADDLOCAL property, the custom setup options that are installed by default and the automatically installed features are installed. Custom setup options that are off (unselected) by default are not installed.

The following example installs Core, BlastProtocol, PCoIP, UnityTouch, VmVideo, PSG, and the on-by-default custom setup options that are supported on the guest operating system: VMware-Horizon-Agent-x86-y.y.y-xxxxxx.exe /s /v»/qn»

To specify individual setup options, type a comma-separated list of setup option names. Do not use spaces between names. Use the format ADDLOCAL=value,value,value….

You must include Core when you use the ADDLOCAL=value,value,value… property.

The following example installs Horizon Agent with the Core, BlastProtocol, PCoIP, UnityTouch, VmVideo, PSG, Instant Clone Agent, and Virtual Printing features:

VMware-Horizon-Agent-x86-y.y.y-xxxxxx.exe /s /v»/qn ADDLOCAL=Core,NGVC,ThinPrint»

The preceding example does not install other components, even those that are installed by default interactively.

The ADDLOCAL MSI property is optional.

REBOOT You can use the REBOOT=ReallySuppress option to allow system configuration tasks to complete before the system reboots.

This MSI property is optional.

REMOVE You can use the REMOVE=<value> option to remove a feature.

The following example uninstalls the USB feature:

VMware-Horizon-Agent-x86-y.y.y-xxxxxx.exe /s /v»/qn REMOVE=USB»

This MSI property is optional.

/l*v log_file Writes logging information into the specified log file with verbose output.

For example: /l*v «»%TEMP%\vmmsi.log»»

This example generates a detailed log file that is similar to the log generated during an interactive installation.

You can use this option to record custom features that might apply uniquely to your installation. You can use the recorded information to specify installation features in future silent installations.

The /l*v option is optional.

The Windows Installer technology uses Msiexec.exe for installing MSI and MSP packages. This tool gives you full control over the installation process, allowing you to set:

  • install options (install, uninstall, administrative install, advertise a product)
  • display options (full, basic or no UI during the installation)
  • restart options (if the machine will be restarted after the installation)
  • logging options
  • update options (apply or remove updates)
  • repair options (only for an installed package)
  • public properties which are used by the installation

The usual form of the msiexec command line is this:

msiexec.exe <install_option> <path_to_package> [package_parameters]
Install Options

When launching an installation package, you can set the install type through these options:

msiexec.exe [/i][/a][/j{u|m|/g|/t}][/x] <path_to_package>
  • /i – normal installation
  • /a – administrative install
  • /j – advertise the product
    • u – advertise to the current user
    • m – advertise to all users
    • /g – the language identifier used by the advertised package
    • /t – apply transform to advertise package
  • /x – uninstall the package

Sample command line:

msiexec.exe /i "C:Example.msi"
Display Options

The user interface level of the installation can be configured according to the target environment. For example, a package distributed to clients should have a full UI, while a package deployed through Group Policy should have no user interface. Msiexec.exe sets the UI level of the installation through these options:

msiexec.exe /i <path_to_package> [/quiet][/passive][/q{n|b|r|f}]
  • /quiet – quiet mode (there is no user interaction)
  • /passive – unattended mode (the installation shown only a progress bar)
  • /q – set the UI level:
    • n – no UI
    • b – basic UI
    • r – reduced UI
    • f – full UI

Sample command line:

msiexec.exe /i "C:Example.msi" /qn
Restart Options

Sometimes an installation overwrites files which are in use or it needs to reboot the machine in order to finish. The reboot policy used by the installation can be set through these options:

msiexec.exe /i <path_to_package> [/norestart][/promptrestart][/forcerestart]
  • /norestart – the machine will not be restarted after the installation is complete
  • /promptrestart – the user will be prompted if a reboot is required
  • /forcerestart – the machine will be restarted after the installation is complete

Sample command line:

msiexec.exe /i "C:Example.msi" /norestart
Logging Options

When debugging an installation package you can use multiple logging parameters in order to create a log. This log will contain different information for each parameter you use:

msiexec.exe [/i][/x] <path_to_package> [/L{i|w|e|a|r|u|c|m|o|p|v|x+|!|*}][/log] <path_to_log>
  • /L – enable logging
    • i – include status messages
    • w – include non-fatal warnings
    • e – include all error messages
    • a – mention when an action is started
    • r – include action-specific records
    • u – include user requests
    • c – include the initial UI parameters
    • m – include out-of-memory or fatal exit information
    • o – include out-of-disk-space messages
    • p – include terminal properties
    • v – verbose output
    • x – include extra debugging information
    • + – append to an existing log file
    • ! – flush each line to the log
    • * – log all information, except for v and x options
  • /log – the equivalent of /l*

Sample command line:

msiexec.exe /i "C:Example.msi" /L*V "C:package.log"
Update Options

The Windows Installer command line can apply or remove updates (patches for example) through these options:

msiexec.exe [/update][/uninstall[/package<product_code_of_package>]] <path_to_package>
  • /update – apply updates (if there are multiple updates, you can separate them through the “;” character)
  • /uninstall – remove an update for a product (if there are multiple updates, you can separate them through the “;” character)
    • /package – specifies the package for which the update is removed

Sample command lines:

msiexec.exe /update "C:MyPatch.msp"
msiexec.exe /uninstall {1BCBF52C-CD1B-454D-AEF7-852F73967318} /package {AAD3D77A-7476-469F-ADF4-04424124E91D}

TipNoteIn the above command line the first GUID is the Patch identifier GUID and the second one is the Product Code of the MSI for which the patch was applied.

Repair Options

If you have an installed package, you can use the Windows Installer command line for repairing it:

msiexec.exe [/f{p|o|e|d|c|a|u|m|s|v}] <product_code>
  • /f – repair a package
    • p – repair only if a file is missing
    • o – repair if a file is missing or an older version is installed
    • e – repair if file is missing or an equal or older version is installed
    • d – repair if a file is missing or a different version is installed
    • c – repair if a file is missing or the checksum does not match the calculated value
    • a – forces all files to be reinstalled
    • u – repair all the required user-specific registry entries
    • m – repair all the required computer-specific registry entries
    • s – repair all existing shortcuts
    • v – run from source and recache the local package

Sample command line:

msiexec.exe /fa {AAD3D77A-7476-469F-ADF4-04424124E91D}

NoteIn the above command line the GUID is the Product Code of the MSI which will be repaired.

Set public properties

The name of a public property contains only uppercase letters (for example PROPERTY). This type of properties can be set through the command line like this: PROPERTY=”value”.
Sample command line:

msiexec.exe /i "C:Example.msi" MY_PROP="myValue"
  • MSIEXEC.EXE – the MSI executable, the program that performs the actual installation of the application.
  • /I – this switch informs the Windows Installer to install the specified application (as opposed to removing, reinstalling or repairing the application)
  • /QB-  – this switch instructs the Windows Installer to perform the installation with a basic user interface requiring no dialog boxes to be displayed. You might also use /QN to perform the installation with no user interface at all.
  • Correct syntax:
    msiexec /i A:Example.msi PROPERTY=VALUE
    Incorrect syntax:
    msiexec /i PROPERTY=VALUE A:Example.msi
    Property values that are literal strings must be enclosed in quotation marks. Include any white spaces in the string between the marks.
    msiexec /i A:Example.msi PROPERTY=”Embedded White Space”
    To clear a public property by using the command line, set its value to an empty string.
    msiexec /i A:Example.msi PROPERTY=””
    For sections of text set apart by literal quotation marks, enclose the section with a second pair of quotation marks.
    msiexec /i A:Example.msi PROPERTY=”Embedded “”Quotes”” White Space”
    The following example shows a complicated command line.
    msiexec /i testdb.msi INSTALLLEVEL=3 /l* msi.log COMPANYNAME=”Acme “”Widgets”” and “”Gizmos.”””
    The following example shows advertisement options. Note that switches are not case-sensitive.
    msiexec /JM msisample.msi /T transform.mst /LIME logfile.txt
    The following example shows you how to install a new instance of a product to be advertised. This product is authored to support multiple instance transforms.
    msiexec /JM msisample.msi /T :instance1.mst;customization.mst /c /LIME logfile.txt
    The following example shows how to patch an instance of a product that is installed using multiple instance transforms.
    msiexec /p msipatch.msp;msipatch2.msp /n {00000001-0002-0000-0000-624474736554} /qb
    When you apply patches to a specific product, the /i and /p options cannot be specified together in a command line. In this case, you can apply patches to a product as follows.
    msiexec /i A:Example.msi PATCH=msipatch.msp;msipatch2.msp /qb
    Some Sample Commands for EXE files:–

  • setup.exe /q
  • setup.exe /qn
  • setup.exe /silent
  • setup.exe /s
  • setup.exe /NoUserInput
  • setup.exe /unattended
  • setup.exe /CreateAnswerFile
  • setup.exe /quiet

    Symantec

  • MsiExec.exe /norestart /q/x{BA4B71D1-898E-4306-AE87-8BA7A596F0ED} REMOVE=ALL

    psexec computer_name MsiExec.exe /norestart /q/x{BA4B71D1-898E-4306-AE87-8BA7A596F0ED} REMOVE=ALL
    cmd=’msiexec /qn /i %SOFTWARE%adobereader93AdbeRdr930_en_US.msi TRANSFORMS=%SOFTWARE%adobereader93AdbeRdr930_en_US.mst’
    ‘msiexec /qn /update %SOFTWARE%AdobeReader93AdbeRdrUpd932_all_incr.msp’
    ‘MsiExec.exe /x{AC76BA86-7AD7-1033-7B44-A80000000002} /qn ‘
    msiexec /qn /x{AC76BA86-7AD7-1033-7B44-A93000000001}
    msiexec.exe /qn /update “%SOFTWARE%AdobeReader93AdbeRdrUpd932_all_incr.msp”‘
    ‘msiexec /qb /uninstall “%SOFTWARE%adobe-readerAcroRead.msi’
    siexec /i “UNCPathfilename.msi” /qn

    With the Product key

    msiexec /i “UNCPathfilename.msi” /qn PIDKEY=”Key value without dashes

    Java

    jre-1_5_0-bin-b99-windows-i586-12_aug_2003.exe /s ADDLOCAL=jrecore,extra MOZILLA=1
    jre-1_5_0-bin-b99-windows-i586-12_aug_2003.exe /s /v”/qn ADDLOCAL=ALL IEXPLORER=1 INSTALLDIR=D:javajre”
    start /w jre-1_5_0-bin-b99-windows-i586-12_aug_2003.exe /s ADDLOCAL=jrecore,extra MOZILLA=1
    msiexec.exe /qn /x {3248F0A8-6813-11D6-A77B-00B0D0n1n2n3n4n50}
    msiexec.exe /qn /x {3248F0A8-6813-11D6-A77B-00B0D0150000}
    msiexec.exe /qn /x {3248F0A8-6813-11D6-A77B-00B0D0151020}
    Creating a Log File
    If you want to create a log file describing the installation/uninstallation, append /L C:<path>setup.log to the install/uninstall command. The following is an example for installation:
    Installation Example
    jre-1_5_0-bin-b99-windows-i586-12_aug_2003.exe /s /L C:<path>setup.log
    The following is an example for uninstalling:
    Uninstalling Example
    msiexec.exe /qn /x {3248F0A8-6813-11D6-A77B-00B0D0150000} /L C:<path>setup.log

    Note:- Adobe Customization Wizard 9 will help you to create MST file for silent installation

    WINZIP:-

    Below is available WINZIP MSI File https://download.winzip.com/ov/winzip100.msi
    ymsgrie.exe /s /v/passive – install Yahoo! Messenger silent, with progress bar

    Team Viewer :–

    The /S switch for silent install of TEAMVIEWER WORKS!
    but you must do the following :
    download the program (preferably the latest version) ..or ..if you have it on your hard drive , open it… (AND LET IT OPEN! DO NOT CLOSE OR INSTALL THE APLICATION. JUST DUBLE-CLICK IT!!)
    Then , go to C:Documents and SettingsAdministratorLocal SettingsTemp. There you’ll see a folder called TeamViewer. Open that folder. Inside you’ll have 2 files. Teamviewer.exe and tvinfo.ini
    Copy the Teamviewer from that folder and paste wherever you want. After this you can close the other application.
    With the new teamviewer.exew which you copyed from the temp folder , u can run it sillently. Use the /S Switch. Works with WPI also.
      If you find MSiexec has problem then you can run below two commands
    msiexec /unregister  —> for unregistering the windows installer
      msiexec /regserver—> for registering the windows installer
    Released Versions of Windows Installer
    The table in this topic identifies the released versions of the Windows Installer.
    Release
    Version
    Description
    Windows Installer 2.0
    2.0.2600.0
    Released with Windows XP.
    Windows Installer 2.0
    2.0.2600.1
    Released with Windows 2000 Server with Service Pack 3 (SP3).
    Windows Installer 2.0
    2.0.2600.1183
    Released with Windows 2000 Server with Service Pack 4 (SP4).
    Windows Installer 2.0
    2.0.2600.2
    Released as a redistributable.
    Windows Installer 2.0
    2.0.2600.1106
    Released with Windows XP with Service Pack 1 (SP1).
    Windows Installer 2.0
    2.0.3790.0
    Released with Windows Server 2003.
    Windows Installer 3.0
    3.0.3790.2180
    Released with Windows XP with Service Pack 2 (SP2). Released as a redistributable.
    Windows Installer 3.1
    3.1.4000.1823
    Released as a redistributable. This version is has the same functionality as version 3.1.4000.2435.
    Windows Installer 3.1
    3.1.4000.1830
    Released with Windows Server 2003 with Service Pack 1 (SP1) and Windows XP Professional x64 Edition. Update this version to version 3.1.4000.2435 to address the issue discussed in KB898628.
    Windows Installer 3.1
    3.1.4000.3959
    Released with Windows Server 2003 with Service Pack 2 (SP2).
    Windows Installer 3.1
    3.1.4000.2435
    Released with a fix to address the issue discussed in KB898628. This is the latest version of Windows Installer 3.1.
    Windows Installer 3.1
    3.1.4001.5512
    Released with Windows XP with Service Pack 3 (SP3).
    Windows Installer 4.0
    4.0.6000.16386
    Released with Windows Vista.
    Windows Installer 4.0
    4.0.6001.18000
    Released with Windows Vista with Service Pack 1 (SP1) and Windows Server 2008.
    Windows Installer 4.5
    4.5.6002.18005
    Released with Windows Vista with Service Pack 2 (SP2) and Windows Server 2008 with Service Pack (SP2.)
    Windows Installer 4.5
    4.5.6000.20817
    Released as a redistributable for Windows Vista.
    Windows Installer 4.5
    4.5.6001.22162
    Released as a redistributable for Windows Server 2008 and Windows Vista with SP1.
    Windows Installer 4.5
    4.5.6001.22159
    Released as a redistributable for Windows XP with Service Pack 2 (SP2) and later, and Windows Server 2003 with SP1 and later.
    Windows Installer 5.0 is released with Windows Server 2008 R2 and Windows 7.
      To create exe file by using winrar for silent installation / Self Extractor
      create SFX archive”. Change the archive name if you like but it must have the .exe extension.
    Posted Image
    Switch to the Advanced tab and select “SFX options” to open Advanced SFX options window.
    Posted Image
    On the General tab in the “Path to extract” box type the path you want to extract the installer to. Make sure it is the same path you have in the antivir.cmd file. Then in the “Run after extraction” box type in the path to the antivir.cmd file.
    Posted Image
    Change to the Modes tab and select the “hide all” and “overwrite existing files” radio buttons.
    Posted Image
    Close the “Advanced SFX Options” window by clicking OK, then click OK on the “Archive name and parameters” window to start creating the installer. The finished installer is created in the antivirpec folder.
      Also you can do with 7zip  where you will have more options compare to winrar or winzipself extractor.

    Office 2007 silent install with SCCM 2007

    So here is his tip on how to create a customized MSP file with OCT:

    1. Go to the original package source that contains the Office 2007 setup files
    2. From the directory that contains the Office 2007 setup files, run setup.exe /admin. This should open the Office Customization Toolkit (OCT)
    3. Select to Create a new Setup customization file
    4. In the “Install location and organization name”, set the default installation location and organization name.
    5. Click on Licensing and user interface. Make sure you enter a valid product key, check the EULA checkbox and set Display level to None. Completion notice checkbox should not be checked and Suppress modal should be checked.
    6. Save the MSP file by going to File –> Save. Give the file a name and save it to the Updates folder located in the Office 2007 installation source folder. By saving it to the Updates folder, the /adminfile switch will not need to be used as part of setup.exe. If the file is not saved to the Updates folder, make sure that the /adminfile switch is used as part of setup.exe and that it points to the MSP file just created.

    Further more, with OCT you can customize almost everything regarding how your Word/Excel etc. applications will run. What I liked most is the possibility to create the default profile in Outlook if you are using an Exchange server in your organization.
    Don’t forget to save the MSP file and to put the file in Updates folder or to use /adminfile <path to MST file> switch .
      Hope I will try to post when i get some time

  • Windows installer is not correctly installed
  • Windows installer для windows 10 не отвечает
  • Windows installer for windows 2003
  • Windows installation media creation tool что это
  • Windows installer for windows 10 скачать