Application was not detected after installation 0x87D1041C

Recently I have deployed Notepad ++ application to Intune managed devices. As this is an .exe based Installer, I have converted/wrapped it into .Intunewin file and deployed it using Win32 app deployment method using Microsoft Intune.

Win32 apps are the applications which may have custom built installers, packaged as .exe and may have associated installation files, dependencies, scripts, and registry entries. Win32 apps were not available from Microsoft store or Microsoft store for business.

As we know Microsoft store for business is getting retired and Microsoft have launched a new experience to deploy Microsoft store apps using Intune admin center. This new experience of Microsoft store apps deployment also includes Win32 apps as well. However, Win32 apps deployment using Microsoft store apps (new) deployment type is currently in preview.

Win32 app deployment method requires you to upload .intunewin file while creating the application deployment on Microsoft Intune admin center. This method also requires you to specifiy the Install command, Uninstall command and Detection rules to detect if the application is installed after the deployment process is completed.

Detection rules also helps to re-deploy the application automatically if Intune detects that the application is not existing after the deployment. This could be due to if someone uninstalled the application manually or user has reset the operating system.

How to fix Win32 app installation error 0x87D1041C

We need to know the cause of the error first before we can fix it. This error is generally caused by Incorrect detection rule specified at the time of creating Win32 application deployment.

As you know detection rule is to detect the existance of the application. If the detection rule is not configured correctly, it will result in not detecting the application even though its installed successfully.

I have confirmed that the application was successfully Installed on my device but still resulted in this error message.

Notepad ++ app

How to check the Application Deployment Status on Intune Admin center

To check the status of the application deployment, please follow below steps:

  • Login on Microsoft Intune admin center.
  • Click on Apps and then click on All Apps.
  • Click on the Win32 app. For Example: Notepad ++.
  • Then click on Device Install status to check the error message.

As you can see the exact error message and Status Failed. The application was not detected after installation completed successfully (0x87D1041C).

The application was not detected after installation completed successfully (0x87D1041C)

You can also check the status of the application deployment and detection from IntuneManagementExtension.log file. Check the value of applicationDetected. If you are getting error 0x87D1041C and the value of applicationDetected: False. This means you need to fix the detection logic of your app deployment on Intune admin center.

Please find below a snippet from IntunemanagementExtension.log file which is related to this app deployment. As shown in the log file, you can clearly see that the Detection logic is unable to detect the application which resulted in the failure of the application deployment reporting status. Please note that the application is installed successfully on the end user device but its just the reporting status on Intune admin center which shows failed with error 0x87D1041C.

[Win32App][DetectionActionHandler] Handler invoked for 1 app detections.	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App][DetectionActionHandler] Detection running for policy with id: 19de19a9-71a2-462a-942f-86aaec859ea1.	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] ProcessDetectionRules starts	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] ProcessDetectionRules Parsing InstallEx...	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] DetectionType 0	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] Start detectionManager SideCarRegistryDetectionManager	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] To check Exist, Path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++\"C:\Program Files\Notepad++\uninstall.exe, valueName:  applicationDetected: False	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] Checked reg path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++\"C:\Program Files\Notepad++\uninstall.exe, name: , operator: 0, type: 1, value:  , result of applicationDetected: False	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] detectionManager SideCarRegistryDetectionManager got applicationDetectedByCurrentRule: False as system	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App] Completed detectionManager SideCarRegistryDetectionManager, applicationDetectedByCurrentRule: False	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)
[Win32App][DetectionActionHandler] Detection for policy with id: 19de19a9-71a2-462a-942f-86aaec859ea1 resulted in action status: Success and detection state: NotDetected.	IntuneManagementExtension	07/07/2023 09:33:53	5 (0x0005)

Where to find IntuneManagementExtension.log file on the Device

To locate IntuneManagementExtension.log file, please follow below steps:

  • Browse to C:\ProgramData\Microsoft\IntuneManagementExtension\Logs and look for most recent version of IntuneManagementExtension.log file.
  • Best way to open the file is using CMTrace tool.
Where to find IntuneManagementExtension.log file on the Device

Fix the detection logic of Win32 app

Now, let’s check the detection rule of the Win32 app and see if we can fix it to detect the application correctly. Please note that after we fix the detection logic of the application deployment on Intune admin center, the application status may not update immediately. It may take upto 24 hours to refresh the application status and if this time the application is detected successfully, you will see a Success under Status column instead of Failed.

Misconfigured Detection Rule

We had provided below Detection rule for Notepad++ application. This is why the application was not detected on end user device. Let’s try to fix the detection rule and see if it fixes the Issue.

Fix the detection logic of Win32 app

Updated Detection Rule

We have updated the detection rule in our Win32 app deployment to use File based detection and to check if the file Notepad++.exe exists under C:\Program Files\Notepad++ path. If it finds this file Notepad++.exe, it will detect the application installation as successful and will not start re-deployment of the application.

Please note that we had previously used Registry based detection logic and now we have used File based detection logic to detect the application. This is not because of File based detection logic works better than registry based detection logic. This is just to show that issue in the detection logic which fails to detect the application.

You could also use the Registry based detection logic to check for a registry key which could be found after the application deployment. This also results in successful detection of the application which will also fix the error 0x87D1041C.

However, I prefer to use File based detection logic for Notepad ++ app which is easier to locate it in Program files. End goal is to fix the detection logic so that Intune Management Extension could locate the application and confirm that its installed or not.

Win32 app detection rule

Detection rule for MSI Installer application

If you have deployed an MSI application using Win32 app deployment method, then you could choose a detection logic as MSI and provide the value of the product code of the MSI application. Below is the product code of Zoom application provided as a detection rule for Zoom application.

How to find MSI product code of an application

You can find MSI product code of an application in many ways. One method is to Install an MSI application on a test device and go to below registry key to find its product code.

Option 1

  • Install MSI application on test device.
  • Go to Start > Run > type regedit to open Registry Editor.
  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
  • Find your application and check the corresponding Uninstallstring to get the MSI Product code
How to find MSI product code of an application

Option 2

Second option to find the MSI product code is to Install the application on a test device using below command and getting the value of MSI product code from the log file.

msiexec.exe /i "C:\ZoomInstallerFull.msi" /L*V "C:\zoom.log"

Once the application is installed on your device, Open C:\zoom.log and check find the MSI product code information.

Conclusion

As we have seen in this blog post, how easily you can fix the error code 0x87D1041C which is caused by misconfigured detection logic in the Win32 app deployment. There are various detection logic types which you can use like MSI, File, Registry. Irrespective of which type of detection logic you use, it should be able to correctly detect the application.

READ NEXT