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
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,
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).
So, when you try to port an application to Windows 11 ARM64, you need to decide what exactly you are porting for,
Interestingly no matter which path you choose, the binaries install to the same C:\Program Files\
.