SetTargetPath Method (directory, value)

DTF API

Copy image CopyHover image
Deployment Tools Foundation SetTargetPath Method (directory, value)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerSessionSetTargetPath(String, String)
Sets the full path to the designated folder on the installation target drive.
Declaration Syntax
C# Visual Basic Visual C++ F#
public void SetTargetPath(
	string directory,
	string value
)
Public Sub SetTargetPath ( 
	directory As String,
	value As String
)
public:
void SetTargetPath(
	String^ directory, 
	String^ value
)
member SetTargetPath : 
        directory : string * 
        value : string -> unit 
Parameters
directory (String)
value (String)
Remarks

Setting the target path of a directory changes the path specification for the directory 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.

Do not attempt to configure the target path if the components using those paths are already installed for the current user or for a different user. Check the ProductState property before setting the target path to determine if the product containing this component is installed.

Win32 MSI API: MsiSetTargetPath

Exceptions
Exception Condition
ArgumentException the folder was not found in the Directory table
InvalidHandleException the Session handle is invalid

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.11.1.2318)