On 64-bit Windows, there are two "System" directories: one containing 64-bit DLLs/EXEs, called System32 on disk, and one containing 32-bit DLLs/EXEs, called SysWOW64 on disk.
System path redirection is applied to the values of certain parameters that take paths — see Entry Bitness for the full list. Paths starting with {sys} (or other value expanding to x:\Windows\System32) are automatically rewritten if needed so that on 64-bit entries, it is the 64-bit System directory that is accessed, and on 32-bit entries, it is the 32-bit System directory that is accessed.
For example, on 64-bit Windows, in this case:
[Files]
Source: "MyLibrary.dll"; DestDir: "{sys}"; Flags: 32bit
the file is actually installed to SysWOW64 (32-bit), not System32 (64-bit). But in this case:
[Files]
Source: "MyLibrary.dll"; DestDir: "{sys}"; Flags: 64bit
the file is installed to System32 (64-bit). Behind the scenes, however, 32-bit installers access the directory under the alias Sysnative (see table below).
No rewriting occurs on systems running 32-bit Windows, as System32 is the only System directory. SysWOW64 doesn't exist, and the Sysnative alias isn't supported.
Paths are rewritten according to the following rules:
| Entry bitness[1] | Target process bitness[2] | Substitution made | Explanation |
|---|---|---|---|
| 64-bit | 32-bit | System32 → Sysnative | 32-bit processes have to use the Sysnative alias to reach the "real" 64-bit System32 directory. |
| 32-bit | 64-bit | System32 → SysWOW64 |
64-bit processes can only access the 32-bit System directory as SysWOW64. All subdirectories are redirected as well; there are no exemptions. |
| 32-bit | 32-bit |
Usually: In special cases: |
In 32-bit processes, WOW64 file system redirection In a few special cases, the rule is flipped to SysWOW64 → System32. These cases are:
|
| 64-bit | 64-bit | System32 → no change | System32 is correct as-is when the entry and target process are both 64-bit. |
| Any | 64-bit | Sysnative → System32 |
64-bit processes cannot use the Sysnative alias; it is only available in 32-bit processes. Although this rule is applied for both 32-bit and 64-bit entries, Sysnative should only be present in 32-bit entries. |
[1] With the ApplyPathRedirRules support function, the A64Bit parameter specifies the "entry bitness".
[2] "Target process" is the process where the rewritten path will ultimately be accessed. In most cases, paths are accessed by Setup/Uninstall itself, so the target process bitness is Setup/Uninstall's bitness (as set by SetupArchitecture).