1

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
Gerardo Grignoli
  • 14,058
  • 7
  • 57
  • 68
  • Whoever vote this question is "Not about programming or software development" needs to stop moderating on this site permanently. I am making an .msi installer. Don't feel obligated to answer or close my question if you don't know the answer. – Gerardo Grignoli Nov 11 '22 at 16:30
  • Also the edit from @Frant makes zero sense to me. – Gerardo Grignoli Nov 11 '22 at 16:31
  • Is your question about programming or software development, yes or no ? I did not see any code in your question yet, just a very general question without any specific context, this is why I proposed to close your question. I do agree this is always a bit subjective though. – Frant Nov 11 '22 at 16:53
  • The arm and arm64 tags were removed because my feeling is that your question is not relevant to any of them: `[arm]`: This tag is used for questions related to the ARM (Advanced RISC Machine) family of computers; that is machines or electronics running on ARM processor cores or systems using an ARM core. For Azure-related questions, use [azure-resource-manager]. `[arm64]`: 64-bit ARM architecture, also known as AArch64. – Frant Nov 11 '22 at 16:56
  • I wrote "Trying to re-build an app but targeting Arm64 and craft a proper installer." Do you know what an `.MSI` installer is? It is how you package your "software development project" for deployment on windows. – Gerardo Grignoli Nov 11 '22 at 16:57
  • Regarding the tags, ok, fair enough if yours's are so narrow scoped. The question is about "Windows On Arm64", no tag for that... yet.. – Gerardo Grignoli Nov 11 '22 at 17:01
  • I added the `window-installer` tag, and yes, I know what a Windows Installer is, but this is not the point I guess. – Frant Nov 11 '22 at 17:15
  • By the way, you probably have the permissions for creating the tag you think is missing if you think there is a need for it. – Frant Nov 11 '22 at 17:17

2 Answers2

3

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\.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
-1

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.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Great... and what about x64 apps? – Gerardo Grignoli Nov 12 '22 at 00:23
  • I would guess `C:\Program Files (x64)`. It should not matter, you are supposed to ask Windows, not write the suffix yourself. The user could theoretically set it to `d:\myappz` if they really wanted to (although this is not supported by Microsoft and it might break some apps). – Anders Nov 12 '22 at 00:55
  • The first paragraph is unfortunately incorrect. – Lex Li Mar 10 '23 at 07:43