SetTargetPath Method (directory, value)

Microsoft Deployment Compression & Installer

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++
public void SetTargetPath(
	string directory,
	string value
)
Public Sub SetTargetPath ( 
	directory As String,
	value As String
)
public:
void SetTargetPath(
	String^ directory, 
	String^ value
)
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.9.1006.0)