Intune Win32 App Deployment Challenges System32 Vs Syswow64

3
Intune Win32 App Deployment Challenges System32 Vs Syswow64

Last year, I wrote couple of posts on Intune win32 based app deployment (Part 1 and Part 2). For both posts, many Intune admins shared their challenges. In this post, we are going to discuss the most common System32 Vs Syswow64 challenges with apps deployment (Intune Win32 App) and how to address it.

Related PostsSCCM Package Vs Application 32 Vs 64 Context & Intune Win32 App Failure Log Collection Backend Secrets

Introduction

By default, Intune trigger installation in 32-bit process context. Unlike SCCM, Intune doesn’t have out of box option to trigger apps installation in 64-bit context. There is a User Voice related to this issue. In this post we will discuss how we can trigger apps installation from Intune in 64-bit context.

System32 Vs Syswow64

Let’s understand the difference between cmd.exe inside system32 and syswow64 folder.

  1. SysWOW64
  • Running C:\windows\SysWOW64\cmd.exe will launch a 32-bit instance of CMD.exe
  • Syswow64 registry hive is for 32-bit applications.
  • Syswow64 folder use a file system redirector. Refer here for more details.
  1. System32
  • Running C:\windows\System32\cmd.exe will launch a 64-bit instance of CMD.exe
  • System32 directory reserved for 64-bit applications on 64-bit Windows.
  • System32 registry hive is for 64-bit applications.

SysWOW64 is for 32-bit. Do you think naming of the folder is confusing… right? 😊

Altaro Office 365 Backup
Advertisement Altaro Office 365 Backup

More Details

Application packagers test the offline installation in system context before uploading to Intune. In this scenario cmd.exe executes from location C:\Windows\System32. The installation process execute as 64-bit. This is default behavior on 64-bit OS.

But the same application when Intune deploys installation process executed as 32-bit. cmd.exe execute from location C:\Windows\SysWOW64\cmd.exe. This is default deployment behavior for Intune win32 apps. Since Intune use 32-bit process, you may experience different behavior in some areas. For example: actions like registry import, etc. Registry gets imported to syswow64 hive instead of system32 hive.

How to force Intune to launch apps installation in 64-bit context?

We need to change the command line with the path to the command shell as shown below example. This approach is flexible and easy to use to bypass file system redirection. For more details refer here.

“%systemroot%\sysnative\cmd.exe” /c “Install.bat”

Intune installation command line - System32 Vs Syswow64
Intune Win32 App Deployment Challenges – System32 Vs Syswow64

End Result:

Now its time to compare the default and the modified Intune apps deployment behavior. For analysis, I added below WMI command to my Install batch file. This WMI command will export all the process details at that run time to the text file. We can analyze text file to understand whether Intune command shell executed in 32- or 64-bit process.

You can add below command to your install batch file for testing purpose only.

wmic process > c:\windows\temp\ProcessList.txt

Default Intune application deployment behavior

intune install command line -System32 Vs Syswow64 Intune Win32 App
Application Edit Options with IntuneWin format – System32 Vs Syswow64

Open the processlist.txt. You can find the installation command line is from SysWOW64 path.

Intune application process install context
Intune application process install context

C:\windows\system32\cmd.exe /c Install.bat Win32_Process cmd.exe C:\windows\SysWOW64\cmd.exe

You can see application registry imported to SysWOW64 Hive

SysWOW64 registry intunewin32
SysWOW64 registry intunewin32

Modified Intune application deployment behavior

Intune Application Deployment Behavior
Intune Application Deployment Behavior

You can now see that the installation command line gets changed to “system32” path.
Note : In txt file, you need to check the column executable path and command line

intune sysnative command line
intune sysnative command line

“C:\windows\sysnative\cmd.exe” /c “Install.bat” Win32_ComputerSystem C:\windows\System32\cmd.exe

Now you can see application registry values imported to System32 Hive (64 bit )

System32 registry intune
System32 registry intune

Thanks to Andres, Kanchana and Nazrin for troubleshooting this issue. Happy Testing!

Please comment below your Intunewin32 challenges and observations.

Resources

3 COMMENTS

  1. This doesn’t seem to work for PowerShell. For example the file test.cmd containing “%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe” generates the error “The system cannot find the path specified.” The fact that the Intune Management Extension always runs the 32-bit “%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe” is problematic.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.