Friday, September 29, 2017

"Program Files (x86)" & "Program Files"

What’s the Difference Between the “Program Files (x86)” and “Program Files” Folders in Windows?


There’s a good chance you have both the “C:\Program Files” and “C:\Program Files (x86)” folders on your Windows PC. If you poke around, you’ll see that some of your programs are installed in one folder, and some are installed in the other.

32-bit vs. 64-bit Windows

Originally, Windows was only available as a 32-bit operating system. On 32-bit versions of Windows—even 32-bit versions of Windows 10, which are still available today—you’ll only see a “C:\Program Files” folder.
This Program Files folder is the recommended location where programs you install should store their executable, data, and other files. In other words, programs install to the Program Files folder.
On 64-bit versions of Windows, 64-bit applications install to the Program Files folder. However, 64-bit versions of Windows also support 32-bit programs, and Microsoft doesn’t want 32-bit and 64-bit software getting mixed up in the same place. So, 32-bit programs get installed to the “C:\Program Files (x86)” folder, instead.
Windows runs 32-bit applications on 64-bit versions of Windows using something called WOW64, which stands for “Windows 32-bit on Windows 64-bit.”
When you run a 32-bit program on a 64-bit edition of Windows, the WOW64 emulation layer seamlessly redirects its file access from “C:\Program Files” to “C:\Program Files (x86).” The 32-bit program tries to access the Program Files directory and is pointed to the Program Files (x86) folder. 64-bit programs still use the normal Program Files folder.

What’s Stored In Each Folder

In summary, on a 32-bit version of Windows, you just have a “C:\Program Files” folder. This contains all your installed programs, all of which are 32-bit.
On a 64-bit version of Windows, 64-bit programs are stored in the “C:\Program Files” folder and 32-bit programs are stored in the “C:\Program Files (x86)” folder.
That’s why different programs are spread across the two Program Files folders, seemingly at random. The ones in the “C:\Program Files” folder are 64-bit, while the ones in the “C:\Program Files (x86)” folder are 32-bit.

Why Are They Split Up?

This is a compatibility feature designed for old 32-bit programs. These 32-bit programs may not be aware that a 64-bit version of Windows even exists, so Windows keeps them away from that 64-bit code.
32-bit programs can’t load 64-bit libraries (DLL files), and could crash if they tried to load a specific DLL file and found a 64-bit one instead of a 32-bit one. The same goes for 64-bit programs. Keeping different program files for different CPU architectures separate prevents errors like these from happening.
For example, let’s say Windows just used a single Program Files folder. A 32-bit application might go looking for a Microsoft Office DLL file found in C:\Program Files\Microsoft Office and try to load it. However, if you had a 64-bit version of Microsoft Office installed, the application would crash and not function properly. With the separate folders, that application won’t be able to find the DLL at all, because the 64-bit version of Microsoft Office would be at C:\Program Files\Microsoft Office and the 32-bit application would be looking in C:\Program Files (x86)\Microsoft Office.
This also helps when a developer creates both 32-bit and 64-bit versions of an application, especially if both need to be installed at once in some situations. The 32-bit version automatically installs to C:\Program Files (x86), and the 64-bit version automatically installs to the C:\Program Files. If Windows used a single folder, the application’s developer would have to have the 64-bit folder install to a different folder to keep them separate. And there would likely be no real standard for where developers installed different versions.

Why Is The 32-bit Folder Named (x86)?

You won’t always see “32-bit” and “64-bit.” Instead, you’ll sometimes see “x86” and “x64” to refer to these two different architectures. That’s because early computers used the Intel 8086 chip. The original chips were 16-bit, but newer versions became 32-bit. “x86” now refers to the pre-64-bit architecture—whether that’s 16-bit or 32-bit. The newer 64-bit architecture is referred to as “x64” instead.
That’s what “Program Files (x86)” means. It’s the Program Files folder for programs using the older x86 CPU architecture. Just note, however, that 64-bit versions of Windows can’t run 16-bit code.

This Doesn’t Normally Matter

It doesn’t normally matter whether a program’s files are stored in Program Files or Program Files (x86). Windows automatically installs programs to the correct folder, so you don’t have to think about it. Programs appear in the Start menu and function normally, no matter where they’re installed. Both 32-bit and 64-bit programs should store your data in folders like AppData and ProgramData, and not in any Program Files folder. Just let your programs automatically decide which Program Files folder to use.
You’ll sometimes need to know where a program is stored. For example, let’s say you want to go into your Steam directory to back up some files. You’ll find it in C:\Program Files (x86), as Steam is a 32-bit program.
If you’re not sure whether a program you installed is 64-bit or not and you’re looking for its installation folder, you may need to look in both Program Files folders to find it.
You can also look in Windows 10’s Task Manager.
On 64-bit versions of Windows, 32-bit programs are tagged with the additional “(32-bit)” text, giving you an indication that you’ll find them in C:\Program Files (x86).

No comments:

Post a Comment