Windows package management with WinGet CLI

Native package Management to Microsoft Windows package management with WinGet CLI

It took decades, but finally, there is a Windows-own package management – well, soon at least. Still, it is a preview, but the packaging-it was already possible to drill – bumpy road included.

Companies

WinGet is expected to offer a simple way to create Software packages for Windows and distribute.WinGet is expected to offer a simple way to create Software packages for Windows and distribute.

(© Kzenon – stock.adobe.com)

One of the biggest advantages of Linux is the package management has always been: On a lean command-line Clients, dozens of programs are easy to install, including dependencies and ways to uninstall clean that later.

The recently presented Chocolatey was 2020 the most Mature version of a package management system for Windows. Now Microsoft has the need, or at least the Use of apparently, has brought detected an own package management at the Start.

The Windows Package Manager is based on Open-Source Software, running on the command line and allows it, of course, that third parties to manage their own packages. Maintain the packages on GitHub, as well as the associated winget Client.

The two tools are apart but very different in terms of Workflow and possibilities.

The Windows Package Manager

Before you can deal with the Windows package Manager that wants to be installed. This works currently, only detours. The simpler version without logging in via the Microsoft account On the GitHub page, in the area of Releases, the compiled WinGet Binary is found, with a significant drawback – installed so there are no Updates.

For the following more comfortable variant winget-cli along with the App Installer set up. This, in turn, to get interested in Windows 10 Insider Build, or the Package Manager Insiders Program and then using the updated Windows Store.

Once this hurdle is skipped, you can search for it in the Terminal, for example, after the pack program 7-Zip:

winget search 7zip

… spits out results. Generally speaking, the Client is clear and comes with eight commands, which are, however, constantly expanding:

install: to Install

show: for package details

source: Administration of the sources

search: App will find and display Info

hash and validate: Verification of the installation files

settings: for the internal settings

features: to View experimental features (such as Support for the Microsoft Store).

Basically, the Client from the user’s point of view, works completely easily Find, Install, and Uninstall runs smooth. But only at first glance, a second revealed in a very early stage winget: There are no dependencies to be taken into account! And that makes the whole System is currently basically completely unusable.

Of course, there are Tickets to GitHub, and you can probably assume that the function will follow, since the actual joke of a package Manager would otherwise be completely lost. And still a much-debated and desirable Feature is still missing: so Far, only genuine Installer may be bundled, no ZIP files and not portable programs, which consist only of a single EXE. Also if there is at least a Workaround.

Another “little thing”, it should be mentioned: It only Manifests in YAML Format to be stored, not the actual Software. In the case of Chocolatey own smaller programs without any problem with the package “host”. For winget, one must ask the Installer to Download.

For each major team project, this is a matter of course, but for hobby developers with small individual Tools, which are not developed further, it is likely to constitute an additional hurdle. Whether that will ultimately keep the offer reasonably clean, or rather the diversity of constriction, must show the time.

On the positive side, the creation of packages is but to mention. Here is the Microsoft-variant beginner-friendly than, for example, Chocolatey. The package is limited basically to a single YAML file with a very simple Syntax, and a very few will inevitably required entries. On the other Tools that make the job as easy as possible.

The WinGetYamlGenerator helps to avoid errors.The WinGetYamlGenerator helps to avoid errors.

(Image: Long / Peter Torr (Microsoft))

The WinGetYamlGenerator, for example, offers a very simple form to Complete the minimum information. This also includes Creating a hash of the Download files for later Review.

Packaging

A prerequisite is that a Tool is already available online and as mentioned in an executable Version, that is to say, MSI, EXE, or the like. In addition, a Link to the license, should exist, even if only to specify a license name is mandatory.

Then, it is possible to use the WinGetYamlGenerator – the converts, however, almost only the necessary data: According to the names of the Tools and of the Publishers, the Tool automatically generates a correct ID of it and, quite simply, the pattern “publisher.nam“ less certain special characters.

Download-URL, version number, (also the Name of the YAML file), license information and Installer-version to follow. Finally, the actual Installer is added. Here is the Download URL is specified, the Installer downloaded and then for the calculation of the SHA256 Hashes used.

At this point, the only flaw lurks probably way: For the selected type of Installer must be given the Option for an unattended (Silent) Installation; for Nullsoft-Installer, for example, “/S”. In the YAML file itself, any switch can be passed, but the Silent switch is mandatory. This is a limitation currently – Silent-Install needs to be supported.

The package is already finished and with the example command “winget validate 1.0.0 liable.yaml“ check. Here is an example of the Manifest to the generator with the minimum required information:

Id: MeineProjekte.MeinTool
Publisher: Meine Projekte
Name: Mein Tool
Version: 1.0.0.0
License: GNU General Public License v2.0
InstallerType: EXE
Installers:
- Arch: x86
InstallerType: NULLSOFT
Url: https://www.example.com/mein-installer.exe
Sha256: FC73D4B6...
Silent: /s

You can see The Code is pretty trivial, a graphical application is required for barely a second Time.

Publish

Publishing in the Repository may be solved in the case of Chocolatey little more comfortable, because it works directly with the CLI Client. Because the Windows package Manager Repo is hosted on GitHub, following the expiration fortunately, the Standard GitHub Workflow Pull Requests:

  • Locally git clone to clone my fork
  • Branch build: git checkout -b my-branch (optional)
  • Manifest git add manifestmy projectsmy-package1.0.0.add.:yaml
  • Commit: git commit-m “My Commit message”

Then, the Pull Request for the Commit in the Windows Package Manager is a Repo to create. Who would like to add several Manifestos, requires separate Branches. Then, an automated validation process follows a Bot, in the course of which, under the circumstances, to expect notifications about errors and problems. And one should keep in mind: There are only seven days to solve such Issues – otherwise, the Pull Request will be closed automatically.

Conclusion

The Windows package Manager could make Windows much more practical – if Microsoft is going the right way. The base fits now, but it’s essential features are still missing. And from the point of view of the Open-Source enthusiasts will probably do well around a little – not everything is how it is used and how it corresponds to the sense of free Software.

This begins with the almost obligatory sign in with a Microsoft account, without which there is as yet no Updates. And also statements such as the following do not encounter many of the RAFT friends absolutely loved: “Microsoft reserves the right to make a Submission for whatever reason.”

Of course, if Microsoft manages the scripts in the Repository with the User, to decide which packets are recorded or rejected. But “for whatever reason”? Chocolatey for more details, when something why is rejected, transparency is now time to Open Source!

The potential is enormous, both for end users as well as for developers and administrators. However, the throw-in is allowed, the use of resources from the point of view of the Windows, the users, developers, and Admins certainly better Chocolatey would be invested. Microsoft is also, of course, quite different.

(ID:47021084)

Ready to see us in action:

More To Explore

IWanta.tech
Logo
Enable registration in settings - general
Have any project in mind?

Contact us:

small_c_popup.png