Simple Problems, Simple Answers - Part 2 - Working with Large Win32 Files

Today I had to package Autodesk Revit. Now I don’t package this application often, but it did come up today and I knew I was going to have an issue. I say this because Intune has a default limit set 8GB for the intunewin file. Below are the steps I had to go through to upload a large application and in this case 12GB.

Getting the Limit Increased

With an 8GB limit for Win32 applications, this will cover most applications that need packaged. Revit, is one of those edge cases that doesn’t. To up this, a Microsoft support case has to be opened up in the Intune portal. Let them know what size you need with your Tenant ID and they will up it to that limit in a couple of days.

Uploading the Intunewin File the Normal Way

What do I mean by the normal way? Well you may say “Hey, I can just go and upload this like my other applications!”. I didn’t have that same luck as I probably should. My Edge tab/session crashed and stated it ran out of memory. I have had this same issue dealing with large amount of settings in the Intune catalog so I think this is normal when dealing with abnormally large items.

You can try this way as this should work, but do not get discouraged when you get a similar outcome.

PowerShell to the Rescue!

All Intune does on the browser is hitting an API in the background. So you can do the exact same thing you would do in your browser using PowerShell and using the Intune API.

I don’t expect everyone to just figure out how to use the Intune API, but use the tools at your disposal. With some searching on Google, I was able to find a blog post by Nickolaj Andersen that helps me peice it together. Nickolaj shows how to automate Adobe Reader as an example, but has a section that we are going to re-use in this purpose.

What we are going to need is to install and import a PowerShell module called “IntuneWin32App”. Let’s do that!

1
2
Install-Module IntuneWin32App
Import-Module IntuneWin32App

We then need to connect to the API. Some Administrative rights are needing to be able to connect and use the Intune API as well as your Tenant ID. Which is the same Tenant ID that you sent to Microsoft to up the limit.

1
Connect-MSIntuneGraph -TenantID $TenantID

We now need to know the following information:

  1. Source File Folder Path
  2. Output File Folder Path
  3. Detection Method
  4. Require Rule
  5. Install Command Line
  6. Uninstall Command Line

With all that information, lets throw that into some PowerShell using that module we just imported.

Note: This post assumes you know how to package the application. Every application is different and the below script is just an example.

1
2
3
4
5
6
7
$intuneWinFile = New-IntuneWin32AppPackage -SourceFolder 'C:\Source\Revit' -SetupFile 'Install.bat' -OutputFolder 'C:\Output\Revit' -Verbose
$displayName = 'Autodesk Revit 2023'
$detectionRule = New-IntuneWin32AppDetectionRule -Existence -Path 'C:\Program Files\Autodesk\Revit' -FileOrFolder 'Revit.exe' -Check32Biton64System $false -DetectionType exists
$requirementRule = New-IntuneWin32AppRequirementRule -Architecture x64 -MinimumSupportedOperatingSystem 1607
$installCommandLine = 'Intune.bat'
$uninstallCommandLine = 'Uninstall.bat'
Add-IntuneWin32App -FilePath $intuneWinFile.Path -DisplayName $displayName -Description "Autodesk Revit 2023" -Publisher 'Autodesk' -InstallExperience system -RestartBehavior suppress -DetectionRule $detectionRule -RequirementRule $requirementRule -InstallCommandLine $installCommandLine -UninstallCommandLine $uninstallCommandLine -Verbose

This will then do all the work for you. You can see what the module does since we are using the verbose output. Now we just sit back and wait an hopefully all goes well.

Note: The speed of this process does vary depending on the application, internet speeds, and how long it takes to get it into the intunewin format.

References

PowerShell module IntuneWin32App: https://github.com/MSEndpointMgr/IntuneWin32App

Nickolaj Andersen’s Blog Post: https://msendpointmgr.com/2020/03/17/manage-win32-applications-in-microsoft-intune-with-powershell/