IMsmMerge2::MergeEx Method

Windows Installer

IMsmMerge2::MergeEx Method

The MergeEx method executes a merge of the current database and current module. The merge attaches the components in the module to the feature identified by Feature. The root of the module's directory tree is redirected to the location given by RedirectDir. For more information, see the MergeEx method of the Merge object.

Syntax

C++HRESULT MergeEx(
  [in]  const BSTR Feature,
  [in]  const BSTR RedirectDir,
  [in]  IMsmConfigureModule *pConfiguration
);

Parameters

Feature [in]

The name of a feature in the database. A LPCWSTR may be used in place of a BSTR.

RedirectDir [in]

The key of an entry in the Directory table of the database. A LPCWSTR may be used in place of a BSTR. This parameter may be null or an empty string.

pConfiguration [in]

The pConfiguration argument is an interface implemented by the client. The argument may be null. The presence of this argument indicates that the client tool is capable of modifying configurable merge modules. The presence of this argument does not require the client to provide configuration data for any specific configurable item.

Return Value

The method can return one of the following values.

Value Meaning
E_OUTOFMEMORY

There system ran out of memory and could not complete the operation.

E_INVALIDARG

One of the arguments is invalid.

E_FAIL

The merge was stopped due to an error. Some tables may not have been merged. See the Remarks section for more information.

S_FALSE

The function succeeded, but there were errors and the merge itself may not be valid.

S_OK

The function succeeded.

 

Remarks

This function executes a merge of the current database and current module. The root of the module's directory tree is redirected to the location given by RedirectDir. If any merge conflicts occur, including exclusions, they are placed in the error enumerator for later retrieval, but does not cause the merge to fail. Errors may be retrieved using get_Errors function. Errors and informational messages will be posted to the current log file.

Once the merge is complete, components in the module are attached to the feature identified by Feature. This feature must already exist and is not created. The module may be attached to additional features using Connect function.

Changes made to the database will not be saved to disk unless CloseDatabase function is called with bCommit set to TRUE.

When the merge fails because of an incorrect module configuration the function returns E_FAIL. This includes these msmErrorType errors: msmErrorBadNullSubstitution, msmErrorBadSubstitutionType, msmErrorBadNullResponse, msmErrorMissingConfigItem, and msmErrorDataRequestFailed. These errors cause the merge to stop immediately when the error is encountered. The error object is still added to the enumerator when MergeEx returns E_FAIL. For more information about msmErrorType errors, see get_Type Function (Error Object). All other errors cause MergeEx to return S_FALSE and cause the merge to continue.

Requirements

VersionMergemod.dll 2.0 or later
HeaderMergemod.h
DLLMergemod.dll
IIDIID_IMsmMerge2 is defined as 351A72AB-21CB-47ab-B7AA-C4D7B02EA305

See Also

Merge Module Automation

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.