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.
In certain contexts where paths are specified, such as the DestDir parameter of the [Files] section, system path redirection is applied. Paths starting with {sys} (or other value expanding to x:\Windows\System32) are automatically rewritten if needed so that in 64-bit install mode, it is the 64-bit System directory that is accessed, and in 32-bit install mode, it is the 32-bit System directory that is accessed.
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:
| Input path 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 input path 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 input paths, Sysnative should only be present in 32-bit input paths. |
[1] By default, the "input path bitness" is the same as Setup/Uninstall's install mode — 32-bit in 32-bit install mode, and 64-bit in 64-bit install mode. In the [Files] and [Run] sections, the path bitness can be overridden on a per-entry basis using the 32bit and 64bit flags.
[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).