MsiExec cheat sheet

MsiExec.exe Command-Line Parameters

 

InstallShield 2019

 

MsiExec.exeis the executable program of the Windows Installer used to interpret installation packages and install products on target systems. After you build your release, you can install your Windows Installer package (.msi) from the command line.

 

Your Windows Installer package can be accessed from the folder that contains your built release. The default location is as follows:

 

C:\InstallShield 2019 Projects\ProjectName\ReleaseName\DiskImages\Disk1\ProductName.msi

 

After building a release of your product, you can install it from the command line:

 

msiexec /i "C:\InstallShield 2019 Projects\ProjectName\ReleaseName\DiskImages\Disk1\ProductName.msi"

 

The table below provides a detailed description of MsiExec.execommand-line parameters.


 Parameter

Description

/i <package> or <product code>

Use this format to install the product Othello:

msiexec /i "C:\InstallShield 2019 Projects\Othello\Trial Version\Release\DiskImages\Disk1\Othello Beta.msi"

Product Code refers to the GUID that is automatically generated in the Product Code property of your product’s project view.

/f [p|o|e|d|c|a|u|m|s|v] <package> or <product code>

Installing with the /foption will repair or reinstall missing or corrupted files.

For example, to force a reinstall of all files, use the following syntax:

msiexec /fa "C:\InstallShield 2019 Projects\Othello\Trial Version\Release\DiskImages\Disk1\Othello Beta.msi"

Use the aforementioned syntax in conjunction with the following flags:

preinstalls a file if it is missing

oreinstalls a file if it is missing or if an older version of the file is present on the user’s system

 

ereinstalls a file if it is missing or if an equivalent or older version of the file is present on the user’s system

creinstalls a file if it is missing or if the stored checksum of the installed file does not match the new file’s value

 

aforces a reinstall of all files

uor mrewrite all required user registry entries

 

soverwrites any existing shortcuts

vruns your application from the source and re-caches the local installation package

/a <package>

The /aoption allows users with administrator privileges to install a product onto the network.

/x <package> or <product code>

The /xoption uninstalls a product.

Project • For InstallScript MSI projects in which the InstallScript UI style is the new style (which uses the InstallScript engine as an embedded UI handler): If you try to uninstall the product through the command line using the statement Msiexec.exe /x {ProductCode}, the uninstallation may be successful. However, the Windows Installer displays an error dialog near the end of the uninstallation. The error dialog indicates that the Windows Installer service could not be accessed.

To perform an uninstallation from the command line in this scenario, the current recommended method is to use one of the following:

msiexec.exe /i {ProductCode} REMOVE=ALL

msiexec.exe /x {ProductCode} /qn

This is not necessary if your InstallScript MSI project is using the traditional style for the InstallScript UI (which uses the InstallScript engine as an external UI handler).

To learn more, see Using the InstallScript Engine as an External vs. Embedded UI Handler for InstallScript MSI Installations.

/j [u|m] <package>

/j [u|m] <package> /t <transform list>

/j [u|m] <package> /g

/j <language ID>

Building with the /j<package> option advertises the components of your application on the end user’s computer

uadvertises components only to the current user

madvertises components to all users of the computer

 

gspecifies language ID

tapplies a transform to your advertised product

Transforms allow the synchronization of applications across different languages. For example, if you upgrade the English version of your product, you could apply a transform to automatically upgrade the French version of your product.

 

/L[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <log file>

Use the /Loption to specify the path to the log file. Optionally include one or more of the following flags to indicate which information to record in the log file:

ilogs status messages.

wlogs non-fatal warning messages.

 

elogs any error messages.

alogs the commencement of action sequences.

 

rlogs action-specific records.

ulogs user requests.

 

clogs initial user interface parameters.

mlogs out-of-memory messages.

 

ologs out-of-disk-space messages.

plogs all of the properties and their values at the end of the installation.

 

vlogs verbose output.

xlogs extra debugging information.

 

+appends the information to an existing log file.

!flushes each line to the log.

 

*is a wild-card character that enables you to log all information (excluding the verbose output that v provides and the extra debugging information that x provides).

For example, to generate a log file that logs everything verbosely, use the following:

/L*v "C:\MyLogFiles\package.log"

/p <patch package>

Use the /poption to apply a patch to an installed product. To patch an installed administrative image, combine this option with /aas shown:

/pPatchPackage/a Package

/q [n|b|r|f]

The /qoption is used to set the user interface level in conjunction with the following flags:

qor qncreates no user interface

qbcreates a basic user interface

The following user interface settings display a modal dialog box at the end of installation:

qrdisplays a reduced user interface

qf displays a full user interface

 

qn+displays no user interface

qb+displays a basic user interface

/? or /h

Either command displays Windows Installer copyright information

/y <file name>

This command calls the DllRegisterServer entry-point function of the DLL or OCX file specified in <file name>.

/z <file name>

This command calls the DllUnregisterServer entry-point function of the DLL or OCX file specified in <file name>.

/n {product code}

The /n <product code>option is available for patches that are created in the Patch Design view for Basic MSI projects that support the installation of multiple instances of a product.

Use the /noption with the /poption to specify the product code of the instance to which you want to apply a patch. For example:

msiexec /p mypatch.msp /n {00000001-0002-0000-0000-624474736554}

TRANSFORMS

Use the TRANSFORMS command-line parameter to specify any transforms that you would like applied to your base package. Your transform command-line call might look something like this:

msiexec /i "C:\InstallShield 2019 Projects\Othello\Trial Version\Release\DiskImages\Disk1\Othello.msi" TRANSFORMS="New Transform 1.mst"

You can separate multiple transforms with a semicolon. Because of this, it is recommended that you do not use semicolons in the name of your transform because the Windows Installer service will interpret those incorrectly.

Properties

All public properties can be set or modified from the command line. Public properties are distinguished from private properties by the fact that they are in all capital letters. For example, COMPANYNAME is a public property.

To set a property from the command line, use the following syntax: PROPERTY=VALUE. If you wanted to change the value of COMPANYNAME, you would enter:

msiexec /i "C:\InstallShield 2019 Projects\Othello\Trial Version\Release\DiskImages\Disk1\Othello.msi" COMPANYNAME="My Software Company"

 

From <https://docs.revenera.com/installshield25helplib/helplibrary/IHelpCmdLineMSI.htm>

 

Created with OneNote.

No comments:

Post a Comment

Removing tiered storage spaces - Windows Server 2022

As part of the work I have done in my homelab with tiered storage on Server 2022 storage spaces , here is a script I created that allows you...