Intune Win32 app deployment error 0x80070002

Recently I have deployed an application Notepad ++ to end user 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.

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 specify the Install command, Uninstall command and Detection rules to detect if the application is installed after the deployment process is completed.

Install command and Uninstall command provides instructions to Intune management extension on which commands to run for Installing / Uninstalling the application in System or User context as specified in the app deployment.

I then checked the app depployment from Intune admin center and was able to successfully find the cause of the issue. We are going to look into the cause and fixes of this issue in the next section of this blog post.

0x87D1041C
Please refer to the blog post Application Was Not Detected After Installation 0x87D1041C to know the fix of 0x87D1041C error code which you may get after the application deployment is succesful but application is not detected by Intune.

How to fix Win32 app deployment error 0x80070002

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

It could be a typing mistake or the command itself is not correct for that particular program. Intune Management extension downloaded the application on the end user’s device but it could not run the command to Install / Uninstall the application.

In this case, the application will not be installed and will result in this error message. The exact error message is “The system cannot find the file specified. (0x80070002)“.

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
The system cannot find the file specified. (0x80070002)

Let’s now also check the status of the application deployment on the device using IntuneManagementExtension.log file. This file will provide all the information about the installation of any deployment via Intune.

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 that the InstallCommandLine specified is npp.8.5.4.Installer.x64 /S which should be npp.8.5.4.Installer.x64.exe /S. This command is missing file extension which resulted in the failure of the application deployment.

0x80070002
Get policies = [{"Id":"52012793-f55c-4333-b029-e3e9378c6eb0","Name":"Citrix Workspace App","Version":1,"Intent":3,"TargetType":2,"AppApplicabilityStateDueToAssginmentFilters":null,"AssignmentFilterIds":null,"DetectionRule":null,"InstallCommandLine":null,"UninstallCommandLine":null,"RequirementRules":null,"ExtendedRequirementRules":null,"InstallEx":"{\"RunAs\":1,\"RequiresLogon\":false,\"InstallProgramVisibility\":0,\"MaxRetries\":0,\"RetryIntervalInMinutes\":0,\"MaxRunTimeInMinutes\":0,\"DeviceRestartBehavior\":0}","ReturnCodes":null,"AvailableAppEnforcement":0,"SetUpFilePath":null,"ToastState":0,"Targeted":1,"FlatDependencies":null,"MetadataVersion":1,"RelationVersion":0,"RebootEx":{"GracePeriod":-1,"Countdown":-1,"Snooze":-1},"InstallBehavior":3,"StartDeadlineEx":{"TimeFormat":"","StartTime":"\/Date(-62135596800000)\/","Deadline":"\/Date(-62135596800000)\/"},"RemoveUserData":false,"DOPriority":0,"newFlatDependencies":true,"AssignmentFilterIdToEvalStateMap":null,"ContentCacheDuration":null,"ESPConfiguration":null,"ReevaluationInterval":480,"SupportState":null,"InstallContext":1,"InstallerData":"{\"PackageIdentifier\":\"XPFCG3278HX4X9\",\"SourceName\":\"msstore\"}"},{"Id":"596cfd6e-110d-457f-abfe-fab75c6056ec","Name":"Notepad++","Version":1,"Intent":3,"TargetType":2,"AppApplicabilityStateDueToAssginmentFilters":null,"AssignmentFilterIds":null,"DetectionRule":"[{\"DetectionType\":0,\"DetectionText\":\"{\\\"Check32BitOn64System\\\":0,\\\"Path\\\":\\\"Computer\\\\\\\\HKEY_LOCAL_MACHINE\\\\\\\\SOFTWARE\\\\\\\\Microsoft\\\\\\\\Windows\\\\\\\\CurrentVersion\\\\\\\\Uninstall\\\\\\\\Notepad++\\\\\\\\\\\\\\\"C:\\\\\\\\Program Files\\\\\\\\Notepad++\\\\\\\\uninstall.exe\\\\\\\"\\\",\\\"KeyName\\\":null,\\\"DetectionType\\\":1,\\\"Operator\\\":0,\\\"DetectionValue\\\":\\\"\\\"}\"}]","InstallCommandLine":"npp.8.5.4.Installer.x64 /S","UninstallCommandLine":"C:\\Program Files\\Notepad++\\uninstall.exe” /S","RequirementRules":"{\"RequiredOSArchitecture\":2,\"MinimumFreeDiskSpaceInMB\":null,\"MinimumWindows10BuildNumer\":\"10.0.14393\",\"MinimumMemoryInMB\":null,\"MinimumNumberOfProcessors\":null,\"MinimumCpuSpeed\":null,\"RunAs32Bit\":false}","ExtendedRequirementRules":"[]","InstallEx":"{\"RunAs\":1,\"RequiresLogon\":true,\"InstallProgramVisibility\":3,\"MaxRetries\":3,\"RetryIntervalInMinutes\":5,\"MaxRunTimeInMinutes\":60,\"DeviceRestartBehavior\":2}","ReturnCodes":"[{\"ReturnCode\":0,\"Type\":1},{\"ReturnCode\":1707,\"Type\":1},{\"ReturnCode\":3010,\"Type\":2},{\"ReturnCode\":1641,\"Type\":3},{\"ReturnCode\":1618,\"Type\":4}]","AvailableAppEnforcement":0,"SetUpFilePath":"npp.8.5.4.Installer.x64.exe","ToastState":0,"Targeted":1,"FlatDependencies":null,"MetadataVersion":1,"RelationVersion":0,"RebootEx":{"GracePeriod":-1,"Countdown":-1,"Snooze":-1},"InstallBehavior":0,"StartDeadlineEx":{"TimeFormat":"","StartTime":"\/Date(-62135596800000)\/","Deadline":"\/Date(-62135596800000)\/"},"RemoveUserData":false,"DOPriority":0,"newFlatDependencies":true,"AssignmentFilterIdToEvalStateMap":null,"ContentCacheDuration":null,"ESPConfiguration":null,"ReevaluationInterval":480,"SupportState":null,"InstallContext":1,"InstallerData":null},{"Id":"f6037151-d22c-44cf-8fb1-b7d49d6c5b59","Name":"Foxit PDF Reader","Version":1,"Intent":4,"TargetType":2,"AppApplicabilityStateDueToAssginmentFilters":null,"AssignmentFilterIds":null,"DetectionRule":null,"InstallCommandLine":null,"UninstallCommandLine":null,"RequirementRules":null,"ExtendedRequirementRules":null,"InstallEx":"{\"RunAs\":1,\"RequiresLogon\":false,\"InstallProgramVisibility\":0,\"MaxRetries\":0,\"RetryIntervalInMinutes\":0,\"MaxRunTimeInMinutes\":0,\"DeviceRestartBehavior\":0}","ReturnCodes":null,"AvailableAppEnforcement":0,"SetUpFilePath":null,"ToastState":0,"Targeted":1,"FlatDependencies":null,"MetadataVersion":1,"RelationVersion":0,"RebootEx":{"GracePeriod":-1,"Countdown":-1,"Snooze":-1},"InstallBehavior":3,"StartDeadlineEx":{"TimeFormat":"","StartTime":"\/Date(-62135596800000)\/","Deadline":"\/Date(-62135596800000)\/"},"RemoveUserData":false,"DOPriority":0,"newFlatDependencies":true,"AssignmentFilterIdToEvalStateMap":null,"ContentCacheDuration":null,"ESPConfiguration":null,"ReevaluationInterval":480,"SupportState":null,"InstallContext":1,"InstallerData":"{\"PackageIdentifier\":\"XPFCG5NRKXQPKT\",\"SourceName\":\"msstore\"}"}]

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.

Fix Install Command in Win32 App

Now, let’s check the Install Command specified in our app deployment on Microsoft Intune admin center. Please follow below steps to check the Install command:

  • Login on Microsoft Intune admin center
  • Click on Apps and then click on All Apps
  • Click on the Win32 app. For Example: Notepad ++
  • Click on Properties and then click on Edit next to Program

In the Program tab, you will be able to find Install command and Uninstall command. Depending upon your deployment is targeting for Install or Uninstall, please check that command to see if its correct and there is no typing mistake.

Misconfigured Install Command

In my case, I was missing setup file extension for Notepad++ application. As the application is uploaded to Intune admin center as .Intunewin file which wraps an npp.8.5.4.Installer.x64.exe. Therefore, please specify .exe extension in the Install command to fix this issue.

npp.8.5.4.Installer.x64 /S

Fixed Install Command

We need to update the Install command and add .exe file extension so that it could be installed successfully. As you can see in below screenshot, Install command is now fixed. Please note that re-deployment of the application process may take some time to complete. You can continue to Monitor the app installation from Intune admin center.

npp.8.5.4.Installer.x64.exe /S

Conclusion

In this blog post, we have seen how to fix the Win32 app deployment error 0x80070002. When we create an app deployment and we specify incorrect Install or Uninstall command. Intune management extension will not be able to Install the application on the device and will result in this error message.

To make sure that the Install command is correct, Its always a best practice to test Install / uninstall of the application on a test device manually using the command line. If that command is working fine then you can create an app deployment and make sure to include file extensions for the installers as well.

READ NEXT