IntuneTroubleshooting

Win32 app error 0x87D1041C: the app installed but Intune can't detect it

0x87D1041C means the installer finished but the detection rule found nothing. The usual causes (bitness, install context, version drift) and how to test detection on the device.

Intune reports "The application was not detected after installation completed successfully (0x87D1041C)", yet the app is right there on the device. The installer did its job; the detection rule just didn't find what it was told to look for. In this post I'll go through the usual reasons a rule misses, how to test detection the way the Intune Management Extension (IME) does, and how to confirm the fix.

How this guide is organised: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (5 steps: See what the IME evaluated; Check what's really installed; Correct the rule; Or use a script you control; Test it the way the IME runs it). 4. Verify the fix. 5. Prevent it next time. Toolbox: 0x87D1041C, AppWorkload.log, …\Vendor\App, Apps › All Apps, Settings › Sync.1Symptoms2Why it happens3How to fix it4Verify the fix5Prevent it nexttime1See what the IMEevaluated2Check what's reallyinstalled3Correct the rule4Or use a script youcontrol5Test it the way theIME runs itTOOLBOX0x87D1041CAppWorkload.log…\Vendor\AppApps › All AppsSettings › SyncHow this guide is organised: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (5 steps: See what the IME evaluated; Check what's really installed; Correct the rule; Or use a script you control; Test it the way the IME runs it). 4. Verify the fix. 5. Prevent it next time. Toolbox: 0x87D1041C, AppWorkload.log, …\Vendor\App, Apps › All Apps, Settings › Sync.1Symptoms2Why it happens3How to fix it1See what the IME evaluated2Check what's really installed3Correct the rule4Or use a script you control5Test it the way the IME runs it4Verify the fix5Prevent it next timeTOOLBOX0x87D1041CAppWorkload.log…\Vendor\AppApps › All AppsSettings › Sync
At a glance: how this guide is organised · 5 fix steps · 5 key tools

Symptoms#

  • The app's device install status shows a failure with 0x87D1041C, but the app is installed and works.
  • With a required assignment the app keeps coming back: Intune offers an app it can't detect again within about 24 hours, so you may see repeated installs or notifications.
  • It hits every device (the rule is simply wrong) or only some, such as devices where the app updated itself or where a different user signed in.

Why it happens#

When the install command returns a success code, the IME evaluates the app's detection rules, and every rule must be true for the app to count as installed. If any rule fails, the install "succeeded" without proof, and Intune reports 0x87D1041C. The common reasons:

CauseWhat's going onFix
Wrong valueTypo in the product code, path or key, or the vendor changed the install locationRebuild the rule from what's on a test device
32-bit vs 64-bitA 32-bit app writes to Program Files (x86) and WOW6432Node, but the rule looks in the 64-bit locationsSet Associated with a 32-bit app on 64-bit clients to Yes
Install contextA per-user app writes to HKCU or %LOCALAPPDATA% while the rule checks machine-wide locations, or the other way roundMatch the rule to the Install behavior (System or User)
Version driftThe app updated itself, so an exact version match or MSI product version check no longer holdsCompare with "greater than or equal to", or stop the self-update
Script outputA custom detection script exits 0 without writing anything, or writes to the error streamWrite one line to STDOUT and suppress errors

One more bitness trap: Microsoft notes that calling powershell.exe in a Win32 install command starts 32-bit PowerShell. If your wrapper script writes a marker under HKLM\SOFTWARE, it lands in WOW6432Node unless you call %SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe.

How to fix it#

1. See what the IME evaluated#

On an affected device, open AppWorkload.log in C:\ProgramData\Microsoft\IntuneManagementExtension\Logs; it holds the IME's Win32 app activity. Search for the app's ID (it's in the browser address bar when you open the app in the admin center) and read the [Win32App] detection lines after the install. They show which detection rule ran and what it returned.

2. Check what's really installed#

List the uninstall entries in both registry views:

PowerShell
$keys = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
        'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
Get-ItemProperty -Path $keys -ErrorAction SilentlyContinue |
    Where-Object DisplayName -like '*Contoso*' |
    Select-Object DisplayName, DisplayVersion, PSChildName, PSParentPath

For MSI-based apps, PSChildName is the product code. An entry under WOW6432Node means a 32-bit install. For per-user apps, run the same query against HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* as that user.

3. Correct the rule#

Open the app under Apps › All Apps, go to Properties and select Edit next to Detection rules:

  • MSI: paste the product code exactly as the registry shows it. Turn on MSI product version check only when you control the version.
  • File: put the folder in Path without quotes and the file or folder name in its own field. Use the 32-bit option for apps under Program Files (x86).
  • Registry: use a full key path such as HKLM\SOFTWARE\Vendor\App. Leave Value name empty to test the key itself; the 32-bit option switches the lookup to WOW6432Node.
  • Context: for System installs, detect in HKLM and machine-wide folders; for User installs, use HKCU or %LOCALAPPDATA%. Never hard-code one person's C:\Users\ path.

4. Or use a script you control#

A custom detection script means "detected" only when it exits with 0 and writes to STDOUT. A non-zero exit, no output, or anything written to STDERR means "not detected". This example accepts version 4.2 or later, so self-updates don't break it:

PowerShell
$exe = Join-Path $env:ProgramFiles 'Contoso\Agent\agent.exe'
$minimum = [version]'4.2.0.0'
$file = Get-Item -Path $exe -ErrorAction SilentlyContinue
if ($file) {
    $vi = $file.VersionInfo
    $installed = [version]::new($vi.FileMajorPart, $vi.FileMinorPart, $vi.FileBuildPart, $vi.FilePrivatePart)
    if ($installed -ge $minimum) {
        Write-Output "Detected agent.exe $installed"
        exit 0
    }
}
exit 1

5. Test it the way the IME runs it#

For System installs, detection runs as SYSTEM, in a 64-bit process unless Run script as 32-bit process on 64-bit clients is set. Sysinternals PsExec gives you a matching shell from an elevated prompt:

Command Prompt
psexec.exe -s -i C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

In the new window, whoami should return nt authority\system. With the script saved as C:\Temp\Detect-Agent.ps1, run powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Temp\Detect-Agent.ps1; $LASTEXITCODE and expect your output line followed by 0. Swap in the SysWOW64 path to test 32-bit behavior. For User installs, test in a normal PowerShell window as that user.

Verify the fix#

  • Save the corrected rule, then trigger an IME check-in on a test device: restart the IntuneManagementExtension service, or use Settings › Sync in Company Portal.
  • In AppWorkload.log, the detection for that app ID now reports the app as detected.
  • The device's install status changes to Installed once the IME reports back.

Prevent it next time#

  • Install the app on a clean test device first and build the rule from what it leaves behind.
  • Decide bitness and install context before writing the rule, and set the 32-bit option and paths to match.
  • For apps that patch themselves, use "greater than or equal to" or a version-independent marker, or disable auto-update and ship updates through supersedence.
  • Keep detection scripts quiet: one line to STDOUT, nothing to STDERR.
  • Take care when switching an existing app between User and System install behavior; the old per-user copy and the new machine-wide rule won't line up.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

OE
Written by

Omer Eltayeb

Independent Microsoft Intune consultant in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Microsoft Entra ID, Microsoft Defender and Exchange Online with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)