C# Class 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.

Inheritance: INotifyPropertyChanged
Mostrar archivo Open project: Eun/WixSharp Class Usage Examples

Public Properties

Property Type Description
InUiThread System.Action
ProgressStepDelay int

Public Methods

Method Description
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.

Protected Methods

Method Description
OnMessage ( string message, MsiInstallMessage messageType ) : int

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

OnPropertyChanged ( string propertyName ) : void

Private Methods

Method Description
OnExternalUI ( IntPtr context, uint messageType, string message ) : int

Method Details

EnableLog() public method

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.
return void

Execute() public method

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.
return void

ExecuteInstall() public method

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.
return void

ExecuteUninstall() public method

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.
return void

NotifyHostOnActionStarted() public method

public NotifyHostOnActionStarted ( ) : void
return void

NotifyHostOnProgress() public method

public NotifyHostOnProgress ( ) : void
return void

OnActionData() public method

Called when ActionData MSI message is received.
public OnActionData ( string data ) : void
data string The message data.
return void

OnError() public method

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).
return void

OnInfo() public method

Called when Info MSI message is received.
public OnInfo ( string data ) : void
data string The message data.
return void

OnMessage() protected method

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.
return int

OnPropertyChanged() protected method

protected OnPropertyChanged ( string propertyName ) : void
propertyName string
return void

OnUser() public method

Called when User MSI message is received.
public OnUser ( string data ) : void
data string The message data.
return void

OnWarning() public method

Called when Warning MSI message is received.
public OnWarning ( string data ) : void
data string The message data.
return void

Property Details

InUiThread public_oe property

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
return System.Action

ProgressStepDelay public_oe static_oe property

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
return int