| Windows Installer |
The MsiSourceListSetInfosets information about the source list for a product or patch in a specific context.
UINT MsiSourceListSetInfo( LPCTSTR szProductCodeOrPatchCode, LPCTSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCTSTR szProperty, LPCTSTR szValue );
| Type of SID | Meaning |
|---|---|
| NULL | NULL denotes the currently logged on user. When referencing the current user account, szUserSID can be NULL and dwContext can be MSIINSTALLCONTEXT_USERMANAGED or MSIINSTALLCONTEXT_USERUNMANAGED. |
| User SID | Specifies enumeration for a particular user in the system. An example of a user SID is "S-1-3-64-2415071341-1358098788-3127455600-2561". |
Note The special SID string s-1-5-18 (system) cannot be used to enumerate products or patches installed as per-machine. Setting the SID value to s-1-5-18 returns ERROR_INVALID_PARAMETER.
Note The special SID string s-1-1-0 (everyone) should not be used. Setting the SID value to s-1-1-0 fails and returns ERROR_INVALID_PARAM.
| Type of context | Meaning |
|---|---|
| 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. |
If the property being set is "LastUsedSource", this parameter also specifies the type of source as network or URL. In this case, the dwOptions parameter must be a combination of one of the following MSISOURCETYPE_* constants and one of the following MSICODE_* constants.
| Flag | Meaning |
|---|---|
| MSISOURCETYPE_NETWORK | The source is a network type. |
| MSISOURCETYPE_URL | The source is a URL type. |
| MSICODE_PRODUCT | szProductCodeOrPatchCode is a product code GUID. |
| MSICODE_PATCH | szProductCodeOrPatchCode is a patch code GUID. |
| Name | Meaning |
|---|---|
| INSTALLPROPERTY_MEDIAPACKAGEPATH "MediaPackagePath" |
The path relative to the root of the installation media. |
| INSTALLPROPERTY_DISKPROMPT "DiskPrompt" |
The prompt template used when prompting the user for installation media. |
| INSTALLPROPERTY_LASTUSEDSOURCE "LastUsedSource" |
The most recently used source location for the product. If the source is not registered, the function calls MsiSourceListAddSourceEx to register it. On successful registration, the function sets the source as the LastUsedSource. |
| INSTALLPROPERTY_PACKAGENAME "PackageName" |
The name of the Windows Installer package or patch package on the source. |
| Value | Meaning |
|---|---|
| ERROR_ACCESS_DENIED | The user does not have the ability to set the source list for the specified product. |
| ERROR_BAD_CONFIGURATION | The configuration data is corrupt. |
| ERROR_INSTALL_SERVICE_FAILURE | The Windows Installer service could not be accessed. |
| ERROR_INVALID_PARAMETER | An invalid parameter was passed to the function. |
| ERROR_SUCCESS | The property was set. |
| ERROR_UNKNOWN_PATCH | The patch was not found. |
| ERROR_UNKNOWN_PRODUCT | The product was not found. |
| ERROR_UNKNOWN_PROPERTY | The source property was not found. |
| ERROR_FUNCTION_FAILED | 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.
An exception to the above rule is setting "LastUsedSource" to one of the registered sources. If the source is already registered, a non-administrator can set "LastUsedSource" to their own installations (managed or non-managed) and per-machine installations, irrespective of policies.
Available beginning with Windows Installer version 3.0.
| Version | Requires Windows Installer 3.0 or later on Windows Server 2003, Windows XP, and Windows 2000. |
|---|---|
| Header |
Declared in Msi.h. |
| Library |
Link to Msi.lib. |
| DLL | Requires Msi.dll. |
| Unicode |
Implemented as MsiSourceListSetInfoW (Unicode) and MsiSourceListSetInfoA (ANSI). |