Skip to content

o-l-a-v/winget-intune-win32

Repository files navigation

winget-intune-win32

About

This repo

Repository containing examples of how to use winget from Intune, also in system context.

Inspiration

After I saw that rothgecw had figured out how to use winget-cli from System context, I started thinking about how that would be usefull from Intune.

Disclaimer

  • Files and info in this repo is provided as is. I'm not responsible for what you decide to push to your clients.
  • I'm not good at git. Feel free to commit changes, but I might struggle doing git right. Bear with me.
  • If logic in this repo breaks, I do not commit to fix it in a timely manner.

How to use

Pre-requirements

Following requirements should be included in a fresh installation of Windows 10 and 11, but aren't always present. Which has caused problems. So I'm mentioning them here just in case.

Setup per app

Create two Win32 packages per app you want to have in Intune installed with winget-cli.

  • One being available to install from Company Portal, where:
    • Install command uses winget-cli to get newest app available.
    • Detection rule is static, not checking version.
      • If new version is detected in this package, Company Portal will say that app install failed.
      • Maybe Company Portal can handle this in the future?
  • One being required, where:
    • Only required if the app itself does not have auto update functionality that doesn't require admin permissions.
    • Requirement rules requires app to be installed already.
      • NB: If you don't want to interrupt the end user, make sure to add logic to requirement rule that does keep the upgrade from running if for instance process X and Y are running.
    • Detection rule uses winget-cli to detect if newer version is available.

Remember

  • Observe that I have different detection logic and assignment type, given these three different scenarios
    • Install
    • Upgrade
    • Dependency

How it works

General

  • Uses a dummy *.intunewin containing nothing but an empty text file.

Install

Usefull for all apps in winget-pkgs that is not in Microsoft Store.

  • Get latest version whenever an app is installed the first time, without maintaining packages in Intune.

Update

Only for apps without built-in auto update, or where auto-update requires admin permissions.

  • Excludes:
    • Apps in system context that auto updates using a service running as SYSTEM
      • Adobe Acrobat Reader DC
      • Google Chrome
      • Mozilla Firefox
    • Microsoft Store UWP apps
    • Apps in user context that auto updates
      • 1Password
      • Microsoft Visual Studio Code (User)
  • Includes:
    • 7-Zip
    • Microsoft PowerToys
    • Microsoft Visual Studio Code
    • Notepad++

Future ideas

Background

Why

Greenfield

  • Configure once.

Security

  • Keep apps and dependencies up to date.
  • Remove need for admin permissions for end users.

End users ease of use

Make everything and app that

  • Does not require admin for install and update.
  • Can be installed from a central store, even though an app is not in Microsoft Store yet.
  • Autoupdates, even though it does not have such functionality built in, or if such functionality requires admin permissions.

Flexibility

  • Use Winget how you want, with whatever logic and mechanisms you want.

Other

  • The postive far outweighs the negative, in my opinion.
    • See "Why not" section for context.
  • "Free", with the pros and cons it brings.
    • Neither Windows or Intune is free.

Why not

Network bandwidth

Does not support local caching or peer to peer, like Intune Win32 apps does.

Apparently, Winget supports Delivery Optimization, but only "HTTP Downloader".

Not "Peer to Peer" or "Microsoft Connected Cache (MCC)".

More references/ information

Security and realibility

  • Winget default package manifest is public and open source.
  • Prerequirements like winget-cli itself, and Microsoft Visual C++ isn't always available on a clean OS install.
    • Means one must handle prerequirements before being able to use Winget as part of an device enrollment processes.
  • Winget returns success if updating sources fails.

Other shortcomings

winget-cli / winget.exe

winget-cli is premature, functionality that one would expect of a package manager isn't there yet.

  • Thus one must make a considerable amount of custom logic to handle certain apps, that might suddenly break when it gets fixed by the winget-cli project later.
    • Concrete example: winget.exe was named AppInstallerCLI.exe prior to Winget v1.2.

Overview of progress:

Specific examples I've come across:

winget-pkgs / Manifest

Resources

Similar or related projects

Tools

By Microsoft

By others

Requirements

About

Repository containing examples of how to use winget from Intune, also in system context.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published