The NSIs-generated installer is a 32-bit application, so when running in x64, the installed file will be automatically redirected, such as installing to C: files in the \ windows \ system32 directory will be installed in the c: \ windows \ syswow64 directory. This is inconvenient for some software. One way is to re-compile the NSIs code to 64-bit, which is a little troublesome and requires a lot of time for testing. Using simple code can also solve similar problems:
1. Check whether the operating system is x64.
You can read the environment variable processor_architecture. This variable is x86 in 32-bit systems, amd64 in amd x64 and Intel x64, and IA64 in itanium. You can use the following code:
Readenvstr $ win64 processor_architecture
Strcmp $ win64 "x86" lbl_win32
2. disable file redirection
You can call the wow64enablewow64fsredirection function to disable or restore file redirection. For example:
; Prohibited
System: Call "Kernel32: wow64enablewow64fsredirection (I 0 )"
......
; Restore
System: Call "Kernel32: wow64enablewow64fsredirection (I 1 )"