DepotDownloaderSubProcess 3.3.0

dotnet add package DepotDownloaderSubProcess --version 3.3.0
                    
NuGet\Install-Package DepotDownloaderSubProcess -Version 3.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DepotDownloaderSubProcess" Version="3.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DepotDownloaderSubProcess" Version="3.3.0" />
                    
Directory.Packages.props
<PackageReference Include="DepotDownloaderSubProcess" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DepotDownloaderSubProcess --version 3.3.0
                    
#r "nuget: DepotDownloaderSubProcess, 3.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=DepotDownloaderSubProcess&version=3.3.0
                    
Install DepotDownloaderSubProcess as a Cake Addin
#tool nuget:?package=DepotDownloaderSubProcess&version=3.3.0
                    
Install DepotDownloaderSubProcess as a Cake Tool

DepotDownloaderSubProcess

NuGet Version .NET Core CI

A C# API wrapping Steam depot downloader in a sub-process utilizing Tmds.ExecFunction library.

This avoids many pitfalls of calling the original utility that has been specifically written for CLI usage. Original code remains largely unchanged to facilitate easy sync with upstream.

Usage

As per ExecFunction documentation, add the following to your Main method.

public static int Main(string[] args)
{
    // Starting a subprocess function? [Tmds.ExecFunction]
    if (ExecFunction.IsExecFunctionCommand(args))
    {
        return ExecFunction.Program.Main(args);
    }

    // Start normally..
}

App download

CancellationTokenSource cts = new CancellationTokenSource();

var cfg = new DepotDownloader.AppDownloadConfig
{
    // AccountSettingsFileName = "custom.config",
    // Username = "user",
    // Password = "pass",
    InstallDirectory = "C:/apps/244310",
    VerifyAll = true,
    AppId = 244310
};
  1. Using an async enumerable:
int? exitCode = null;
await foreach ((string message, bool error) in DepotDownloader.SubProcess.AppDownload(
        cfg, ec => exitCode = ec, new UserConsoleAuthenticator(), cts.Token))
{
    Console.WriteLine("DepotDownloader: " + message);
}

if (exitCode != DepotDownloader.SubProcess.Success)
{
    Console.WriteLine("Download failed");
}
  1. Using a task and callbacks:
void MessageHandler(object sender, DataReceivedEventArgs e)
{
    if (e.Data != null) Console.WriteLine("DepotDownloader: " + e.Data);
}

int exitCode = await DepotDownloader.SubProcess.AppDownload(
        cfg, MessageHandler, MessageHandler, new UserConsoleAuthenticator(), cts.Token);

if (exitCode != DepotDownloader.SubProcess.Success)
{
    Console.WriteLine("Download failed");
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.3.0 126 3 days ago
3.1.0 152 a month ago