ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core Namespace / DownloadOptions Class / UnpackOtherLocation Property
Example

In This Topic
    UnpackOtherLocation Property
    In This Topic
    Gets and sets the folder location for unpacking all files/packages other than project packages and project templates
    Syntax
    public string UnpackOtherLocation {get; set;}
    Public Property UnpackOtherLocation As String
    Remarks
    Setting an unpacking location automatically sets the AskForUnpackOtherLocation and UnpackOtherToProjectLocation properties to false.
    If the folder does not exist, the application attempts to create it when the value is assigned. Attempting to assign a folder location to which the current user does not have write permission will fail. Set to empty string to revert to the application default.
    Example
    Set DownloadOptions for UnpackOther
    //UnpackOther settings control unpacking of anything _other than_
    //a ppkx or aptx. Options are mutually exclusive.
    
    //Set ApplicationOptions.DownloadOptions.UnpackOtherLocation explicitly to
    //toggle ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation and
    //ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation to false
    //Note: default is typically <My Documents>\ArcGIS\Packages, _not_ null.
    //This is the same behavior as on the Pro UI.
    ApplicationOptions.DownloadOptions.UnpackOtherLocation = @"D:\data\for_other";
    
    //or...to use a location already stored in UnpackOtherLocation as the
    //default without changing it, 
    //set ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation and
    //ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation to false
    //explicitly. This is the same behavior as on the Pro UI.
    if (!string.IsNullOrEmpty(ApplicationOptions.DownloadOptions.UnpackOtherLocation))
    {
      ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation = false;
      ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation = false;
    }
    
    //Setting ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation to
    //true overrides any UnpackOtherLocation value and sets 
    //ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation to false.
    //This is the same behavior as on the Pro UI.
    ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation = true;
    
    //Setting ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation to
    //true overrides any UnpackOtherLocation value and sets 
    //ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation to false.
    //This is the same behavior as on the Pro UI.
    ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation = false;
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also