Microsoft Intune — Win32App / .intunewin packages — Lessons learned

Allyn Jacobs
5 min readFeb 4, 2021

Resources mentioned

Powershell Application Deployment Toolkit (PSADT) — https://psappdeploytoolkit.com/

PSADT Github Link — https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases

Microsoft Win32 Content Prep Tool — aka the .intunewin creator — I will sometimes also call it a Package Builder — https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool

Zero-Config Executable Installation — https://kevinstreet.co.uk/zero-config-executable-installation/

Zero-Config Github link — https://github.com/KevinStreet/ZeroConfigExeInstall

When using the Win32App / .intunewin method of application deployment it provides quite a bit of flexibility.

When you run the IntuneWinAppUtil (Packaging Utility) (downloadable here — https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool)

It prompts for a few different items. First is our Source folder. I have found it’s best to create a single working area for all of this content (I am not using network storage for this, but I probably should)

In my example I have a folder named IntuneWorkspace, let’s look at the contents.

Contents of my C:\IntuneWorkspace Folder
Contents of my C:\IntuneWorkspace folder

So let’s cover the folder contents.

.\PackageBuilder — this contains the contents of what you would download from the github link above. To make life easier I have added the IntuneWinAppUtil.exe to my Taskbar. I have noticed that it throws all sorts of errors if you try to run it from within a powershell prompt.

.\Packaged — This is where the output from the Package Builder ends up.

.\PatchMyPC- anything without the “PSADT” prefix has not yet been built around using the PSADT Framework (see Resources at the top of this post)

.\PSADT — This one is important — since this contains our fantastic toolkit

Yeah, there is some digital waste, but it makes sense to me.
The meat and potatoes of what makes this all work is located inside that Toolkit folder.

So I copied the contents of what was inside of the Toolkit folder and placed it specifically into that .\PSADT\Toolkit-CopyMyContents folder. This serves as the “template” that I would copy/paste into each subfolder that I am working on. It’s also because I have added on some additional components that expand the functionality but are not part of the base PSADT.

.\PSADT_$ApplicationDescription — Some of these are works in progress, some of these are completed.

Let’s get right into a few painful lessons learned while attempting to deploy Visual Studio Tools for Office (vstor_redist.exe) — which I was only needing to do as it was a pre-requisite for installing Smart Notebook 20.1

Contents of the PSADT_VisualStudioCode folder

So what we see above are the files/folders that are copied from my template folder references above. Modifications are made “per application” in the Deploy-Application.ps1 file

Relevant Code Snippet that handles the Installation of VSTOR_Redist.exe

Now here is what was crazy. When I *first* tried to use just this command line it was not working. I went all over the interwebs and tried all sorts of things and it just wasn’t working. I could not figure out why things were not working, and then I finally looked back at the original location that I took the installer from.

Contents of the Support Subfolder within the Administrative Installation .zip file provided by Smart

Do you notice that vstor_redist.exe.md5sum.txt file — well I didn’t have that included alongside of the vstor_redist.exe and that was one of the several lessons I learned in the past 36 hours or so.. I needed to have both files.

Let’s look at little bit deeper at some pitfalls related to the Package Builder.

Example of what I was doing (before I knew better)

Running the command like this — would result in an output exactly as seen below

Deploy-Application.intunewin (like that’s really helpful)

So what did I try and do, because I thought I was “Soooo smart” I renamed the .intunewin file to look kinda like this…

This makes sense, certainly, nothing would go wrong, would it?!?!?!

Spoiler alert: I spent more hours than I care to admit throwing myself against the brickwall that was being “too smart for my own good” before something clicked in my head and I was like. Maybe I should keep the file names the same? Maybe that’s my problem…

Remember that .\Packaged folder — now this method allows you to be organized, and still functional. Yay!!

If you already have a file in the Subfolder location it will prompt for an overwrite. (Duh) If you don’t have that Subfolder created it will offer to create it the first time running the tool.

Onto my final lesson learned during all of this time. Be absolutely sure that you have the correct “synatax’ for the Deploy-Application.exe

When you are building out the application in Intune, one of the spots along the way looks like this.

I also spent quite some time trying to use Deploy-Application.exe -Install
  • DeploymentType “Install” does not necessarily equal “-install” when it comes to Powershell Parameters. (The .exe is a launcher/wrapper to call the PowerShell script without keeping a terminal window open)

So I think those were all of the pitfalls. This was my first blog entry, but I felt like many lessons were learned, several that I wish I could have found more easily online so I would not have spent so much time.

--

--

Allyn Jacobs

Geek/Nerd since 5 years old. IT Professional in the public K-12 sector for over 10 years