What is each `Program Files` folder purpose in Arm64 architecture?

1.1k views Asked by At

Trying to re-build an app but targeting Arm64 and craft a proper installer. There are 3 Program Files folder:

  • C:\Program Files\
  • C:\Program Files (Arm)\
  • C:\Program Files (x86)\

What is the purpose of each folder? Where should an app built for Arm64 processor architecture be installed?

For future reference, here are the environment variables.

CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(Arm)=C:\Program Files (Arm)\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(Arm)=C:\Program Files (Arm)
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
2

There are 2 answers

0
Lex Li On BEST ANSWER

C:\Program Files (Arm)\

This folder is going away. You can read this article and the following,

"Support for 32-bit Arm versions of applications will be removed in a future release of Windows 11."

This is not surprising because there weren't a lot of 32-bit Arm applications.

C:\Program Files (x86)\

This folder remains the same for x86 applications. You might refer to this article to learn the emulation behind.

C:\Program Files\

This folder is rather messy now on Windows 11 ARM64, as it accepts three kinds,

  • Your existing x64 applications
  • Your new pure ARM64 applications
  • Your ARM64X applications

    including pure forwarder binaries if in use.

So, an old x64 installer continues to work when installing binaries to this folder and achieve backward compatibility. However, x64 binaries are executed under emulation.

At last, you recompile the applications as pure ARM64 or ARM64X binaries and install to this folder, so that they are executed natively.

Note that ARM64X binary execution is tricky as it depends on the launching settings. The binaries might run in pure ARM64 mode (most of the time), or x64 emulation mode (if launched differently).

Bonus

So, when you try to port an application to Windows 11 ARM64, you need to decide what exactly you are porting for,

  • You can use the old binaries if porting won't give significant benefits.
  • You can produce pure ARM64 binaries which is rather common.
  • You might need to produce ARM64X binaries sometimes (one case is IIS native extensions like ASP.NET Core module).

Interestingly no matter which path you choose, the binaries install to the same C:\Program Files\.

3
Anders On

C:\Program Files\ with no suffix is for native programs, programs that match the architecture of Windows.

An ARM64 application running on Windows ARM64 would get this directory if it asks SHGetFolderPath for CSIDL_PROGRAM_FILES. An x86 application doing the same on the same machine would get the path with the " (x86)" suffix and an Arm (32-bit) application would get the " (arm)" suffix.

Why are there separate Program Files and Program Files (x86) directories?

... problems if a program is available in both 32-bit and 64-bit versions, such as Microsoft Office or Visual Studio. You couldn’t install both versions side-by-side; you’d have to pick one.

And it so happens that Windows itself comes with a lot of programs that are available in both 32-bit and 64-bit versions, like Internet Explorer and WordPad. Those programs could have installed themselves into separate directories like C:\Program Files\Internet Explorer and C:\Program Files\Internet Explorer (x86) to avoid the conflict, but then that runs into compatibility issues with apps that do things like launch %ProgramFiles%\Internet Explorer\iexplore.exe and then start manipulating the Internet Explorer process expecting it to be the same bitness as the program that did the launching.