Managing Installation Sources
Users and applications with administrative privileges can retrieve and modify network, URL, and media source list information for Windows Installer applications and patches on the system.
Windows Installer 2.0: Not supported. Administrators cannot read, reorder, or replace entries in the source list and cannot modify or retrieve source list properties. It is possible to manage Network sources, but not URL or Media sources. Administrators can only manage source lists for per-machine applications or applications installed as per-user for the current user. This prevents administrators using versions earlier than Windows Installer version 3.0 from managing source list information for all users in the system.
Windows Installer 3.0 and later: Users and applications that have administrator privileges can retrieve and modify source list information for Windows Installer applications and patches installed on the system for all users. The source list functions can be used to manage source lists and source list properties for network, URL and media sources. The installer can reorder source lists from an external process.
Users and applications that have administrative privileges can read and modify the following types of source list information:
- Source lists for applications and patches installed for all users on the system.
- Source lists for patch sources that exist apart from the application sources.
- Source lists for URL and media sources that exist apart from network sources.
- Source list properties such as MEDIAPACKAGEPATH, DiskPrompt, LastUsedSource, LastUsedType, and PackageName.
The source lists functions can limit the scope of the source lists found by specifying the installation context and user context. There are three possible installation contexts: per-user (unmanaged), per-machine, and per-user managed. The user context can be a particular user or all users on the system.
Non-administrators cannot modify the source list of an instance of an application or patch that exists under another user's per-user (managed or unmanaged) context. Non-administrators can modify the source lists of an instance of an application or patch installed under the following contexts:
- Their own per-user(unmanaged) context.
- The machine context, but only if the DisableBrowse, AllowLockdownBrowse, and AlwaysInstallElevated policies allows them to browse for an application or patch source.
- Their own per-user managed context, but only if the DisableBrowse, AllowLockdownBrowse, and AlwaysInstallElevated policies allows them to browse for an application or patch source.
Administrators can modify any source list that a non-administrator can modify. In addition, administrators and applications that have administrative privileges can modify the source lists of an application or patch installed under the following contexts:
- Per-machine context.
- Their own per-user (unmanaged) or their own per-user managed context.
- Another user's per-user managed context.
Use the MsiSourceListAddSourceEx function to add or reorder the source list of network and URL sources for a patch or application in a particular context. Use the dwContext parameter to specify the installation context. Use the szUserSid parameter to specify the user context.
Use the MsiSourceListAddSourceEx function to create a source list for a patch that has not yet been applied to any application in the specified context. This can be useful when registering a patch to have elevated privileges. For more information about registering elevated privileges for a patch, see Patching Per-User Managed Applications.
Use the MsiSourceListClearSource function to remove an existing source for an application or patch in a specified context. Removing the current source for an application or patch forces the installer to search the source list for a source the next time a source is required.
Use the MsiSourceListEnumSources function to enumerate sources in the source list of a specified patch or application.
Use the MsiSourceListAddMediaDisk function to add or update the disk information of the media source of a registered application or patch. Each entry is uniquely identified by a disk ID. If the disk already exists, it is updated with the new volume label and disk prompt values. If the disk does not exist, a new disk entry is created with the new values.
Use the MsiSourceListClearMediaDisk function to remove an existing registered disk under the media source for an application or patch in a specific context.
Use the MsiSourceListEnumMediaDisks function to enumerate a list of disks registered under the media source for an application or patch.
Use the MsiSourceListGetInfo and MsiSourceListSetInfo functions to retrieve or modify information about the source list for an application or patch in a specific context. Use the dwContext parameter to specify the installation context. Use the szUserSid parameter to specify the user context.
Use the MsiSourceListClearAllEx function to remove all the existing sources of a given source type for the specified application or patch instance. The patch registration is also removed if the patch is not installed by any application in the same context. Use the dwContext parameter to specify the installation context. Use the szUserSid parameter to specify the user context.
Use the MsiSourceListForceResolutionEx to clear the last used source entry for an application or patch in the specified context. This function removes the registration of the property called LastUsedSource. This function does not affect the registered source list. Clearing the LastUsedSource registration forces the installer to do a source resolution against the registered sources the next time it requires the source.