The MsiSourceListClearSource function removes an existing source for a product or patch in a specified context. The patch registration is also removed if the sole source of the patch gets removed and if the patch is not installed by any client in the same context. Specifying that MsiSourceListClearSource 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.
UINT MsiSourceListClearSourceA( LPCSTR szProductCodeOrPatchCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCSTR szSource );
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.
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.
This parameter specifies the context of the product or patch instance. This parameter can contain one of the following values.
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.
||The source is a network type.|
||The source is a URL type.|
||szProductCodeOrPatchCode is a product code.|
||szProductCodeOrPatchCode is a patch code.|
Source to remove. This parameter is expected to contain only the path without the filename. The filename is already registered as "PackageName" and can be manipulated through MsiSourceListSetInfo. This argument is required.
The MsiSourceListClearSource function returns the following values.
||The user does not have the ability to remove a source. Does not indicate whether the product or patch was found.|
||The configuration data is corrupt.|
||Could not access the Windows Installer service|
||An invalid parameter was passed to the function.|
||The source was removed or not found.|
||The specified patch is unknown.|
||The specified product is unknown.|
||Unexpected internal failure.|
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 the DisableBrowse, AllowLockdownBrowse, and AlwaysInstallElevated policies.
|Minimum supported client||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. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.|