In the previous post I explained that you can use Intune to install applications for all you colleagues. In this post I’ll go into packaging apps for Intune
- Get your apps in Intune
- Package apps for Intune
- Publish apps to Intune
- Remove platform dependency for WingetIntune
- Analysing Win32 Content Prep Tool
- Decrypting intunewin files
- Introducing Content Prep PowerShell
- Creating IntuneWin files with C#
Packaging apps for Intune
To get apps in Intune you will have to package them. Packaging an app is a matter of downloading the installer, figuring out how to run that installer silently (without user interaction) and then creating a
intunewin file from that. And since Microsoft recently has adopted Winget as the new package manager for windows, that seemed like a good place to start. It must have all the details needed to package that app for Intune.
This is how I got started with my new project WingetIntune, as command line tool to download all the needed details from winget and package it for Intune.
Dependency on Windows
Currently this command line app (and the future library) only work on Windows machines. It’s actually using winget for searching and loading some package details. And for now it’s also using the IntuneWinAppUtil to create the
intunewin file. I’m planning to remove that dependency in the future, but for now it’s a Windows only tool.
Search for apps using Winget
You can use winget to search for any app, it your want the details for Oh-my-posh you can search for it on Winget by executing this command:
winget search oh-my-posh
which will give you this output:
Name Id Version Match Source ---------------------------------------------------------------------- oh-my-posh XP8K0HKJFRXGCK Unknown msstore Oh My Posh JanDeDobbeleer.OhMyPosh 18.5.1 Moniker: oh-my-posh winget
After you installed the tool, you can package the winget package for Intune by executing this command:
winget-intune package JanDeDobbeleer.OhMyPosh --package-folder c:\packages
- Find the latest version of the package (using the winget show command)
- Download the manifest for that package from the winget repo
- Download the installer for that package
- Downloads the logo for that package
- Compute the detection rules for that package (either a script or a msi product code)
- Guesses the install command based on the installer type (msi, exe, zip, etc)
- Creates a
intunewinfrom the installer (using the IntuneWinAppUtil, which is automatically downloaded)
- Creates a readme with the detection rules and install command
Some parts of this tool have a dependency on a Windows executable. Searching for packages starts the winget process, their seems to be a community build rest api but I haven’t looked into that yet. And the packaging part uses the IntuneWinAppUtil, which is a Windows executable. And while it’s hosted at github, Microsoft does not seem to provide the source for this tool.
Having a dependency on closed source executable does not feel like a stable solution. I’m starting the tool in a new process, so the integration is not the best for using in any cloud environment.
I though automatically packaging these apps for Intune was the hardest part of this project. After generating the
intunewin files, I thought publishing those files to Intune would be a breeze. But it turns out that’s not the case. I’ll explain that in the next post. Be sure to follow me on Twitter to get notified when I publish that post.