Most Win32 apps that show as “failed” in Intune have actually been installed on the device; the error is in the packaging, the silent install parameter or the detection rule. The Win32 app type is the most flexible way to convert classic .exe or .msi installers into an .intunewin package and deploy them with silent install commands, detection rules and requirements. Below we go through Win32 deployment step by step, from preparing the package to detection rules, dependency and supersedence definitions and troubleshooting with IME logs, along with the mistakes we often see.
App types in Intune and where Win32 fits
Intune offers several app types for Windows. Choosing the wrong type means years of maintenance overhead.
| Type | When it fits | Limitation |
|---|---|---|
| Win32 (.intunewin) | Any .exe, .msi or scripted installation | Requires packaging and detection effort |
| LOB (MSI) | A simple single-file MSI | No dependencies or custom detection; must not be mixed with Win32 during Autopilot |
| Microsoft Store app (WinGet) | Apps published in the Store | Limited version and parameter control |
| Microsoft 365 Apps | Office deployment | Office only |
| Enterprise App Catalog | Common apps packaged in advance by Microsoft | Requires an additional license; catalog coverage is limited |
The Store (WinGet) type is the lowest-maintenance option for simple apps the publisher keeps up to date, and it can be offered to users through Company Portal. For enterprise apps that need install parameters, a license file or configuration, Win32 is the only realistic path. All the sections below are about Win32.
Preparing the package with IntuneWinAppUtil
The packaging tool is IntuneWinAppUtil.exe, published in Microsoft’s Win32 Content Prep Tool repository. It encrypts the entire source folder and turns it into a single .intunewin file.
- Prepare a separate source folder for each app containing only the files needed. Every file in the folder goes into the package; packaging from your downloads folder bloats the package unnecessarily.
- Put the installer, answer files (.mst, .iss, .xml) and install script in the same folder.
- Run the tool:
IntuneWinAppUtil.exe -c C:\Package\Source\NotepadPP -s npp-installer-x64.exe -o C:\Package\Output -q
-c is the source folder, -s the setup file, -o the output folder and -q quiet mode. If the setup file is an .msi, the tool adds information such as the product code to the package, and Intune suggests it for the detection rule. Microsoft’s stated upper limit for package size is 30 GB.
Install and uninstall commands
Intune runs the install command without user interaction. The command must be silent and must not trigger a restart itself. Install behavior is set to System (machine-wide installation) or User (installation into the user profile).
| Installer type | Example install command | Example uninstall command |
|---|---|---|
| MSI | msiexec /i "application.msi" /qn /norestart |
msiexec /x {PRODUCT-CODE} /qn /norestart |
| NSIS (.exe) | npp-installer-x64.exe /S |
"%ProgramFiles%\Notepad++\uninstall.exe" /S |
| Script | powershell.exe -ExecutionPolicy Bypass -File install.ps1 |
powershell.exe -ExecutionPolicy Bypass -File uninstall.ps1 |
For .exe installers, the silent parameter depends on the vendor and the installer engine (NSIS, Inno Setup, InstallShield); use the vendor’s deployment documentation as the reference. A /silent parameter written by guesswork means a setup wizard waiting on the user’s screen. For complex scenarios (closing the running app, cleaning up the old version, copying a configuration file), a wrapper script such as the open-source PowerShell App Deployment Toolkit provides a standard.
Test the commands in the SYSTEM context before uploading them to Intune; most errors are caught here. You can open a command prompt with SYSTEM rights using Sysinternals PsExec:
psexec.exe -s -i cmd.exe
whoami
REM the output should be nt authority\system
npp-installer-x64.exe /S
echo %ERRORLEVEL%
By default Intune interprets return codes as follows: 0 and 1707 success, 3010 soft reboot, 1641 hard reboot, 1618 retry (another installation in progress). For apps that finish installation successfully with a different code, add that code to the list.
A common trap: because the Intune Management Extension runs as a 32-bit process on 64-bit Windows, a powershell.exe called from the install command also starts as 32-bit, and HKLM\SOFTWARE writes are redirected under WOW6432Node. If you need a 64-bit context, call the command through %SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe. If you’re searching for a registry key that has “disappeared,” look in WOW6432Node first.
How to write detection rules
The detection rule is the only criterion Intune uses to decide whether installation succeeded and whether the app is present on the device. A wrong rule shows a successfully installed app as “failed” or retries the installation every cycle. If the rule is wrong, the result is wrong, however correct the package is.
- MSI product code: The most reliable method for MSI installations; a product version comparison can optionally be added.
- File or folder: Checks existence, modified date, version or size. A version comparison is needed to tell upgrades apart.
- Registry: Key existence or value comparison. On 64-bit devices, the “associated with a 32-bit app” option must be set correctly for 32-bit apps.
- Custom script: Used when several conditions need to be checked together.
Query the uninstall registry entries to find the product code and version:
$paths = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
Get-ItemProperty $paths |
Where-Object { $_.DisplayName -like '*Notepad++*' } |
Select-Object DisplayName, DisplayVersion, PSChildName, UninstallString
A custom detection script makes the app count as installed when it exits with code zero and writes output to STDOUT. An example that checks the version:
$exe = "$env:ProgramFiles\Notepad++\notepad++.exe"
$target = [version]'8.6.0'
if (Test-Path $exe) {
$vi = (Get-Item $exe).VersionInfo
$version = [version]('{0}.{1}.{2}' -f $vi.FileMajorPart, $vi.FileMinorPart, $vi.FileBuildPart)
if ($version -ge $target) {
Write-Output "Installed: $version"
exit 0
}
}
exit 1
Produce output in the script only on success. If a forgotten debug line in the failure branch combines with an exit code of zero, the app shows as installed; an app that isn’t on the device lights up green in the report.
Dependencies, supersedence and assignment strategy
Requirements define which devices the app can be applied to: OS architecture, minimum Windows version, disk space, memory or a custom requirement script. On a device that doesn’t meet the requirements, the app is reported as “not applicable,” not as an error.
A dependency is defined when, for example, an app needs the Visual C++ runtime or a .NET component. If the dependent app is added with the “automatically install” option, Intune installs the dependency before the main app. The dependency app’s detection rule must be at least as accurate as the main app’s; that package is often the weakest link in the chain.
Supersedence defines a new version replacing an old one. If the “uninstall previous version” option is on, the old version’s uninstall command runs first; if it’s off, the new version installs as an in-place update. Turn on the uninstall option for apps that don’t support in-place updates.
Assignment types:
- Required: The app is installed automatically. It can be assigned to device or user groups; device groups are preferred in Autopilot and ESP scenarios.
- Available for enrolled devices: The app is offered to users in Company Portal; usually assigned to user groups.
- Uninstall: The app is removed from the device with the uninstall command.
Assign a new package first to the IT team’s devices, then to a small pilot group and finally to the general group. Assignment filters can narrow things further by properties such as model, OS version or device ownership. A direct “All devices” assignment is the hardest mistake to undo.
Monitoring the deployment and troubleshooting with IME logs
In the Intune admin center, the app’s Device install status view shows status and error code per device. The details are in the logs on the device:
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AppWorkload.log: Download, install and detection steps for Win32 apps.IntuneManagementExtension.log: General IME operation, policy retrieval and sync.AgentExecutor.log: Running PowerShell scripts and detection/requirement scripts.
Open the logs with a log viewer such as CMTrace and filter by app name or app ID (GUID). The order of investigation is always the same: did the app policy reach the device, was the content downloaded, what return code did the install command finish with, and then what did the detection rule return? If installation succeeded but detection failed, the problem is the rule, not the package.
A behavior to know when testing: because of the IME’s global re-evaluation schedule (GRS), a failed Win32 installation is by default not retried for about 24 hours. Restarting the service speeds up evaluation of new assignments, but doesn’t always get around this wait. During the pilot, uploading the fixed package as a separate test app and verifying it is more predictable.
# Restart the IME service to speed up evaluation during testing
Restart-Service -Name IntuneManagementExtension
# Read the lines related to the last install attempt
Select-String -Path "C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AppWorkload.log" -Pattern "Notepad" |
Select-Object -Last 30
PowerShell patterns for bulk automation and reporting are also in our article on server management automation with PowerShell. When investigating apps stuck at the ESP during Autopilot, use these logs together with the diagnostic steps in our device setup with Windows Autopilot guide.
Packaging checklist
- The source folder contains only the necessary files and is archived by version.
- Install and uninstall commands tested in the SYSTEM context without user interaction.
- Return codes checked against the vendor documentation and added to the list if needed.
- The detection rule includes version information and the 32/64-bit path is correct.
- Requirements (architecture, minimum Windows version, disk) defined.
- Dependencies prepared as separate packages, with their own detection rules tested.
- Supersedence and uninstall behavior for the previous version defined.
- Install, upgrade and uninstall scenarios all verified in the pilot group.
- Package install time measured if it will be used in the Autopilot ESP.
For moving your app inventory to Intune, building a package library and tracking version updates periodically, see our technical support and scheduled maintenance and Microsoft 365 services pages. If compliance conditions and corporate access settings are to be designed along with device deployment, address them together as part of Microsoft 365 security consulting.
Frequently asked questions
What is the size limit for a Win32 app package?
Microsoft sets an upper limit of 30 GB for a single Win32 app package uploaded to Intune. Large packages increase download time and WAN load. For very large installations, splitting shared components into separate packages defined as dependencies and caching content locally at branches with Delivery Optimization or Microsoft Connected Cache is more manageable.
When does a detection script consider the app installed?
The app is considered installed if the custom detection script exits with code zero and writes any output to STDOUT. If the script ends with a non-zero code or produces no output, the app is not considered installed. That is why output written for debugging in the script can produce false positives.
How often does the Intune Management Extension check apps?
By default, the IME checks Win32 app assignments about once an hour; it also evaluates when the device or the IME service restarts. During testing, starting a sync from Company Portal or restarting the IntuneManagementExtension service shortens the wait.
Why package an existing MSI app as Win32 instead of LOB?
The Win32 type provides custom detection rules, requirements, dependencies, supersedence, return code handling and Delivery Optimization support. It also prevents the Windows Installer conflicts caused by installing LOB and Win32 apps together during Autopilot.