MsiSetTargetPath

[This is preliminary documentation and subject to change.]

The MsiSetTargetPath function sets the full target path for a folder in the Directory table.

UINT MsiSetTargetPath(
  MSIHANDLE hInstall,   // installer handle
  LPCTSTR szFolder,     // folder identifier
  LPCTSTR szFolderPath  // full path for folder, ending in
                        // directory separator
);
 

Parameters

hInstall
Handle to the installation.
szFolder
Specifies the folder identifier. This is a primary key in the Directory table.
szFolderPath
Specifies the full path for the folder, ending in a directory separator.

Return Values

ERROR_DIRECTORY
The target path could not be set.
ERROR_INVALID_HANDLE
An invalid or inactive handle was supplied.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_SUCCESS
The function succeeded.

Remarks

The MsiSetTargetPath function changes the path specification for the target directory named in the in-memory Directory table. Also, the path specifications of all other path objects in the table that are either subordinate or equivalent to the changed path are updated to reflect the change. The properties for each affected path are also updated.

If an error occurs in this function, all updated paths and properties revert to their previous values. Therefore, it is safe to treat errors returned by this function as non-fatal.

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msiquery.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Database Access Reference, Installer Location Functions