2023年12月17日发(作者:)

windows Installer()命令行选项

用来解释和安装windows下的安装程序(*.msi) 。以下适用与3.0以后的版本。

一 的标准命令行参数,区分大小写。

Option Parameters Meaning

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

/help

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 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 /norestartor /forcerestart standard

/quiet

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

/quiet

Msiexec /uninstall

/quiet

Msiexec /update

/quiet

Msiexec /uninstall

/package

/ quiet

Note The equivalent

Windows Installer

Command-Line Option

is /qn.

Passive display option. The

installer displays a progress

bar to the user that indicates

that an installation is in

progress but no prompts or

/passive error messages are displayed

to the user. The user cannot

cancel the installation. Use

the /norestart, /forcerestart,

or /promptrestart standar

d 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

/passive

Note The equivalent

Windows Installer

Command-Line Option

is /qb! with REBOOTPROMPT=S set on the command

line.

Never restart option. The

/norestart

installer never restarts the

computer after the

installation.

Example: msiexec /package

/norestart

Note The equivalent

Windows Installer command

line

has REBOOT=ReallySuppress set on the command line.

Always restart option. The

installer always restarts the

computer after every

installation.

/forcerestart

Example: msiexec /package

/forcerestart

Note The equivalent

Windows Installer command

line has REBOOT=Force set

on the command line.

Prompt before restarting

option. Displays a message

that a restart is required to

/promptrestart

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 product option.

/uninstal<|Prodl uctCode>

Uninstalls a product.

Note The equivalent

Windows Installer

Command-Line Option is /x.

/package

/uninstall

< |

ProductCode>

/uninstall

< |

Uninstall update option.

Uninstalls an update patch.

Note The equivalent

Windows Installer

PatchGUID1>[;UpdCommand-Line Option

|

PatchGUID2]

is /I with MSIPATCHREMOVE= |

PatchGUID1[; |

PatchGUID2] set on the

command line.

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

/log

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.

Install product option.

Installs or configures a

<|Prodproduct.

/package

uctCode>

Note The equivalent

Windows Installer

Command-Line Option is /I.

Install patches option.

Installs one or multiple

patches.

/update

<>[;]

Note The equivalent

Windows Installer command

line has PATCH =

[]<;PatchGuid2> set on the command line.

二 的一般命令行参数,区分大小写,部分与标准命令行参数等价。

Option

Parameters Meaning

/I Package|ProductCode

Installs or configures a

product.

Repairs a product. This option

ignores any property values

entered on the command line.

The default argument list for

this option is 'omus.' This

option shares the same

argument list as

the REINSTALLMODE property.

/f

[p|o|e|d|c|a|u|m|s|v]Pap - Reinstalls only if file is

ckage|ProductCode

missing.

o - Reinstalls if file is missing or

an older version is installed.

e - Reinstalls if file is missing or

an equal or older version is

installed.

d - Reinstalls if file is missing or

a different version is installed.

c - Reinstalls if file is missing or

the stored checksum does not

match the calculated value.

Only repairs files that

have msidbFileAttributesChecksum in the Attributes

column of the File table.

a - Forces all files to be

reinstalled.

u - Rewrites all required

user-specific registry entries.

m - Rewrites all required

computer-specific registry

entries.

s - Overwrites all existing

shortcuts.

v - Runs from source and

re-caches the local package.

Do not use the v reinstall

option for the first installation

of an application or feature.

Administrative

/a Package installation option. Installs a

product on the network.

/x Package|ProductCode Uninstalls a product.

Advertises a product. This

option ignores any property

[u|m]Package

or

[u|m]Package/tTransfor/j m List

or

values entered on the

command line.

u - Advertises to the current

user.

m - Advertises to all users of

[u|m]Package/gLanguamachine.

geID

g - Language identifier.

t - Applies transform to

advertised package.

Writes logging information into

/L

[i|w|e|a|r|u|c|m|o|p|v|a logfile at the specified

x|+|!|*] Logfile

existing path. The path to the

logfile location must already

exist. The installer does not

create the directory structure

for the logfile. Flags indicate

which information to log. If no

flags are specified, the default

is 'iwearmo.'

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.

Windows Installer 2.0: Not

supported. The x option is

available with Windows

Installer version

3.0.3790.2180 and later.

+ - Append to existing file.

! - Flush each line to the log.

"*" - Wildcard, log all

information except for the v

and x options. To include the v

and x options, specify "/l*vx".

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

/m filename

Generates an SMS status .mif

Note The length

offilename must be no

more than eight

characters.

file. Must be used with either

the install (-i), remove (-x),

administrative installation

(-a), or reinstall (-f) options.

The is installed

as part of SMS and must be on

the path.

The fields of the status mif file

are filled with the following

information:

Manufacturer - Author

Product - Revision Number

Version - Subject

Locale - Template

Serial Number - not set

Installation - set by

to "DateTime"

InstallStatus - "Success" or

"Failed"

Description - Error messages

in the following order: 1) Error

messages generated by

installer. 2) Resource from

if installation could not

commence or user exit. 3)

System error message file. 4)

Formatted message: "Installer

error %i", where %i is error

returned from .

Applies a patch. To apply a

patch to an installed

/p

PatchPackage[;patchPacadministrative image you must

kage2…] combine the following options:

/p [;patchPackage2…] /a

Sets user interface level.

q , qn - No UI

/q n|b|r|f

qb - Basic UI. Use qb! to hide

the Cancel button.

qr - Reduced UI with no modal

dialog box displayed at the end

of the installation.

qf - Full UI and any

authored FatalError, UserExit,

or Exit modal dialog boxes at

the end.

qn+ - No UI except for a modal

dialog box displayed at the

end.

qb+ - 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+!

orqb!+ to hide

the Cancel button.

qb- - Basic UI with no modal

dialog boxes. Please note that

/qb+- is not a supported UI

level. Use qb-! orqb!- to hide

the Cancel button.

Note that the !option is

available with Windows

Installer 2.0 and works only

with basic UI. It is not valid

with full UI.

/?or/h

Displays copyright information

for Windows Installer.

Calls the system

function DllRegisterServer to self-register modules passed

in on the command line.

Specify the full path to the

DLL. For example, for

/y module

MY_ in the current

folder you can use:

msiexec /y .MY_

This option is only used for

registry information that

cannot be added using the

registry tables of the .msi file.

Calls the system

function DllUnRegisterServer to unregister modules

passed in on the command

line. Specify the full path to the

DLL. For example, for

/z module

MY_ in the current

folder you can use:

msiexec /z .MY_

This option is only used for

registry information that

cannot be removed using the

registry tables of the .msi file.

Advertises a new instance of

the product. Must be used in

conjunction with /t. Available

/c

starting with the Windows

Installer version that is

shipped with Windows

Server 2003 and Windows XP

with Service Pack 1 (SP1).

Specifies a particular instance

of the product. Used to identify

an instance installed using the

multiple instance support

/n ProductCode

through a product code

changing transforms. Available

starting with the Windows

Installer version shipped with

Windows Server 2003 and

Windows XP with SP1.

三 4.5的帮助。可以运行 /help来查看。

Windows ® Installer. V 4.5.6001.22159

msiexec /Option [Optional Parameter]

Install Options

<>

Installs or configures a product

/a <>

Administrative install - Installs a product on the

network

/j<> [/t ] [/g

]

Advertises a product - m to all users, u to current user

< | ProductCode>

Uninstalls the product

Display Options

/quiet

Quiet mode, no user interaction

/passive

Unattended mode - progress bar only

/q[n|b|r|f]

Sets user interface level

n - No UI

b - Basic UI

r - Reduced UI

f - Full UI (default)

/help

Help information

Restart Options

/norestart

Do not restart after the installation is complete

/promptrestart

Prompts the user for restart if necessary

/forcerestart

Always restart the computer after installation

Logging Options

/l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*]

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

/log

Equivalent of /l*

Update Options

/update <>[;]

Applies update(s)

/uninstall [;] /package

< | ProductCode>

Remove update(s) for a product

Repair Options

/f[p|e|c|m|s|o|d|a|u|v] < | ProductCode>

Repairs a product

p - only if file is missing

o - if file is missing or an older version is installed

(default)

e - if file is missing or an equal or older version is

installed

d - if file is missing or a different version is installed

c - if file is missing or checksum does not match the

calculated value

a - forces all files to be reinstalled

u - all required user-specific registry entries (default)

m - all required computer-specific registry entries

(default)

s - all existing shortcuts (default)

v - runs from source and recaches local package

Setting Public Properties

[PROPERTY=PropertyValue]

Consult the Windows ® Installer SDK for additional

documentation on the

command line syntax.

Copyright © Microsoft Corporation. All rights reserved.

Portions of this software are based in part on the work of the

Independent JPEG Group.

四参考:

1) /en-us/library/

2) /windows_installer_team/

Windows Installer

2.0:/en-us/library/aa372024(VS.85).aspx

Windows Installer 3.0:/en-us/library/aa367988(VS.85).aspx

五完!