Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

MsiSourceListClearAllEx function

The MsiSourceListClearAllEx function removes all the existing sources of a given source type for the specified product or patch instance. The patch registration is also removed if the sole source of the patch gets removed and if the patch is not installed as a new patch by any client in the same context. Specifying that MsiSourceListClearAllEx remove the current source for this product or patch forces the installer to search the source list for a source the next time a source is required.

Syntax


UINT MsiSourceListClearAllEx(
  _In_      LPCTSTR szProductCodeOrPatchCode,
  _In_opt_  LPCTSTR szUserSid,
  _In_      MSIINSTALLCONTEXT dwContext,
  _In_      DWORD dwOptions
);

Parameters

szProductCodeOrPatchCode [in]

The ProductCode or patch GUID of the product or patch. Use a null-terminated string. If the string is longer than 39 characters, the function fails and returns ERROR_INVALID_PARAMETER. This parameter cannot be NULL.

szUserSid [in, optional]

This parameter can be a string SID that specifies the user account that contains the product or patch. The SID is not validated or resolved. An incorrect SID can return ERROR_UNKNOWN_PRODUCT or ERROR_UNKNOWN_PATCH. When referencing a machine context, szUserSID must be NULL and dwContext must be MSIINSTALLCONTEXT_MACHINE. Using the machine SID ("S-1-5-18") returns ERROR_INVALID PARAMETER. When referencing the current user account, szUserSID can be NULL and dwContext can be MSIINSTALLCONTEXT_USERMANAGED or MSIINSTALLCONTEXT_USERUNMANAGED.

dwContext [in]

This parameter specifies the context of the product or patch instance. This parameter can contain one of the following values.

Type of contextMeaning
MSIINSTALLCONTEXT_USERMANAGED

The product or patch instance exists in the per-user-managed context.

MSIINSTALLCONTEXT_USERUNMANAGED

The product or patch instance exists in the per-user-unmanaged context.

MSIINSTALLCONTEXT_MACHINE

The product or patch instance exists in the per-machine context.

 

dwOptions [in]

The dwOptions value determines the interpretation of the szProductCodeOrPatchCode value and the type of sources to clear. This parameter must be a combination of one of the following MSISOURCETYPE_* constants and one of the following MSICODE_* constants.

FlagMeaning
MSISOURCETYPE_MEDIA

The source is media.

MSISOURCETYPE_NETWORK

The source is a network type.

MSISOURCETYPE_URL

The source is a URL type.

MSICODE_PATCH

szProductCodeOrPatchCode is a patch code.

MSICODE_PRODUCT

szProductCodeOrPatchCode is a product code.

 

Return value

ValueMeaning
ERROR_ACCESS_DENIED

The user does not have the ability to add or move a source. Does not indicate whether the product or patch was found.

ERROR_BAD_CONFIGURATION

The configuration data is corrupt.

ERROR_INSTALL_SERVICE_FAILURE

Cannot access the Windows Installer service.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_SUCCESS

All sources of the specified type were removed.

ERROR_UNKNOWN_PRODUCT

The specified product is unknown.

ERROR_UNKNOWN_PATCH

The specified patch is unknown.

ERROR_FUNCTION_FAILED

Unexpected internal failure.

 

Remarks

Administrators can modify the installation of a product or patch instance that exists under the machine context or under their own per-user context (managed or unmanaged.) They can modify the installation of a product or patch instance that exists under any user's per-user-managed context. Administrators cannot modify another user's installation of a product or patch instance that exists under that other user's per-user-unmanaged context.

Non-administrators cannot modify the installation of a product or patch instance that exists under another user's per-user context (managed or unmanaged.) They can modify the installation of a product or patch instance that exists under their own per-user-unmanaged context. They can modify the installation of a product or patch instance under the machine context or their own per-user-managed context only if they are enabled to browse for a product or patch source. Users can be enabled to browse for sources by setting policy, for more information, see DisableBrowse, AllowLockdownBrowse, and AlwaysInstallElevated policies.

Requirements

Version

Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer 3.0 or later on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.

Header

Msi.h

Library

Msi.lib

DLL

Msi.dll

Unicode and ANSI names

MsiSourceListClearAllExW (Unicode) and MsiSourceListClearAllExA (ANSI)

See also

AllowLockdownBrowse
AlwaysInstallElevated
DisableBrowse
ProductCode
Not Supported in Windows Installer 2.0 and earlier

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.