Skip to content

SourceList Class

A list of sources for an installed product or patch.

MethodDescription
Add(item)Adds a network or URL source to the source list of the installed product.
Clear()Clears sources of all types: network, url, and media.
ClearNetworkSources()Removes all network sources from the list. URL sources are not affected.
ClearUrlSources()Removes all URL sources from the list. Network sources are not affected.
Contains(item)Checks if the specified source exists in the list.
CopyTo(array, arrayIndex)Copies the network and URL sources from this list into an array.
ForceResolution()Forces the installer to search the source list for a valid source the next time a source is required. For example, when the installer performs an installation or reinstallation, or when it requires the path for a component that is set to run from source.
GetEnumerator()Enumerates the network and URL sources in the source list of the patch or product installation.
Insert(item, index)Adds or reorders a network or URL source for the product or patch.
Remove()Removes a network or URL source.
PropertyDescription
CountGets the number of network and URL sources in the list.
DiskPromptGets or sets the prompt template that is used when prompting the user for installation media.
IsReadOnlyGets a boolean value indicating whether the list is read-only. A SourceList is never read-only.
ItemGets or sets source list information properties of a product or patch installation.
LastUsedSourceGets or sets the most recently used source location for the product.
LastUsedTypeGets the type of the last-used source.
MediaListGets the list of disks registered for the media source of the patch or product installation.
MediaPackagePathGets or sets the path relative to the root of the installation media.
PackageNameGets or sets the name of the Windows Installer package or patch package on the source.
WixToolset.Dtf.WindowsInstaller.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8

Adds a network or URL source to the source list of the installed product.

public void Add(
string item
)
ParameterTypeDescription
itemstringPath to the source to be added. This parameter is expected to contain only the path without the filename.

If this method is called with a new source, the installer adds the source to the end of the source list. If this method is called with a source already existing in the source list, it has no effect. Win32 MSI APIs: MsiSourceListAddSource , MsiSourceListAddSourceEx

  • M:WixToolset.Dtf.WindowsInstaller.SourceList.Insert(System.String,System.Int32)

Clears sources of all types: network, url, and media.

public void Clear()

Win32 MSI API: MsiSourceListClearAll

Removes all network sources from the list. URL sources are not affected.

public void ClearNetworkSources()

Win32 MSI API: MsiSourceListClearAllEx

Removes all URL sources from the list. Network sources are not affected.

public void ClearUrlSources()

Win32 MSI API: MsiSourceListClearAllEx

Checks if the specified source exists in the list.

public bool Contains(
string item
)
ParameterTypeDescription
itemstringcase-insensitive source to look for

bool true if the source exists in the list, false otherwise

Copies the network and URL sources from this list into an array.

public void CopyTo(
System.String[] array,
int arrayIndex
)
ParameterTypeDescription
arraySystem.String[]destination array to be filed
arrayIndexintoffset into the destination array where copying begins

Forces the installer to search the source list for a valid source the next time a source is required. For example, when the installer performs an installation or reinstallation, or when it requires the path for a component that is set to run from source.

public void ForceResolution()

Win32 MSI APIs: MsiSourceListForceResolution , MsiSourceListForceResolutionEx

Enumerates the network and URL sources in the source list of the patch or product installation.

public IEnumerator<System.String> GetEnumerator()

Win32 MSI API: MsiSourceListEnumSources

Adds or reorders a network or URL source for the product or patch.

public void Insert(
string item,
int index
)
ParameterTypeDescription
itemstringPath to the source to be added. This parameter is expected to contain only the path without the filename.
indexintSpecifies the priority order in which the source will be inserted

If this method is called with a new source and index is set to 0, the installer adds the source to the end of the source list. If this method is called with a source already existing in the source list and index is set to 0, the installer retains the source’s existing index. If the method is called with an existing source in the source list and index is set to a non-zero value, the source is removed from its current location in the list and inserted at the position specified by Index, before any source that already exists at that position. If the method is called with a new source and Index is set to a non-zero value, the source is inserted at the position specified by index , before any source that already exists at that position. The index value for all sources in the list after the index specified by Index are updated to ensure unique index values and the pre-existing order is guaranteed to remain unchanged. If index is greater than the number of sources in the list, the source is placed at the end of the list with an index value one larger than any existing source. Win32 MSI API: MsiSourceListAddSourceEx

Removes a network or URL source.

public bool Remove()

Win32 MSI API: MsiSourceListClearSource

Gets the number of network and URL sources in the list.

public int Count { get; set; }

Gets or sets the prompt template that is used when prompting the user for installation media.

public string DiskPrompt { get; set; }

Gets a boolean value indicating whether the list is read-only. A SourceList is never read-only.

public bool IsReadOnly { get; set; }

Gets or sets source list information properties of a product or patch installation.

public string Item[
string property
] { get; set; }
ParameterTypeDescription
propertystringThe source list information property name.

Win32 MSI API: MsiSourceListGetInfo

ExceptionDescription
T:System.ArgumentOutOfRangeExceptionAn unknown product, patch, or property was requested

Gets or sets the most recently used source location for the product.

public string LastUsedSource { get; set; }

Gets the type of the last-used source.

public string LastUsedType { get; set; }
  • “n” = network location
  • “u” = URL location
  • “m” = media location
  • (empty string) = no last used source

Gets the list of disks registered for the media source of the patch or product installation.

public SourceMediaList MediaList { get; set; }

Gets or sets the path relative to the root of the installation media.

public string MediaPackagePath { get; set; }

Gets or sets the name of the Windows Installer package or patch package on the source.

public string PackageName { get; set; }