Platform SDK: Installing Applications/Setup

SetupAddToSourceList

The SetupAddToSourceList function appends a value to the list of installation sources for either the current user or the system. If the value already exists, it is removed first, so that duplicate entries are not created.

BOOL SetupAddToSourceList(
  DWORD Flags,  // specifies a list to append to
  PCTSTR Source // the source to add to the list
);

Parameters

Flags
Specifies which list to append the source to. This parameter can be any combination of the following values:
SRCLIST_SYSTEM
Add the source to the per-system list. The caller must be an administrator.
SRCLIST_USER
Add the source to the per-user list.
SRCLIST_SYSIFADMIN
If the caller is an administrator, the source is added to the per-system list; if the caller is not a member of the administrators local group, the source is added to the per-user list for the current user.

Note If a temporary list is currently in use (see SetupSetSourceList), the preceding flags are ignored and the source is added to the temporary list.

SRCLIST_APPEND
Add the source to the end of the list. If this flag is not specified, the source is added to the beginning of the list.
Source
Pointer to the source to add to the list.

Return Values

If the function succeeds, the return value is a non-zero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Setupapi.h.
  Library: Use Setupapi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

Overview, Functions, SetupRemoveFromSourceList, SetupSetSourceList