Workflow Tools Control Yard

Home / Windows

Msiexec silent install builder

Build an msiexec command for an unattended install, uninstall, repair or patch, as a plain command line and as a PowerShell block that returns a sensible exit code. Further down: paste a command to have it explained, what each MSI exit code means, and the options and properties.

Command Prompt or RMM command step

msiexec /i <package.msi> /qn /norestart

PowerShell: waits for the installer, treats 0, 1641 and 3010 as success

Action
What the user sees
Restart
Log and properties

Explain an msiexec command

Paste an msiexec command to see what each part does and what to check before it runs.

MSI exit codes

Msiexec returns a Windows error code. Three values mean success: 0, and 1641 and 3010 when a restart is involved. Everything else is a failure, and the verbose log is the place to find the reason.

CodeNameMeaning and what to check
0ERROR_SUCCESSCompleted successfully.
13ERROR_INVALID_DATAThe data is invalid.
87ERROR_INVALID_PARAMETERA parameter was invalid.
120ERROR_CALL_NOT_IMPLEMENTEDA custom action called a function that custom actions are not allowed to call.
1259ERROR_APPHELP_BLOCKWindows flagged the product as possibly incompatible with this version, and the user chose not to install it.
1601ERROR_INSTALL_SERVICE_FAILUREThe Windows Installer service could not be reached. Check that the service is not disabled.
1602ERROR_INSTALL_USEREXITThe user cancelled the installation.
1603ERROR_INSTALL_FAILUREFatal error during installation. The catch-all failure: open the verbose log and search for "return value 3" to find the action that failed.
1604ERROR_INSTALL_SUSPENDInstallation suspended before it finished.
1605ERROR_UNKNOWN_PRODUCTThe product is not installed, at least not for this context. Check the product code, and whether it was installed per user while you are running as SYSTEM.
1606ERROR_UNKNOWN_FEATUREThe feature name is not recognized.
1607ERROR_UNKNOWN_COMPONENTThe component name is not recognized.
1608ERROR_UNKNOWN_PROPERTYThe property name is not recognized.
1609ERROR_INVALID_HANDLE_STATEThe handle is in an invalid state.
1610ERROR_BAD_CONFIGURATIONThe configuration data for the product is corrupt.
1611ERROR_INDEX_ABSENTThe component qualifier is not present.
1612ERROR_INSTALL_SOURCE_ABSENTThe installation source is not available. The original MSI that a repair, patch or uninstall needs is gone from where it was installed from.
1613ERROR_INSTALL_PACKAGE_VERSIONThe package needs a newer version of Windows Installer than this machine has.
1614ERROR_PRODUCT_UNINSTALLEDThe product is uninstalled.
1615ERROR_BAD_QUERY_SYNTAXA SQL query in the package is invalid or unsupported.
1616ERROR_INVALID_FIELDA record field does not exist.
1618ERROR_INSTALL_ALREADY_RUNNINGAnother installation is in progress. Only one MSI install runs at a time: wait and retry.
1619ERROR_INSTALL_PACKAGE_OPEN_FAILEDThe package could not be opened. Check the path and the quoting, and that the account running the command can read the file: SYSTEM cannot see a user's mapped drives.
1620ERROR_INSTALL_PACKAGE_INVALIDThe file opened but is not a valid Windows Installer package. Often a truncated download.
1621ERROR_INSTALL_UI_FAILUREThe installer's user interface failed to start.
1622ERROR_INSTALL_LOG_FAILUREThe log file could not be opened. Check that the log folder exists and is writable.
1623ERROR_INSTALL_LANGUAGE_UNSUPPORTEDThe package's language is not supported on this system.
1624ERROR_INSTALL_TRANSFORM_FAILUREA transform could not be applied. Check the paths in TRANSFORMS and that the .mst files match this package.
1625ERROR_INSTALL_PACKAGE_REJECTEDSystem policy forbids this installation, for example software restriction or AppLocker rules.
1626ERROR_FUNCTION_NOT_CALLEDA function could not be executed.
1627ERROR_FUNCTION_FAILEDA function failed while it was running.
1628ERROR_INVALID_TABLEAn invalid or unknown table was named.
1629ERROR_DATATYPE_MISMATCHThe data supplied is of the wrong type.
1630ERROR_UNSUPPORTED_TYPEData of this type is not supported.
1631ERROR_CREATE_FAILEDThe Windows Installer service failed to start.
1632ERROR_INSTALL_TEMP_UNWRITABLEThe Temp folder is full or cannot be written to.
1633ERROR_INSTALL_PLATFORM_UNSUPPORTEDThe package is not supported on this platform. The usual cause is an x64 or ARM64 package on a different architecture.
1634ERROR_INSTALL_NOTUSEDThe component is not used on this machine.
1635ERROR_PATCH_PACKAGE_OPEN_FAILEDThe patch file could not be opened. Check the path and access, as for 1619.
1636ERROR_PATCH_PACKAGE_INVALIDThe patch file is not a valid Windows Installer patch.
1637ERROR_PATCH_PACKAGE_UNSUPPORTEDThe patch needs a newer version of Windows Installer than this machine has.
1638ERROR_PRODUCT_VERSIONAnother version of this product is already installed. Uninstall it first, or use the vendor's upgrade package.
1639ERROR_INVALID_COMMAND_LINEInvalid command line. Check the quoting, the switch spelling and the property names.
1640ERROR_INSTALL_REMOTE_DISALLOWEDInstalling from a Remote Desktop Services client session is not permitted for this user.
1641ERROR_SUCCESS_REBOOT_INITIATEDSuccess. The installer has started a restart.
1642ERROR_PATCH_TARGET_NOT_FOUNDThe patch does not apply: the product it updates is missing or is a different version.
1643ERROR_PATCH_PACKAGE_REJECTEDSystem policy does not allow the patch.
1644ERROR_INSTALL_TRANSFORM_REJECTEDSystem policy does not allow one or more of the transforms.
1645ERROR_INSTALL_REMOTE_PROHIBITEDWindows Installer does not permit installation from a Remote Desktop connection.
1646ERROR_PATCH_REMOVAL_UNSUPPORTEDThe patch cannot be uninstalled.
1647ERROR_UNKNOWN_PATCHThe patch is not applied to this product.
1648ERROR_PATCH_NO_SEQUENCENo valid order could be found for the set of patches.
1649ERROR_PATCH_REMOVAL_DISALLOWEDPolicy does not allow patches to be removed.
1650ERROR_INVALID_PATCH_XMLThe XML data for the patch is invalid.
1651ERROR_PATCH_MANAGED_ADVERTISED_PRODUCTAn administrator could not apply the patch to a product that is only advertised per user or per machine.
1652ERROR_INSTALL_SERVICE_SAFEBOOTThe Windows Installer service is not available in safe mode.
1653ERROR_ROLLBACK_DISABLEDRollback is disabled, so a transaction across several packages cannot run.
1654ERROR_INSTALL_REJECTEDWindows refused the package. Some ARM editions of Windows only accept installer packages signed by Microsoft.
3010ERROR_SUCCESS_REBOOT_REQUIREDSuccess. A restart is needed to finish, and has not been started.

A code that is not in the table is a general Windows error passed through by the installer. On Windows, net helpmsg followed by the number shows its text.

Msiexec options

The options of msiexec, by what they are for. The explainer above reads this table and the one after it.

OptionWhat it does
Action
/i, /packageInstall or configure a product. Takes the MSI file or a product code.
/x, /uninstallUninstall. Takes the MSI file or the product code in braces. Given a patch file together with /package, /uninstall removes that patch.
/fRepair. The letters after it choose what: p files that are missing, o missing or older, e missing, equal or older, d missing or of a different version, c missing or with a wrong checksum, a all files, u user registry entries, m computer registry entries, s shortcuts, v run from the source and cache the package again. Without letters it is omus. Properties on the command line are ignored.
/aAdministrative installation: put the product on a network location to install from.
/ju, /jmAdvertise the product: u to the current user, m to all users of the computer. Properties on the command line are ignored.
/tWith /j: the transforms to apply.
/gWith /j: the language identifier.
/updateApply one or more patch files (.msp), separated by semicolons.
/pApply one or more patch files (.msp), separated by semicolons. The older form of /update.
/cWith /j and /t: advertise a new instance of the product.
/nThe product code of one instance, where a product is installed more than once.
/yRegister a DLL by calling its own registration function.
/zUnregister a DLL by calling its own function for that.
/mWrite an SMS status file (.mif) of that name, eight characters at most.
What the user sees
/qn, /q, /quietNo user interface.
/qbBasic user interface.
/qrReduced user interface.
/qfFull user interface.
+, -, !Signs after a level. /qn+ and /qb+: a dialog box at the end. /qb-: no dialog boxes at all. /qb!: no Cancel button.
/passiveUnattended: a progress bar only, no questions, and the user cannot cancel.
Restart
/norestartDo not restart when the installation finishes.
/promptrestartAsk the user before a required restart.
/forcerestartAlways restart when the installation finishes.
Log
/l letters fileWrite a log. The letters choose what goes in: i status messages, w warnings, e error messages, a the start of actions, r action records, u user requests, c the first interface settings, m out of memory or fatal exit, o out of disk space, p properties at the end, v verbose output, x extra debugging output, * all of these but v and x, + append to the file, ! write each line at once. Without letters it is iwearmo. The folder of the log file must exist: the installer does not create it.
/log fileWrite a log. The same as /l*.
Other
/?, /h, /helpShow how msiexec is used.
NAME=valueSet a public property. Names are upper case. A value with spaces goes in quotation marks, and a quotation mark inside a value is doubled.

Properties often set on the command line

A package also has properties of its own, such as its install folder. Those are in the vendor's documentation, not here.

PropertyWhat it does
ALLUSERS1 installs for all users of the computer. 2 lets the installer choose from the user's rights and from MSIINSTALLPERUSER. Not set, the installation is for the current user.
MSIINSTALLPERUSERRead only with ALLUSERS=2, for a package written for both kinds of installation: 1 asks for the current user only, an empty value for all users.
REBOOTForce: restart at the end; with an interface the user is asked first. Suppress: no restart at the end, but one the package calls for midway still happens. ReallySuppress: no restart and no question at all. The installer reads only the first letter.
TRANSFORMSThe transform files (.mst) to apply, in this order, separated by semicolons. A name that starts with a colon is a transform stored inside the MSI file.
TARGETDIRThe root destination folder. In an administrative installation (/a), the place the package is copied to.
ADDLOCALThe features to install on the computer, separated by commas. ALL is every feature. Feature names are case-sensitive.
REMOVEThe features to remove, separated by commas. ALL is every feature.
REINSTALLThe features to reinstall, separated by commas, or ALL. Only features that are installed already are reinstalled. Set REINSTALLMODE with it.
REINSTALLMODEWhat a reinstall replaces, in the letters of /f.
PATCHPatch files (.msp) to apply during an install, separated by semicolons. Ignored when /p is used.
MSIPATCHREMOVEThe patches to remove, each as a file or a patch code, separated by semicolons.
ARPSYSTEMCOMPONENT1 keeps the product out of the list of installed programs in Control Panel.

More Windows tools