MsiSourceListClearAll Function

Windows Installer

MsiSourceListClearAll Function

The MsiSourceListClearAll function removes all network sources from the source list of a patch or product in a specified context. For more information, see Source Resiliency.

Syntax

C++UINT MsiSourceListClearAll(
  __in  LPCTSTR szProduct,
  __in  LPCTSTR szUserName,
  __in  DWORD dwReserved
);

Parameters

szProduct [in]

The ProductCode of the product to modify.

szUserName [in]

The user name for a per-user installation. The user name should always be in the format of DOMAIN\USERNAME (or MACHINENAME\USERNAME for a local user).

An empty string or null for a per-machine installation.

dwReserved [in]

Reserved for future use. This value must be set to 0.

Return Value

The MsiSourceListClearAll function returns the following values.

Value Meaning
ERROR_ACCESS_DENIED

The user does not have the ability to clear the source list for this product.

ERROR_BAD_CONFIGURATION

The configuration data is corrupt.

ERROR_BAD_USERNAME

Could not resolve the user name.

ERROR_FUNCTION_FAILED

The function did not succeed.

ERROR_INSTALL_SERVICE_FAILURE

Could not access installer service.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_SUCCESS

The function succeeded.

ERROR_UNKNOWN_PRODUCT

The specified product is unknown.

 

Remarks

An administrator can modify per-machine installations, their own per-user non-managed installations, and the per-user managed installations for any user. A non-administrator can only modify per-machine installations and their own (managed or non-managed)per-user installations. Users can be enabled to browse for sources by setting policy. For more information, see the DisableBrowse, AllowLockdownBrowse, and AlwaysInstallElevated policies.

If a network source is the current source for the product, this function forces the installer to search the source list for a valid source the next time a source is needed. If the current source is media or a URL source, it is still valid after this call and the source list is not searched unless MsiSourceListForceResolution is also called.

If the user name is an empty string or NULL, the function operates on the per-machine installation of the product. In this case, if the product is installed as per-user only, the function returns ERROR_UNKNOWN_PRODUCT.

If the user name is not an empty string or NULL, it specifies the name of the user whose product installation is modified. If the user name is the current user name, the function first attempts to modify a non-managed installation of the product. If no non-managed installation of the product can be found, the function then tries to modify a managed per-user installation of the product. If no managed or unmanaged per-user installations of the product can be found, the function returns ERROR_UNKNOWN_PRODUCT, even if the product is installed per-machine.

This function cannot modify a non-managed installation for any user besides the current user. If the user name is not an empty string or NULL, but is not the current user, the function only checks for a managed per-user installation of the product for the specified user. If the product is not installed as managed per-user for the specified user, the function returns ERROR_UNKNOWN_PRODUCT, even if the product is installed per-machine.

Requirements

VersionWindows Installer 5.0 on 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 on Windows Server 2003, Windows XP, and Windows 2000. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
HeaderMsi.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiSourceListClearAllW (Unicode) and MsiSourceListClearAllA (ANSI)

See Also

AllowLockdownBrowse
AlwaysInstallElevated
DisableBrowse
Installation Context
ProductCode
Source Resiliency
LookupAccountName
MsiSourceListForceResolution

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.