VelopackExtension.GoogleDrive
1.0.0
dotnet add package VelopackExtension.GoogleDrive --version 1.0.0
NuGet\Install-Package VelopackExtension.GoogleDrive -Version 1.0.0
<PackageReference Include="VelopackExtension.GoogleDrive" Version="1.0.0" />
paket add VelopackExtension.GoogleDrive --version 1.0.0
#r "nuget: VelopackExtension.GoogleDrive, 1.0.0"
// Install VelopackExtension.GoogleDrive as a Cake Addin #addin nuget:?package=VelopackExtension.GoogleDrive&version=1.0.0 // Install VelopackExtension.GoogleDrive as a Cake Tool #tool nuget:?package=VelopackExtension.GoogleDrive&version=1.0.0
VelopackExtension.GoogleDrive
Velopack.GoogleDrive is an extension for Velopack that that allows you to use Google Drive as an update source for Velopack packages. This library enables you to store and manage application updates in a Google Drive folder.
π Features
- π Supports updates from Google Drive folders.
- π Handles both full and delta update packages.
- π Integrates with
ILogger
for logging and monitoring. - π Implements
IUpdateSource
for seamless integration with Velopack.
π Installation
Install via NuGet
Run the following command in your project:
dotnet add package VelopackExtension.GoogleDrive
Or add this to your .csproj
file:
<PackageReference Include="VelopackExtension.GoogleDrive" Version="1.0.0" />
<PackageReference Include="Google.Apis" Version="1.68.0" />
<PackageReference Include="Google.Apis.Drive.v3" Version="1.68.0.3601" />
<PackageReference Include="Google.Cloud.Storage.V1" Version="4.10.0" />
<PackageReference Include="Velopack" Version="0.0.942" />
π Usage
Configure GoogleDriveUpdateSource
Here is an example of how to configure GoogleDriveUpdateSource
:
using Microsoft.Extensions.Logging;
using Velopack;
var folderPath = "https://drive.google.com/drive/folders/YOUR_FOLDER_ID";
var apiKey = "YOUR_GOOGLE_API_KEY"; // [Get Google Drive API key](https://developers.google.com/drive/api)
var packageId = "com.example.myapp";
var logger = LoggerFactory.Create(builder =>
{
builder.AddConsole();
}).CreateLogger<GoogleDriveUpdateSource>();
var source = new GoogleDriveUpdateSource(
folderPath: folderPath,
apiKey: apiKey,
packageId: packageId,
logger: logger,
options: new GoogleDriveUpdateSource.Options
{
ApplicationName = "MyAppUpdater"
});
Retrieve Available Updates
To retrieve a list of available updates:
var releaseFeed = await source.GetReleaseFeed(logger, channel: "stable");
foreach (var asset in releaseFeed.Assets)
{
Console.WriteLine($"Found package: {asset.FileName} (version {asset.Version})");
}
Download and Save Packages
To download a selected package to a local file:
var asset = releaseFeed.Assets.First();
await source.DownloadReleaseEntry(
logger,
releaseEntry: asset,
localFile: "update.nupkg",
progress: percent => Console.WriteLine($"Progress: {percent}%")
);
π Requirements
- .NET 8.0 or later
- A Google account and a Google Drive API key
- Velopack
β Running Tests
To run unit tests:
dotnet test
π€ Contributing
If youβd like to contribute to this project:
- Fork the repository.
- Create a new branch (
git checkout -b my-feature
). - Make your changes.
- Submit a Pull Request.
We welcome all contributions! π
π License
This project is licensed under the MIT License. See the LICENSE file for details.
π§ Contact
If you have questions or need help, feel free to reach out via GitHub Issues.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Google.Apis (>= 1.68.0)
- Google.Apis.Drive.v3 (>= 1.68.0.3601)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Velopack (>= 0.0.942)
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 |
---|---|---|
1.0.0 | 4 | 11/24/2024 |