![]() |
#1 |
Junior Member
Join Date: Jan 2011
Posts: 2
|
Problem With IfFileExists on 64bit Windows
I recently wrote script were I have to check existence of certain driver in users system. I did it by checking if driver file was in Windows\System32\drivers folder with IfFileExists command. I noticed that in 32bit Windows this method worked, but in 64bit Windows IfFileExist does not seems to see *.sys files in Windows\System32\drivers. If I use IfFileExist on some other files in other path it seems to work as it should in 64bit Windows.
I wrote this little script to demonstrate problem. It looks beep.sys that should (hopefully) exist on every Windows machine. code: I first thought that $SYSDIR could give wrong path to C:\Windows\SysWOW64\drivers but path seems to correct and hardcoding path in script give same results. Why IfFileExists shows such behaviour on 64bit Windows ? Or have I understood something wrong? Best regards |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,333
|
Disable file system redirection with the macros in x64.nsh, then $sysdir will be correct. Or use the half documented $windir\sysnative hack on 64 bit OS
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jan 2011
Posts: 2
|
Thank you for your answer. I did not understood that redirection happens even when I hardcode path to like this:
code: Instead of using $SYSDIR. |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Redirection is done by the OS not NSIS.
Stu |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|