ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Core Namespace / DownloadOptions Class / AskForUnpackPPKXLocation Property
Example

In This Topic
    AskForUnpackPPKXLocation Property
    In This Topic
    Gets and sets the 'Ask where to save before unpacking' option for project packages and templates.
    Syntax
    public bool AskForUnpackPPKXLocation {get; set;}
    Public Property AskForUnpackPPKXLocation As Boolean
    Remarks
    Setting this property to true automatically clears out the UnpackPPKXLocation property. This property is automatically set to false if the UnpackPPKXLocation property is set (via add-in or UI).
    Example
    Set DownloadOptions for PPKX
    //Options are mutually exclusive.
    
    //Setting ApplicationOptions.DownloadOptions.AskForUnpackPPKXLocation = true
    //superseeds 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, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also