ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Core Namespace / DownloadOptions Class / AskForUnpackOtherLocation Property
Example

In This Topic
    AskForUnpackOtherLocation Property
    In This Topic
    Gets and sets the 'Ask where to save before unpacking' option for project packages and templates.
    Syntax
    public bool AskForUnpackOtherLocation {get; set;}
    Public Property AskForUnpackOtherLocation As Boolean
    Remarks
    Setting this property to true automatically clears out the UnpackOtherLocation property and sets the UnpackOtherToProjectLocation property to false.
    This property is automatically set to false if the UnpackOtherLocation property is set or UnpackOtherToProjectLocation is set to true.
    Example
    Get DownloadOptions
    {
      var staging = ApplicationOptions.DownloadOptions.StagingLocation;
    
      var ppkx_loc = ApplicationOptions.DownloadOptions.UnpackPPKXLocation;
      var ask_ppkx_loc = ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation;
    
      var other_loc = ApplicationOptions.DownloadOptions.UnpackOtherLocation;
      var ask_other_loc = ApplicationOptions.DownloadOptions.AskForUnpackOtherLocation;
      var use_proj_folder = ApplicationOptions.DownloadOptions.UnpackOtherToProjectLocation;
    
      var offline_loc = ApplicationOptions.DownloadOptions.OfflineMapsLocation;
      var ask_offline_loc = ApplicationOptions.DownloadOptions.AskForOfflineMapsLocation;
      var use_proj_folder_offline = ApplicationOptions.DownloadOptions.OfflineMapsToProjectLocation;
    }
    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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also