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

In This Topic
    UnpackPPKXLocation Property
    In This Topic
    Gets and sets the folder location for unpacking project packages and project templates
    Syntax
    public string UnpackPPKXLocation {get; set;}
    Public Property UnpackPPKXLocation As String
    Remarks
    Setting an unpacking location automatically sets the AskForUnpackPPKXLocation property 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
    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 PPKX
    {
      //Options are mutually exclusive.
    
      //Setting ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation = true
      //supersedes any value in ApplicationOptions.DownloadOptions.UnpackPPKXLocation
      //and will prompt the user on an unpack. The value of
      //ApplicationOptions.DownloadOptions.UnpackPPKXLocation will be unaffected
      //and is ignored. This is the same behavior as on the Pro UI.
      ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation = true;//override location
    
      //The default location is typically <My Documents>\ArcGIS\Packages
      //Setting ApplicationOptions.DownloadOptions.UnpackPPKXLocation to any
      //location overrides ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation
      //and sets it to false. This is the same behavior as on the Pro UI.
      ApplicationOptions.DownloadOptions.UnpackPPKXLocation = @"D:\data\for_ppkx";
    
      //Or, if ApplicationOptions.DownloadOptions.UnpackPPKXLocation already
      //contains a valid path, set ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation
      //explicitly to false to use the UnpackPPKXLocation
      if (!string.IsNullOrEmpty(ApplicationOptions.DownloadOptions.UnpackPPKXLocation))
      {
        ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation = false;
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also