C# Класс WixSharp.UI.MsiSession

Generic class that represents runtime properties of the MSI setup session as well as some runtime properties of the product being installed (e.g. CodePage, Caption). It also Simplifies MSI execution and provides automatic responses on the MSI Messages.

Normally MsiSession should be extended top meet the needs of the product (MSI) specific setup.

Наследование: INotifyPropertyChanged
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
InUiThread System.Action
ProgressStepDelay int

Открытые методы

Метод Описание
EnableLog ( string logFile, MsiInstallLogMode mode = MsiInstallLogMode.Info|MsiInstallLogMode.Progress|MsiInstallLogMode.PropertyDump|MsiInstallLogMode.Error|MsiInstallLogMode.User|MsiInstallLogMode.ActionData ) : void

Enables the MSI runtime logging to the specified log file.

Execute ( string msiFile, string msiParams ) : void

Executes the MSI file with the specified MSI parameters.

ExecuteInstall ( string msiFile, string msiParams = null ) : void

Executes the install sequence from the specified MSI file.

ExecuteUninstall ( string msiFile, string msiParams = null ) : void

Executes the uninstall sequence from the specified MSI file.

NotifyHostOnActionStarted ( ) : void
NotifyHostOnProgress ( ) : void
OnActionData ( string data ) : void

Called when ActionData MSI message is received.

OnError ( string data, bool fatal, MsiInstallMessage relatedMessageType = null ) : void

Called when Error event occurs (MSI Error message is received or an internal error condition triggered).

OnInfo ( string data ) : void

Called when Info MSI message is received.

OnUser ( string data ) : void

Called when User MSI message is received.

OnWarning ( string data ) : void

Called when Warning MSI message is received.

Защищенные методы

Метод Описание
OnMessage ( string message, MsiInstallMessage messageType ) : int

Called when MSI message is received. It is actual the MSI Message Loop.

OnPropertyChanged ( string propertyName ) : void

Приватные методы

Метод Описание
OnExternalUI ( IntPtr context, uint messageType, string message ) : int

Описание методов

EnableLog() публичный Метод

Enables the MSI runtime logging to the specified log file.
public EnableLog ( string logFile, MsiInstallLogMode mode = MsiInstallLogMode.Info|MsiInstallLogMode.Progress|MsiInstallLogMode.PropertyDump|MsiInstallLogMode.Error|MsiInstallLogMode.User|MsiInstallLogMode.ActionData ) : void
logFile string The log file.
mode MsiInstallLogMode The logging mode.
Результат void

Execute() публичный Метод

Executes the MSI file with the specified MSI parameters.
public Execute ( string msiFile, string msiParams ) : void
msiFile string The MSI file.
msiParams string The MSI parameters.
Результат void

ExecuteInstall() публичный Метод

Executes the install sequence from the specified MSI file.
public ExecuteInstall ( string msiFile, string msiParams = null ) : void
msiFile string The MSI file.
msiParams string The MSI params.
Результат void

ExecuteUninstall() публичный Метод

Executes the uninstall sequence from the specified MSI file.
public ExecuteUninstall ( string msiFile, string msiParams = null ) : void
msiFile string The MSI file.
msiParams string The MSI params.
Результат void

NotifyHostOnActionStarted() публичный Метод

public NotifyHostOnActionStarted ( ) : void
Результат void

NotifyHostOnProgress() публичный Метод

public NotifyHostOnProgress ( ) : void
Результат void

OnActionData() публичный Метод

Called when ActionData MSI message is received.
public OnActionData ( string data ) : void
data string The message data.
Результат void

OnError() публичный Метод

Called when Error event occurs (MSI Error message is received or an internal error condition triggered).
public OnError ( string data, bool fatal, MsiInstallMessage relatedMessageType = null ) : void
data string The message data.
fatal bool if set to true the error is fatal.
relatedMessageType MsiInstallMessage Type of the related message. Note the error may be associated with the internal /// error condition (e.g. exception is raised).
Результат void

OnInfo() публичный Метод

Called when Info MSI message is received.
public OnInfo ( string data ) : void
data string The message data.
Результат void

OnMessage() защищенный Метод

Called when MSI message is received. It is actual the MSI Message Loop.
protected OnMessage ( string message, MsiInstallMessage messageType ) : int
message string The message data.
messageType MsiInstallMessage Type of the message.
Результат int

OnPropertyChanged() защищенный Метод

protected OnPropertyChanged ( string propertyName ) : void
propertyName string
Результат void

OnUser() публичный Метод

Called when User MSI message is received.
public OnUser ( string data ) : void
data string The message data.
Результат void

OnWarning() публичный Метод

Called when Warning MSI message is received.
public OnWarning ( string data ) : void
data string The message data.
Результат void

Описание свойств

InUiThread публичное свойство

The UI thread marshalling delegate. It should be set for the environments where cross-thread calls must be marshalled (e.g. WPF, WinForms). Not needed otherwise (e.g. Console application).
public System.Action InUiThread
Результат System.Action

ProgressStepDelay публичное статическое свойство

The progress step delay. It is a "for-testing" feature. Set it to positive value (number of milliseconds) to artificially slow down the installation process. The default value is 0.
public static int ProgressStepDelay
Результат int