News: 1622121308

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Microsoft releases command-line package manager for Windows - there are snags

(2021/05/27)


Microsoft has released Windows Package Manager 1.0, better known as winget, a command line tool for adding, removing and updating what is installed on the system.

[1]

The Windows Package Manager has a number of arguments through which users can inspect what is installed as well as adding, removing or updating applications

Linux users accustomed to package managers like Apt and Yum – where (if all is going well) applications as well as developer tools and libraries can be managed with simple commands and reboots are rarely required – would love to have a similar experience on Windows.

Third-party options like [2]Chocolatey have existed for a while, but at Build last year Microsoft introduced Winget, [3]saying that "just about every developer has wanted a native package manager in Windows."

Microsoft said that it needed its own first-party package manager, despite the existence of others, in order to manage its own repository of "trusted applications" as well as integrating it with Windows.

AppGet spat

The project got off to a bad start when the developer of AppGet, another existing solution, [4]said that Microsoft approached him with what at first appeared to be a job offer and then, having heard all his suggestions, came up with its own solution using many of the same ideas. The company gave a belated [5]acknowledgment of the issue.

Now, one year on, Winget 1.0 has been released. The features include searching for new packages, listing what is installed, and upgrading or removing them.

Users can get WinGet by installing an application called App Installer from the Windows Store (there are some [6]teething problems with this process).

[7]

[8]

[9]

There are currently over 1,400 packages in the Microsoft Community Repository, [10]according to senior program manager Demitrius Nelon. He also introduced another tool, in preview, called Windows Package Manager Manifest Creator, to generate the manifest needed to submit new packages to the repository.

A nice feature of Winget is that it can manage existing applications installed via the Windows Store or visible in Add/Remove Programs in Control Panel.

Developers can see how many versions of Java they have accumulated with a command like winget list java , for example. The application does not yet fully support the Windows Store though, in that search will not find everything available there (probably a good thing), but only a select subset. There is therefore no provision yet for purchasing software through Winget.

The Reg gives it a spin

Winget will be useful; but dig into it a little and issues soon emerge. We used winget to list LibreOffice installs, and it showed that an old version was installed. Running upgrade downloaded a new installer and verified its installer hash (good), but then said "Installer failed with exit code: 1603". A log is generated (also good) which showed that the installer required elevation; this should happen via a prompt, but for some reason did not work in this case.

The solution was to run Winget as administrator, though the [11]docs say: "Always use caution when running your command prompt as an administrator, and only install applications you trust." Indeed.

[12]

Winget shows when an updated version of a package is available – but upgrading may not be straightforward

Unfortunately the LibreOffice install failed again, this time with error 3010. This one was not so bad: the installation completed successfully, but the log noted: "Restart required. The product installation or update required a restart for all changes to take effect. The restart was deferred to a later time."

The reason for this is that Winget runs msiexec (the command-line tool for installer packages) with the arguments /qn /norestart, which means "install without a user interface and do not force a restart."

[13]

Installing without a user interface may seem convenient, but what about all the important options that complex installs like LibreOffice would normally offer you? The restart thing is a problem too: not restarting is great, but it's frustrating when the application is not fully installed.

A conundrum

This sort of problem comes about because Windows, for both design and legacy reasons, is not as well-suited to package management as Linux. Microsoft has worked hard to steer developers down the route of Windows Store and [14]MSIX packages, but there are plenty of popular applications that do not yet follow this guidance.

"Windows has no proper packages, just various unrelated unmanaged ways of installing things. MSIX might be close, but it comes with so many issues that it's not an option - more on that later. Windows has no centralized repository for software and the store is a massive disaster in many ways," [15]said one user on GitHub.

While an extreme position, there is some truth in this. Winget could, perhaps, be part of the solution, if working nicely with it becomes something businesses demand. The debate from which this comment is taken, however, illustrates the dilemma well. The question was whether to drop support for applications with legacy installers that are not transactional and have unpredictable behaviour.

Drop such support, and Winget would be less useful. Maintain it, and Windows trundles on, seemingly never escaping its disorganized past. ®

Get our [16]Tech Resources



[1] https://regmedia.co.uk/2021/05/27/winget.png

[2] https://chocolatey.org/

[3] https://devblogs.microsoft.com/commandline/windows-package-manager-preview

[4] https://www.theregister.com/2020/05/28/appget_replaced_by_winget_says_dev/

[5] https://devblogs.microsoft.com/commandline/winget-install-learning/

[6] https://github.com/microsoft/winget-cli/issues/995

[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2YK-CGzt6zR9F2YgoEb8GjwAAAMc&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YK-CGzt6zR9F2YgoEb8GjwAAAMc&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[9] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YK-CGzt6zR9F2YgoEb8GjwAAAMc&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[10] https://devblogs.microsoft.com/commandline/windows-package-manager-1-0/

[11] https://docs.microsoft.com/en-us/windows/package-manager/winget/

[12] https://regmedia.co.uk/2021/05/27/list2.png

[13] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YK-CGzt6zR9F2YgoEb8GjwAAAMc&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[14] https://docs.microsoft.com/en-us/windows/msix/packaging-tool/tool-overview

[15] https://github.com/microsoft/winget-cli/issues/407#issuecomment-640215799

[16] https://whitepapers.theregister.com/

Version 1.0

Windows trundles on, seemingly never escaping its disorganized past. FTFY.

Yet Another Anonymous coward

To be fair it's much harder for a $Tn corporation with 1000s of program managers and 100,000s of engineers to build anything than a bunch of randoms on the internet

Restarts

Boothy

Quote: The restart thing is a problem too: not restarting is great, but it's frustrating when the application is not fully installed.

This has always annoyed me with Windows, why do so many user applications, such as Libre Office and many others, need a restart after an update in the first place?

I've been able to install and update things like GFX drivers (such as for nVidia cards) in Windows without needing a reboot for many years now, and that's replacing hardware drivers for something that is actively in use by the system.

So why can't updating a user application, also be done without a restart? Surely it should be much easier to update software that isn't actively in use at the time, than it is to update something that is actively in use, such as drivers for a GFX card?

Re: Restarts

Calum Morrison

A lot of these restarts seem to be unnecessary and - from what I can tell - are probably just a hangover from old versions of Windows or caution on the behalf of the person writing the installer. Many/most apps calling for a restart will work fine without, albeit they may use that restart to tidy up some of their logs etc. Per the article, there seems to be little standardisation in Windows to ensure things are all done in a similar manner.

Re: Restarts

Mike 137

I might be wrong, but it could be due to some parts of the registry only being interrogated at start time. So an installer might add a registry key that the program needs to run, but it only becomes available after a restart.

karlkarl

Linux / BSD package managers work pretty well because the software is simple in terms of filesystem structure (though have IMO too many dependencies these days. Gtk, Gdk, Pango, Cairo, etc should potentially be a single package)

This is one thing that the (early) Mac OS X got right. Single folders that you just drag into a folder on your HD to "install". They went with the approach of all the dependencies bundled in (I like this approach (though despise the rest of macOS), but I understand it does have some limitations).

Solaris 10 had an interesting approach of handling many dependencies of different versions by using entire installation prefixes (/usr/sfw, /opt/sfw, /opt/csw, etc). This was confusing in many ways but was quite a good middle ground between the above.

Whereas Windows software includes all of these updater services, admin registry entries and other weirdness that I think Windows should simply block these days. No, don't cripple Windows by making silly AppStore-like packages, but just make it so distribution via a zip becomes the norm and as soon as an .exe attempts to write into system32 or the registry, then emulate it, or deny it.

People have been working on Windows for decades... why is it still so impossibly bad?

Dan 55

If an OS X app is installed from a package instead of drag and drop, uninstalling (properly) is not so easy. Also the Library folder fills up with data from apps removed ages go. So it's not all roses inside Apple's walled garden.

Winget / Wing It, Winnit

Calum Morrison

Are MS winging it (probably) or is this just a small crumb of shit hanging around a very smelly place?

Embarrassed for them.....

Anonymous Coward

I really am. I know how entrenched Windows is in enterprise, but, well, wow.....

Whilst we are on the subject of BUILDING packages for installation.... I recently had to put some documentation together for windows and mac customers for building their own packages.

macOS: All the tools you need are right there with pkgbuild and productsign. If you wish to use an app to do it, there's some great ones

Windows: What an abysmal merdemess. Had to use NSIS, and it's own quirky scripting language (and it's 25 year old interface). I tried really hard to find a simple solution but....

If you're a windows admin, I sincerely pity you

Most number of restarts for an install ?

Anonymous Coward

I have vague memories of Visual Studio 6 needing about 6 or 7. One for DCOM. One for MFC. One for this. One for that ....

There are snags

vtcodger

A "snag" is what? A bug after application of a lot of lipstick?

Whenever I hear anyone arguing for slavery, I feel a strong impulse to
see it tried on him personally.
-- Abraham Lincoln