r/sysadmin •

📢 Windows Package Manager | winget.exe

[deleted] — view deleted post

0 Upvotes

126 comments sorted by

33

u/a_false_vacuum May 19 '20

I hope they also add stuff like SQL Server and other Microsoft middleware to this system. That would be a dream for automated deployments. No more home-made scripted installs, just call the package manager like you do on Linux.

I'm pumped for this one.

3

u/[deleted] May 20 '20

[removed] — view removed comment

1

u/a_false_vacuum May 20 '20

It is doable for Microsoft to provide this. I see they have some fairly heavy-weight stuff up there, Visual Studio is no trivial install depending on what roles you add to it.

121

u/[deleted] May 19 '20

Yeah, this is a massive game-changer. Folks that aren't hyped for this likely aren't that familiar with package management systems.

We can create custom repos as well, per the documentation. This is a godsend for developers (and IT for various reasons).

The github is over here.

Ninite about to disappear though. lol.

56

u/theevilsharpie Jack of All Trades May 19 '20

Let me recycle my comment about Windows package managers from 2014:

Windows package management isn't a problem that can be fixed with a shinier tool.

Linux package management succeeds because the software in a distro's repositories is FOSS, which means the maintainers were able to legally repackage and redistribute it using a common package format. Some commercial software vendors also use the package manager, since it's guaranteed to be present and makes it easy to distribute updates.

Many Windows applications are not FOSS, and cannot be redistributed without the permission of the copyright holder. Given that many commercial software vendors cover their distribution costs with advertising/up sells on their web site or crapware bundled in the installer, there's little incentive for these vendors to use a third-party software distribution mechanism. This is why Ninite has a relatively limited selection, compared to the thousands of applications available in a typical Linux distro repository.

Chocolatey tries to get around this reality by linking directly to the installers on the vendors' website/CDN. However, not only is this incredibly insecure, you're at the mercy of the vendor to maintain that distribution point. In addition, Chocolatey relies on the vendor providing a silent install option. The installer doesn't have one? Sucks to be you.

OneGet gives vendors the ability to create their own distributions engines and wrap it up in a common API, but the vendors that care already have the distribution technologies in place, and they're not going to replace that (or frankly, even supplement it) with a system that works for the small fraction of the userbase that has a version of Windows with OneGet.

I predict OneGet will follow the same path as MSI, PowerShell, Group Policy, SCCM, and many other Microsoft sysadmin tools: used heavily by Microsoft and a handful of their major partners, but ignored by pretty much anyone else.

That was for Windows OneGet, but you can just 's/OneGet/Windows Package Manager/g', and it would be just as relevant.

36

u/[deleted] May 19 '20

Well, obviously this highly depends on developer adoption, of course, but this being baked into Windows by default is a step-up.

One of the key things that folks have complained was missing from Windows since the early 00's has been a true package management system.

0

u/[deleted] May 20 '20

[deleted] — view deleted comment

5

u/syshum May 20 '20

The difference here is Powershell is useful to the people that manage systems, and automate things

Software Vendors do not give a shit about that, 90% of software vedors can not even be bothered to create a proper installer for their software, they devote almost no resources to the Installer team, and the installer is an after thought

it is highly unlikely these vendors will adopt package management.

One exception to this is if the major installer systems (installShield, etc) get support that does not require the vendor to do anything on their end then maybe but I would not hold my breath for that, for example InstallShield still had problems with Silent installs unless the vendor manually adds support.

2

u/Nossa30 May 21 '20

90% of software vedors can not even be bothered to create a proper installer for their software

2020 and its shocking how true this fact is. I guess not all developers are IT folks lol???

3

u/Sincronia Sysadmin May 20 '20

Chocolatey tries to get around this reality by linking directly to the installers on the vendors' website/CDN. However, not only is this incredibly insecure, you're at the mercy of the vendor to maintain that distribution point. In addition, Chocolatey relies on the vendor providing a silent install option. The installer doesn't have one? Sucks to be you.

Maybe I'm wrong, but isn't this how this new windows package manager works?

2

u/VIKTORVAV99 May 20 '20

It it. At least for now.

2

u/okay-wait-wut May 20 '20

If you build it, they will come...

Windows Store.

8

u/kerubi Sysadmin May 20 '20

MSI, PowerShell, GroupPolicy ignored? Well, pretty much as much as Windows is ignored..

4

u/theevilsharpie Jack of All Trades May 20 '20

How many third-party applications have you come across (that aren't targetted at system administrators) that supplied their own Group Policy administrative templates or PowerShell CmdLets?

3

u/trail-g62Bim May 20 '20

You have a point on GP but Powershell is used by others. Vmware and veeam are two off the top of my head and they are major players.

2

u/theevilsharpie Jack of All Trades May 20 '20

that aren't targeted at system administrators

2

u/trail-g62Bim May 20 '20

Sorry I missed that part. But why on earth would anyone make GP templates or cmdlets for non-admin/Enterprise stuff? A package manager makes sense for people to learn how to use at home, if they want. Group policy cant even be used at home and 99% of the people don't need to know that powershell even exists.

3

u/theevilsharpie Jack of All Trades May 20 '20

Sorry I missed that part. But why on earth would anyone make GP templates or cmdlets for non-admin/Enterprise stuff?

When I say "targeted at system administrators," I'm talking about software where system admins are the intended end users. Veeam, vSphere, and other infrastructre-related tools would fall into that bucket.

However, there's plenty of software that an enterprise would need to run where the end user is some other other business unit. I'm sure everyone here can name some ERP, CRM, or other line-of-business software that they have to support. The likelihood that they have any built-in support for management via GP, PS, or anything of the sort is very low.

1

u/junon May 20 '20

Yeah, but this is a command line tool to install apps, isn't it? Isn't that, kinda be default, sort of already targeted at admins?

Like, no random windows user is gonna use this and literally no one in an enterprise, outside of an admin, is going to be using this... so it seems like it would behoove support for admins.

edit: looking at the whole context of this thread, I think I might have come away with the wrong point that was being made.

2

u/theevilsharpie Jack of All Trades May 20 '20

Windows Package Manager is targeted at admins, but to be useful, it requires third-party software vendors to either provide a package, or making the software amenable to custom packaging. Commercial enterprise software vendors have historically not provided this level of support.

1

u/CaelFrost May 20 '20

Nah dog. "Give examples of non-system administrator tools that use system administrator tools." /s

1

u/kerubi Sysadmin May 25 '20

You don’t need GPO templates to use GPOs to manage registry settings centrally.

I really do not see environments where GPOs or PowerShell is NOT used. What is the alternative? Some 3rd party software?

1

u/theevilsharpie Jack of All Trades May 25 '20

You don’t need GPO templates to use GPOs to manage registry settings centrally.

A single application can have hundreds or thousands of registry and config file settings that control various aspects of the application. Are you going to build, test, and document the GPOs for all that?

My post wasn't referring to you using Windows admin tools, but third parties providing support for their use. For something like a package manager that relies on network effects, third party support is crucial to it being useful.

5

u/CaelFrost May 20 '20

I predict OneGet will follow the same path as MSI, PowerShell,

Hah. "Same path as PowerShell".

Strange statement. Seems like you're looking at this from a forced perspective... or don't believe this statement proved to be incorrect 6 years later.

3

u/JasonJFlavortown May 20 '20

I have to respectfully disagree about that last part, at least in regards to Powershell and Group Policy. I'm sure SCCM has more limited deployment, as does actual MSI editing, but I don't agree that post from 2014 held up :)

2

u/[deleted] May 20 '20

How is linking to the vendors' website insecure? Hell, it's less insecure than linking to some central repository (because whatever is on that central repository probably came from the vendor website).

4

u/theevilsharpie Jack of All Trades May 20 '20

How is linking to the vendors' website insecure?

In the case of Chocolatey, you're dependent on the vendor to continue hosting the artifacts that the package downloads and installs, and you're also dependent on the vendor not to change the software after the fact. Chocolately has some basic checksumming support, but that's not nearly as strong of a guarantee as a full package signature, and it doesn't work for application installers that themselves perform further package installations.

(I will admit that I haven't look at Chocolatey in a while, so some of these concerns might be outdated.)

2

u/dcardon Sr. Sysadmin May 20 '20

Chocolatey is no packaging (it is not self contained, it just points to the download url). Packaging on Windows is a big issue because of redistribution/licensing issue. Chocolatey is trying to avoid this issue by directly downloading but it is no true package... (per debian, centos, redhat, ubuntu, etc. whatever distribution you name)

1

u/okay-wait-wut May 20 '20

Exactly! When I heard this announcement my first thought was .deb or .rpm so I went to go check out the tools for creating a windows package and investigate the format, to my dismay there is no such thing. It's just a reference to an installer. Weak.

1

u/ab12gu Oct 22 '20

I use powershell and I am not a partner.

11

u/fuze-17 Sysadmin May 19 '20

Fine by me! Ninite is great but once again - Linux had this years ago!

4

u/Tmanok Unix, Linux, and Windows Sysadmin May 20 '20

Decades ago *

3

u/Physics_Prop Jack of All Trades May 19 '20

This will save me so much time deploying and updating packages.

1

u/department_g33k Sysadmin May 20 '20

Yeah, RIP Ninite and chocolatey :(

-6

u/Netvork May 20 '20

ninite isnt going anywhere.

If this is anything like WSUS, I have no faith in it working without having to invest a lot of time trying to figure out all the intricacies.

9

u/Hoggs May 20 '20

The architecture of this couldn't possibly be more unlike WSUS.

This is very lightweight and simple, WSUS is an overcomplicated mess.

2

u/TimyTin May 20 '20

without having to invest a lot of time trying to figure out all the intricacies

And all the workarounds you'll need based on certain configurations or previous updates or whatever conflicting bug another Microsoft team introduced into the OS. You'll see posts here how something broke with some common package and a bunch of responses "me too" and it turns out Microsoft screwed up again. The people who are downvoting you must have limited experience with Microsoft or their head so far up their ass, it's confusing them.

5

u/Ditzah Sysadmin May 20 '20 edited May 20 '20

I am super stoked about this, but like one commenter on their GitHub wrote: "All it does is downloading installers (which are not packages) and executing them (which is not management).".

Also no update or uninstall... I will stick to choco for the moment. But I would love to see winget mature and become a usable tool!

0

u/[deleted] May 20 '20

[deleted] — view deleted comment

1

u/gsmitheidw1 Jun 08 '20

Telemetry is there at OS level in Windows 10 anyway unless you have Enterprise/Edu licence.

I believe there are ongoing GDPR cases on that from data projection in both Ireland and Netherlands.

66

u/FeralNSFW May 19 '20

This looks very promising.

At the moment, there's no update command (analogous to yum update), and it doesn't yet automatically install dependencies.

It won't be ready for prime-time until it has those two features, IMO.

But given the immediate public interest in this project, it wouldn't surprise me if those get implemented.

46

u/Suirtimed May 19 '20

+1 the feature so we will prioritize it: https://github.com/microsoft/winget-cli/issues/120

4

u/FeralNSFW May 19 '20

Good call! Thanks!

9

u/[deleted] May 19 '20

Agreed, once update/upgrade is integrated into it, then this will take off pretty quickly.

If I can maintain a package repo instead of putting out a website with constant updates? Fuuuuck. That's so much easier.

"How do I get the newest version?"

"winget update"

4

u/benjwgarner May 21 '20

I'm just tired of every application having to check for its own updates, or worse: running its own separate update checker program in the background.

2

u/jantari May 20 '20

To be fair there's really no difference between "maintaining" the website or "maintaining" this, in both cases you're not really doing anything because it's automated. It's not like anyone manually updates links in HTML when a new version of something comes out 😅

1

u/m9832 Sr. Sysadmin May 20 '20

You've been able to do this with chocolatey for a while now.

2

u/Brandhor Jack of All Trades May 19 '20

not having dependencies automatically installed seems weird but if you think about it most windows programs don't really have dependencies like on linux

15

u/davispuh Jack of All Trades May 19 '20

They do, many programs require some .NET version or VC++ redistributables, DirectX for games. Just see how much stuff you need to install for Visual Studio

3

u/Brandhor Jack of All Trades May 19 '20

yeah but aside from the latest version of net and vc++ they are all bundled with windows, but those are pretty much the only dependencies everything else is usually bundled in with the software

for example on linux if a program use qt5 you'll have a system qt5 installation like for the .net and vc++ libraries and every qt5 programs will use the same libraries, on windows instead every qt5 program will bundle the qt5 dlls

4

u/[deleted] May 20 '20

[removed] — view removed comment

1

u/Loading_M_ May 20 '20

From my experience with Linux, yes the equivalent of all that is commonly installed. Along with many libraries, like openSSL, QT, GTK, etc. These are all seperate packages in a package managed system, but bundled into each application that requires them on windows.

For a point of reference, my current Linux setup (a fairly typical Linux Mint install) has almost a thousand automatically installed packages. Your VC++, directX, and .net count comes nowhere near that number.

This is because you are comparing apples and oranges. A package managed system is installed, updated and maintained differently. Running a full system upgrade, i.e. updating all installed software, the system, kernel, and everything else is a either one or two shell commands on almost every major Linux Distro.

1

u/Brandhor Jack of All Trades May 20 '20

the directx update is actually just for older windows versions, they haven't updated that since 2010

as for the others they are still a tiny amount compared to linux, I remember when I first used mandrake 9 I think and I didn't know about package managers I had to manually download like 20 rpm to install a single program

1

u/anthony785 Jun 04 '20

Yeah but with windows the installer installs those by itself, you dont have to go out and get them manually.

20

u/unixuser011 May 19 '20

Think how this could change Windows Deployment, hopefully no longer having to maintain a fileshare of apps to install, now just run a command at install time, and poof, your app is installed, you may have to add some 3rd party repos, but it's got to be easer than messing around with MSI switches. No more clunky, hacky installs, just winget install <appName>, done.

With this and DoH being tested for the next release, 20H2 is looking like a banger in September/October

4

u/halbaradkenafin Jack of All Trades May 20 '20

Chocolatey has been the solution for that for a long time now and definitely going to be more stable and usable than this for a good while yet.

1

u/segagamer IT Manager May 20 '20

I would still likely want to keep a personal repo around in case one of the things I deploy suddenly disappears.

2

u/crumdev May 21 '20

Most companies like the one I work at would keep their own repo with compatible/vetted versions that can be used for security reasons. Apps can still change hands and malicious code be snuck in although it sounds like several precautions are being put in place to reduce that risk.

15

u/HappyVlane May 19 '20

Assuming developers jump on board and winget gets maintained properly this is going to be great. It will also kill services like Ninite.

12

u/SevaraB Sr. Engineer (N+, CCNA) May 19 '20

Holy... can't wait for this to get merged with prod builds of Windows.

2

u/jantari May 19 '20

It comes as a store update to the "App Installer" (msix/appx sideloading helper) app - so if you don't have the Store blocked, it could already be rolling out to your machines from what I understand. Or is it limited to registered insiders for now?

7

u/savornicesei May 19 '20

I'm wondering if it will install apps in C:\Program Files or dump them all in ProgramData (where every process can read and write).

3

u/jmbpiano May 19 '20

I'm just sitting here shaking my head at Microsoft being Microsoft yet again and reinventing the wheel when they've already got another internal project working in the same domain.

I mean, this would make a little more sense if it were intended for the average power user, but it sounds like they're aiming this squarely at the developer market. So why not work on extending NuGet into a more generalized solution, instead of splitting their development resources across two separate teams and requiring end users to install yet another tool?

0

u/jmp242 May 19 '20

Also, why not just use chocolatey (the FLOSS version)? I mean, what is re-inventing it getting them?

5

u/TheIncorrigible1 All things INFRASTRUCTURE May 19 '20

Read the article. They go over that.

We looked at several other package managers. There were several reasons leading us to create a new solution. One critical concern we had was how to build a repository of trusted applications. We are automatically checking each manifest. We leverage SmartScreen, static analysis, SHA256 hash validation and a few other processes to reduce the likelihood of malicious software making its way into the repository and onto your machine. Another key challenge was all the changes required to be able to deliver the client program as a native Windows application.

3

u/ErikTheEngineer May 19 '20

Another key challenge was all the changes required to be able to deliver the client program as a native Windows application.

I assume that even with the open source lovefest Microsoft seems to be in on, the bar for getting something included as an "in box" portion of a product must be incredibly high. Soon as the next LTSC comes out they're on the hook for supporting it for 10 years so it had better be good. :-)

I guess that's another reason why they decoupled PowerShell from Windows...so they could rev it faster.

1

u/jantari May 19 '20

Chocolatey is under Apache 2.0, this is MIT.

You got it twisted - this is FLOSS, chocolatey is the FOSS or less free alternative.

1

u/jmp242 May 20 '20

Hmmm, I generally don't distinguish between the licenses that much. You're the first person I've ever met that distinguished between FOSS and FLOSS. I guess I just thought FLOSS was the newer hipper term for FOSS.

1

u/jantari May 20 '20

I generally don't distinguish either but you did by specifically using the term FLOSS. There is a difference, even if the reasons for the new term are 20% factual and 80% political

1

u/jmp242 May 20 '20

Well, googling this seems to agree with my point - both Apache and MIT are FLOSS software, and so is GPLv2 and GPLv3. I know I'm being pendantic, but welcome to Reddit and the Internet, and TBH you started it.

https://www.gnu.org/philosophy/floss-and-foss.en.html

FLOSS is the neutral term.

https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licences

Shows that Apache 2.0 is FLOSS per FSF and OSI. For the term FLOSS, there's no difference between Apache 2.0 and MIT.

1

u/benjwgarner May 21 '20

"Excuse me, I'd just like to interject for a moment..."

0

u/[deleted] May 19 '20

[deleted] — view deleted comment

3

u/jmbpiano May 19 '20

NuGet is not an application packaging and deployment platform. It exists to serve C#/PowerShell packages/modules based on how I've seen it used.

That is how it's primarily used now, yes, but there's no reason it can't be used as an application packing system (as Chocolately has already demonstrated).

Sounds like it's going to be there by default. No installation.

What gives you that impression? The announcement talks about installing it from the Microsoft Store. At most I could see them making it available through the "Add Features" interface like they do OpenSSH and RSAT.

2

u/HappyVlane May 19 '20

The announcement talks about installing it from the Microsoft Store.

That is for the Insider program. Microsoft might make it baseline if they think it's ready.

1

u/TheIncorrigible1 All things INFRASTRUCTURE May 19 '20

Which versions of Windows will be supported?

Windows Package Manager will support every Windows 10 version since the Fall Creators Update (1709)! The Windows Package Manager will be delivered with the Desktop App Installer when we ship version 1.0.

Also, yeah, for the preview on Insiders you either need to build it yourself from source or get App Installer from the Store.

No one can speak about what will happen when a GA release happens.

12

u/ErikTheEngineer May 19 '20

Does that mean Chocolatey is dead? Or is the bar for getting packages into WinGet much higher?

It looks like Microsoft is preparing to have WSL and Windows just swap places in some future release and have Windows become a compatibility shim on top of Linux. :-)

2

u/pokemanzred May 19 '20

Seems super easy to add new packages:

https://github.com/microsoft/winget-pkgs

1

u/Atemu12 May 19 '20

Oooh YAML-based.

Not as cool as a language specifically made for package declaration like Nix but the next best thing IMO.

4

u/ErikTheEngineer May 19 '20

Oooh YAML-based.

Off topic, why does everyone love YAML so much? Or any file format where whitespace matters for that matter? I get it, XML is super-verbose, JSON isn't intuitive for non programmers...but YAML?? I don't get it...

5

u/[deleted] May 20 '20

You kind of listed the reasons there...

What else is compelling you think people are missing?

4

u/BadgersInSpace May 20 '20

Because all valid YAML is convertible to valid JSON and vice versa. It's more natural and faster (for me at least) to write something in YAML than in JSON and the whitespace makes it easy to read and makes it look consistent across editors or applications vs having to pretty-print JSON output because 9 times out of 10 it's going to have the whitespace stripped.

I interact with it on a day to day basis for configuration files, and one of the most useful things is the ability to create multi-line strings with |. Trying to do that in JSON requires manual escaping of the newlines, quotes, etc. which would be a nightmare for passing in the text of a Python script, for example, to a content parameter of a Puppet file resource.

YAML is for humans to write something to tell the machine something, where JSON is machine-speak for talking to other machines that is intelligible to humans and can be spoken relatively easily if a human needs to initiate a machine is my interpretation.

Extending that comparison, XML is speaking proper Formal English constantly, which gives you the exact unambiguous specifics... in three times as long as it would have taken to say it in vernacular.

tl;dr less of a pain in the ass to write something in YAML over JSON, and fuck XML

3

u/ExistingObligation May 20 '20

Small correction, valid YAML is not easily convertible to JSON without losing information (namely comments) but the reverse is true, i.e. JSON is a subset of YAML.

1

u/jantari May 20 '20

YAML is easy as fuck and very powerful.

Constructs like verbatim inline text are only possible because of whitespace rules:

verbatim-text: |
  I can \have\ all matter of crazy
    shit here
  and everything including  double  spaces

  Or new
  L
  INES

  \\{ will be preserved perfectly

1

u/[deleted] May 20 '20

Chocolatey could rebuild to implement this if it's in all version of Windows but it could be a year until some places see 1909 let alone a version of Win10 with this up and running and trusted vs existing tools.

I'm all for it, but it will take time to reach all corners.

-2

u/Derpicide May 19 '20

WinGet will probably just turn out like IE. People will probably just use WinGet to load the chocolatey package in the same way people just use IE to install Chrome/Firefox

-1

u/uptimefordays DevOps May 19 '20

I wouldn't think so, I somewhat suspect all of these package managers are based on NuGet. Hopefully Microsoft's bringing package management from Visual Studio to Windows will mean greater adoption of the package model in the Windows ecosystem.

5

u/Defiant001 May 19 '20

So coming from a Windows only perspective here I have a few questions for how this works:

  1. Where are these packages actually coming from? Same Microsoft servers running Windows update?
  2. How will this handle elevation for standard user accounts?
  3. What about local caching, will this leverage an SCCM distribution point or a new role in Win Server?
  4. What about private packages, or encryption, how will this be handled?

3

u/TheIncorrigible1 All things INFRASTRUCTURE May 19 '20
  1. Packages are defined in this repo and added to through pull requests.
  2. No escalation needed, but likely depends on the package - presumably because they're using user-only installs.
  3. No caching, but you can set up a local repository/mirror of packages according to the announcement.
  4. See pt 3.

3

u/randomman87 Senior Engineer May 20 '20

This will be huge if they add it to SCCM and allow DPs to host the content. No longer need I package a million freeware apps and keep them up to date.

4

u/quazywabbit May 20 '20

Already exists for store apps so may end up using the same feature.

https://docs.microsoft.com/en-us/mem/configmgr/core/plan-design/hierarchy/microsoft-connected-cache

1

u/randomman87 Senior Engineer May 20 '20

Thanks! Knew about store apps in SCCM but did not know about this! Another project to add...

4

u/jackmusick May 19 '20

I would literally die if AutoCAD and Quickbooks made it in this at some point. I would love a quick, one liner for MDT or our RMM.

3

u/cybermoloch May 19 '20

I've been working on a similar thing (using a JSON manifest) based on PSAppDeployToolkit and was hoping to start a blog with a more official release info but I'm just going to throw this out there as is:

https://gitlab.com/cybermoloch/psappdeploytoolkit-plus

I hope this WinGet does everything I was working on. (I have more manifests that are not committed but I want to keep working on this for now as most of the time, I need to tease out method to get a silent install going.)

7

u/fast4shoot May 19 '20

But... it's not a package manager?

From what I can tell it just downloads an installer and runs it?

What about all the other things that a package manager does? Such as updates, uninstallation, integrity validation, dependency resolution, conflict resolution, or at least knowing which files belong to which package?

This just seems like another half-assed attemt that seems familiar on the outside (just run `winget install <package>` just like you would run `apt install <package>` on Linux guys, it's totally the same!), but behind the scenes it's a pile of crap built on top of all the horrible installers that already exist.

2

u/Aetheus May 20 '20

Is that not just a result of it being a MVP right now? I assume it will eventually have all those features you mentioned, but they're just putting their foot in the door right now

3

u/fast4shoot May 20 '20

Is it really an MVP if you have to completely redesign the entire thing in order to move it forward?

1

u/Aetheus May 21 '20

In what way will it require a complete redesign to improve it? What features or behaviours are impossible for it right now?

2

u/fast4shoot May 21 '20 edited May 22 '20

Managing anything installed via EXEs or (I believe) MSIs is going to be impossible.

1

u/Aetheus May 22 '20

How so? Aren't most EXE/MSI installers deterministic (e.g: glorified archives that just need to be extracted + maybe some registry key bullshit)? If so, it shouldn't be too hard to keep checksums of installs for verifying versions, repairing broken installs, etc.

Genuine question btw. I don't dive deep into how Linux package managers like apt or pacman work. I'm not even a sysadmin - I'm just a dev that heard about winget, searched it on Reddit, and stumbled into this thread.

2

u/fast4shoot May 22 '20

EXE installers are just arbitrary executables whose purpose is to install an application. Because it's an executable, there's really no general way to inspect that executable. You can't extract the files that it installs out of it, because they may be stored in whatever weird way the installer's author (or the tool they used) decided. Or the files may not be stored in the executable at all, they may be downloaded from the internet. Or some of the files (like configuration files, desktop shortcuts and such) may be generated on the fly.

The same also applies to registry keys.

You could, for example, run the installer and trace what it does (by capturing the system calls that the application does) to get an idea pretty good idea of what the installer does, but it's hard to automate (especially with installers that provide the user with some options) and it's still not a general solution, you have no way of knowing (well, short of disassembling the installer) if the installer would act the same way on a different machine. Its behavior could depend on arbitrary data from the internet, on the permissions of the logged in user, on the already installed pieces of software, on the current time, on the directory it ran from, on arbitrary files on the computer, on system settings, on registry keys and on a whole lot more. And in general you just can't capture its behavior well enough.

With MSIs the situation is a bit different. MSI is meant to be an installation package - it's not just an arbitrary executable, it's got some structure to it, so you can get some good behavior out of it. I believe that, if used properly, MSI installations are atomic (meaning that either the full installation succeeds or the whole thing just fails but doesn't leave your system in some weird intermediate state) and behave well enough that the system can automatically figure out how to uninstall the application.

The critical bit here is the "if used properly" one.

I believe that MSI is such a complicated format that not even Microsoft understands it. And that leads half-assed MSI packages that abuse the format in one way or another and that break some of MSI's promises. I believe I've seen some MSIs that just contained an EXE which they ran during the install process. And that's because MSIs still allow you to run arbitrary code that can do anything.

On Linux, the situation is, once again, different. Software packages are generally much simpler - in many cases they are indeed just an archive that needs to be extracted plus some metadata. Why's that good? Well, because archives are easy and it's hard to screw up a package like that. That gives the user more control over the installation process, makes it easier to automate and makes it more flexible.

Some (most?) package managers allow a package to run arbitrary code during the installation/upgrade/uninstallation process, so in essence they could have the same issues that installers have on Windows, but in practice that doesn't happen too often. Probably because it would go against the established conventions. Also, it's highly probable that your uninstaller is just a piece of crap that would probably break half of the OS if executed (remember how Steam once deleted everything on the system that it could?). People wouldn't like you if your package did that.

One exception in the world of Linux packages that I know of would be RPM. Apparently it's not a nice format. But it appears that even that didn't stop yum and dnf from being good package managers.

This all comes to the fact that software installation is a complicated thing that's easy to screw up and so you shouldn't roll your own installers. However that requires you to provide your application in some logical, nicely packaged way. EXEs and MSIs are not that (and I'm not even sure if MSIX is either).

I hope that this was helpful.

1

u/Aetheus May 22 '20

That was an incredibly detailed and clear explanation - thank you! I understand the challenges involved with building a Windows package manager a lot better now.

I'm assuming that alternative Windows package managers like Scoop or Chocolatey are doing something similar to most Linux package managers (i.e: just extracting some archives to a standard location)?

Or do they too suffer from the same flaw?

2

u/fast4shoot May 22 '20 edited May 22 '20

I'm not sure about Scoop, but Chocolatey reminds me more of winget than of Linux package managers, because quite a lot of the packages on there consist of an installer and a script that just runs the installer.

Edit: By the way, I just realized one thing - on Linux you can just replace files even if they're currently open and the processes that have them open will still see the old contents of those files. This is huge for upgrades, because it means that you can just replace an application even though it's currently running and in a lot of cases everything will be fine.

This is one of the reasons why I can just upgrade my entire operating system and all applications by extracting a bunch of archives. Doing something like that on Windows would be much more complicated. That's why windows updates have to restart your computer and then do some additional steps immediately before or after the actual reboot.

1

u/Aetheus May 23 '20

Interesting. Scoop is primarily meant for installing developer tools instead of GUI apps, so app manifest for GUI apps are in a separate repo (scoop-extras).

Taking a look at the app manifest for Notepad++, it looks like Scoop primarily just grabs an archive for it and unpacks it (https://github.com/lukesampson/scoop-extras/blob/master/bucket/notepadplusplus.json). The simplest example given by Scoop's wiki is also just a "grab this zip file, unpack it, and make the script in it available to the PATH" (https://github.com/lukesampson/scoop/wiki/App-Manifests).

Of course, it does still allow app manifests to define a pre/post install script, similar to what you mentioned about Linux package managers.

That's a good point on Linux updates. It's ... Curious. I recall hearing that Windows 10X will have a more seamless upgrade process, where the OS will "install [updates] in the background" and won't restart "until [installing the updates] is done" (ref: https://www.windowscentral.com/windows-10x - "Improved Windows Updates"). If this is technically possible, I wonder why it hasn't already been applied to "standard" Windows 10 (or older Windows versions, for that matter).

1

u/jantari May 20 '20

winget supports both msix packages and legacy exe setups.

You don't get any of the "true package management" benefits if you install a legacy exe yes. Of course the idea is that everyone adapts msix

1

u/fast4shoot May 21 '20 edited May 21 '20

I feel like supporting both exes and msix will just lead to more confusion. Sometimes it would act like a proper package manager and other times it would just download and run an exe, which it then wouldn't be able to update, uninstall or otherwise properly manage. That doesn't sound great :/

2

u/jantari May 21 '20

Yea I think it would be better if it forced MSIX too - then it's a much smaller selection, but since people really want to use this it pushes devs to release MSIX - which are way easier to package than most other solutions anyway plus the entire toolchain is FOSS. I think people are just too afraid to lose support for Windows 7 sigh....

2

u/da_kink May 19 '20

Huh. Cool, if it has properly apps listed then yes it'll make installing (and hopefully updating) a lot easier :D

2

u/PhDinBroScience DevOps May 19 '20

This excited me so much I think I peed a little. I have been waiting for first-party apt/yum-like package management functionality in Windows since the first time I ever touched a Linux package manager.

Oh my God I hope this project doesn't eventually get abandoned.

2

u/kz393 May 19 '20

It just downloads an exe and executes it. No uninstalls, no dependencies, no delta updates.

2

u/jantari May 20 '20

If the package uses a legacy exe installer yes, that's a stop gap.

Of course everyone should be providing msix packages for their apps instead, which fully support uninstall, delta updates and dependency resolution. If your favorite software is not available as msix open an issue with the creators

2

u/[deleted] May 19 '20

What about choco https://chocolatey.org/

1

u/woemoejack Sr. Sysadmin May 19 '20

Sounds cool, but isn't working for me. Installed App Installer from MS store, yet winget is still unrecognized command in CMD.

3

u/neuro1986 May 19 '20

It’s PowerShell

1

u/woemoejack Sr. Sysadmin May 20 '20

I assumed that too but still didn’t work, and if true, they should really update the how to doc to say powershell and not command prompt- https://docs.microsoft.com/en-us/windows/package-manager/winget/

1

u/Sincronia Sysadmin May 21 '20

Have you joined the test program?
A while after joining I received a confirmation mail and after a few hours I have been able to install the updated version of App Installer from the Store

1

u/Kamwind May 20 '20

So will it work easily against a local repository and for downloading packages for future installation on other computers?

Hopefully Microsoft will think of the enterprise and the basic security principle of Inventory and Control of Software Assets

1

u/Jtyle6 May 20 '20

Bugger I have to wait until release.

1

u/etnguyen03 May 20 '20

Waiting for ansible to implement this...

1

u/RAITguy Jack of All Trades May 20 '20

One step closer to a Microsoft distro 😂

0

u/gamebrigada May 19 '20

Quick, someone make a UI for it!

0

u/Tmanok Unix, Linux, and Windows Sysadmin May 20 '20

God damnit, why can't you windozers just switch to Linux if you love the features so much? ;)

-4

u/[deleted] May 19 '20

Welcome to 1994 Windows admins.

-2

u/Billyblue27 May 20 '20

Embrace, extend, extinguish

-4

u/DouglasteR Trades all the Jacks May 19 '20

Ugh, finally ?