Skip to content

Packaging Win32 apps

The Windows app (Win32) type is how most Windows software reaches devices through Intune. It's flexible enough for almost any installer, and most "Intune can't deploy this app" problems turn out to be packaging mistakes. This guide covers the parts people get wrong.

The workflow

flowchart LR
    A[Get the silent install<br/>and uninstall commands] --> B[Package with<br/>IntuneWinAppUtil.exe]
    B --> C[Add app in Intune:<br/>commands, requirements, detection]
    C --> D[Test on a clean<br/>test device]
    D --> E[Assign to pilot,<br/>then broad]

1. Package the app

Download the Microsoft Win32 Content Prep Tool and run:

IntuneWinAppUtil.exe -c C:\Packages\7zip\Source -s 7z-x64.msi -o C:\Packages\7zip\Output -q
Switch Meaning
-c Folder with everything the install needs
-s The setup file inside that folder
-o Where to write the .intunewin file
-q Quiet mode

Keep the source folder lean: everything in it is uploaded and downloaded to every device. Apps can be up to 30 GB.

2. Program settings

Setting Guidance
Installer type Command line, or PowerShell script (upload a script of up to 50 KB that runs instead of a command line, useful for prerequisites and post-install steps)
Install command Must be silent. For MSI: msiexec /i "app.msi" /qn /norestart. For EXE: the vendor's silent switches.
Uninstall command Also silent. Test it: you'll need it for supersedence and uninstall assignments.
Install behavior System for most apps. User only for apps that install into the user profile.
Device restart behavior Determine behavior based on return codes is usually right
Return codes Defaults: 0 and 1707 success, 3010 soft reboot, 1641 hard reboot, 1618 retry. Add any vendor-specific codes.
Installation time required Default 60 minutes. Raise it for big apps, or the install is marked as failed while still running.

Interactive installs aren't supported

Intune requires apps to install silently. Tricks that push a UI into the user's session (such as ServiceUI.exe) aren't supported by Microsoft and behave unpredictably. If an installer can't run silently, wrap it in a script that can, or find another way to deploy it.

The 32-bit trap

The Intune Management Extension runs install commands from a 32-bit process. On 64-bit Windows, paths like C:\Windows\System32 are silently redirected to SysWOW64, and HKLM\SOFTWARE writes go to WOW6432Node. To run 64-bit PowerShell from an install command, use the Sysnative path:

%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoProfile -File .\Install.ps1

3. Requirements

Requirement rules decide whether a device should get the app at all. If a requirement isn't met, the app shows as Not applicable, not Failed.

  • OS architecture: x64, x86 and Arm64 as appropriate. Many apps now ship separate Arm64 builds.
  • Minimum OS version.
  • Additional rules: file, registry or script checks, for example "only install the plug-in if the host app is present".

4. Detection rules

Detection rules tell Intune whether the app is installed. Get them wrong and Intune reinstalls forever, or reports failure for a successful install.

Rule type Use when Watch out for
MSI product code The app is an MSI Product codes change between versions. Update detection when you package a new version.
File or folder The app installs a file with a reliable version Use version comparison (Greater than or equal to) rather than just existence, so upgrades detect correctly
Registry The app writes a reliable key or uninstall entry Set Associated with a 32-bit app on 64-bit clients correctly, or Intune looks in the wrong registry view
Custom script Nothing simpler works The app counts as detected only if the script exits 0 and writes something to STDOUT
Custom detection script example
# Detected = exit 0 with output. Not detected = no output (or a non-zero exit).
$minimum = [version]'24.09'
$path = 'C:\Program Files\7-Zip\7z.exe'

if (Test-Path $path) {
    $installed = [version](Get-Item $path).VersionInfo.ProductVersion
    if ($installed -ge $minimum) {
        Write-Output "7-Zip $installed detected"
        exit 0
    }
}
exit 0

5. Dependencies and supersedence

  • Dependencies install other Win32 apps first, such as a runtime the app needs. Choose whether Intune installs the dependency automatically.
  • Supersedence replaces an older app with a newer one. Choose update (install the new version over the old) or replace (uninstall the old app first, using its uninstall command).
  • Keep chains short. Long dependency and supersedence chains are hard to troubleshoot and slow to evaluate.

6. Assign and roll out

  • Assign Required to a pilot group first. Check App install status before widening.
  • Use an installation deadline for disruptive updates, and notifications set to show only restart prompts for quiet background installs.
  • During classic Autopilot, don't mix Win32 and MSI line-of-business apps. Package everything as Win32.
  • New apps and changes reach devices when the Intune Management Extension checks in, which it does every hour and after the service or device restarts.

Troubleshooting

Location What's there
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AppWorkload.log App download, install, detection and results (the main app log in current IME versions)
IntuneManagementExtension.log (same folder) General agent activity, check-ins and policy
AgentExecutor.log (same folder) Script-based installers and detection scripts
C:\Windows\IMECache\ Downloaded and extracted app content during install
HKLM\SOFTWARE\Microsoft\IntuneManagementExtension\Win32Apps\ Per-user and per-device app state, including results and retry information

Common problems:

Symptom Usual cause
The application was not detected after installation completed successfully Detection rule doesn't match what the installer actually did. Check the version, path and 32-bit or 64-bit registry view.
Install times out Installer is waiting for input, or the app is bigger and slower than the installation time required allows
Works when run manually, fails from Intune Different context. Intune runs as SYSTEM, without mapped drives or the user's profile. Test with psexec -s -i.
App reinstalls repeatedly Detection never succeeds, often because an uninstall entry or file isn't where the rule expects
Fix doesn't take effect Failed installs aren't retried immediately. After repeated failures, Intune waits up to 24 hours before the next attempt. Test fixes on a clean device.

Learn more