GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing basicx-strgv.github.io — WGet.NET: WGet.NET
Loading...
Searching...
No Matches
WGet.NET ❓ What is WGet.NETWGet.NET is a WinGet wrapper library for .Net that allows you to easily install, update, uninstall and more, with the help of WinGet, from your application.
I created it for another project and then made a library out of it in the hope it might be useful to someone else too. If you miss a feature or find a problem with the library, feel free to create an issue. ✨ Version 4.0Version 4.0 is intended as a “health” update for the library and therefore includes changes to the structure, classes and functions. But fear not, no functionality is lost and all breaking changes are documented and provide information on how to change the implementation. You can find the full migration documentation here. This was done to improve maintainability and the experience of using the library, by improving the data structure, removing redundant or useless functions and making the implementation more consistent. More information about version 4.0 can be found here. 📓 Documentationhttps://basicx-strgv.github.io/WGet.NET/ ⚡ Features
📦 NuGet PackageYou can get the NuGet package here: https://www.nuget.org/packages/WGet.NET/ ❗ RequirementsWinGet needs to be installed on the system. If WinGet is not installed on your system you can get it here: https://github.com/microsoft/winget-cli 💡 Getting startedThe needed namespace is WGetNET ( Exceptions are located in the WinGetInfo:The WinGet class can be used to get information about WinGet itself. Using this class to check if winget is installed could look like this: WinGet winget = new WinGet();
if (winget.IsInstalled)
{
Console.WriteLine("WinGet is installed.");
}
else
{
Console.WriteLine("WinGet is NOT installed.");
}
WinGetPackageManager:The WinGetPackageManager class is used for everything that has to do with packages. The code for installing a package could look like this: WinGetPackageManager packageManager = new WinGetPackageManager();
packageManager.InstallPackage("Git.Git");
WinGetSourceManager:The WinGetSourceManager class is used for everything that has to do with sources. ***To use the add, remove and reset functions, the process needs to have administrator privileges. The code for adding a source could look like this: WinGetSourceManager sourceManager = new WinGetSourceManager();
sourceManager.AddSource("msstore", "https://storeedgefd.dsx.mp.microsoft.com/v9.0", "Microsoft.Rest");
Find Latest Versions of a Package:Using the WinGetPackageManager class you can use the You would then be able to compare this to the current version of the package ( WinGetPackageManager packageManager = new WinGetPackageManager();
string packageId = "nkdAgility.AzureDevOpsMigrationTools";
WinGetPackage package = packageManager.GetInstalledPackages(packageId, true).FirstOrDefault();
if (package.AvailableVersion > package.Version)
{
Console.WriteLine("You are currently running version {currentVersion} and a newer version ({latestVersion}) is available. You should update now using Winget command 'winget {packageId}' from the Windows Terminal.", package.Version, package.AvailableVersion, packageId);
}
Created by basicx-StrgV
| ||
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |