Use of NSIs in x64 System

Source: Internet
Author: User
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 )"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.