DepotDownloaderSubProcess 3.4.0
dotnet add package DepotDownloaderSubProcess --version 3.4.0
NuGet\Install-Package DepotDownloaderSubProcess -Version 3.4.0
<PackageReference Include="DepotDownloaderSubProcess" Version="3.4.0" />
<PackageVersion Include="DepotDownloaderSubProcess" Version="3.4.0" />
<PackageReference Include="DepotDownloaderSubProcess" />
paket add DepotDownloaderSubProcess --version 3.4.0
#r "nuget: DepotDownloaderSubProcess, 3.4.0"
#:package DepotDownloaderSubProcess@3.4.0
#addin nuget:?package=DepotDownloaderSubProcess&version=3.4.0
#tool nuget:?package=DepotDownloaderSubProcess&version=3.4.0
DepotDownloaderSubProcess
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
Prepare call:
CancellationTokenSource cts = new CancellationTokenSource();
var cfg = new DepotDownloader.AppDownloadConfig
{
// AccountSettingsFileName = "custom.config",
// Username = "user",
// Password = "pass",
InstallDirectory = "C:/apps/244310",
VerifyAll = true,
AppId = 244310
};
Method A) 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");
}
Method B) Using a task and message 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");
}
Pubfile (Workshop) download
Pubfile download is similiar to App download, but uses PubFileDownloadConfig
:
var cfg = new DepotDownloader.PubFileDownloadConfig
{
AppId = ...,
PublishedFileId = ...
};
DepotDownloader.SubProcess.PubFileDownload(cfg, ...)
UGC (Workshop) download
UGC download is similiar to App download, but uses UGCDownloadConfig
:
var cfg = new DepotDownloader.UGCDownloadConfig
{
AppId = ...,
UGCId = ...
};
DepotDownloader.SubProcess.UGCDownload(cfg, ...)
Product | Versions 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- EnvDTE (>= 17.8.37221)
- protobuf-net (>= 3.2.52)
- QRCoder (>= 1.6.0)
- SteamKit2 (>= 3.3.0)
- Tmds.ExecFunction (>= 0.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.