Archive: File not writing to correct OUTDIR


File not writing to correct OUTDIR
Hello,

In my script, I make two calls to SetOutPath because I need to write files to both $WINDIR\SysWOW64 and $SYSDIR. But when I call SysOutPath the second time, to write to $SYSDIR, the File command still writes to the SysWOW64 directory instead:

SetOutPath $WINDIR\SysWOW64
File Foo.DLL

SetOutPath $SYSDIR
File Bar.DLL ; gets written to SysWOW64 instead

I am checking the output of NSIS, and the correct OUTDIR:
Output folder: C:\Windows\system32

I have checked previous posts, and this seems to be perfectly possible. So it is strange that this is not working for me. Any ideas?


Hi,

Can you attach a zip'd up Process Monitor trace of the install?

If your not sure how to capture a ProcMon trace, here are instructions: http://forum.appointmentsbook.com/showthread.php?t=125

ps is it possible to reverse the calls as a workaround? eg:

SetOutPath $SYSDIR
File Bar.DLL ;

SetOutPath $WINDIR\SysWOW64
File Foo.DLL


Thanks for mentioning Process Monitor. I checked that out, but couldn't find any error or explanation to why it was writing to SysWOW64.

Frustrated, I hard-coded and removed any mention of SysWOW64, but it was still writing to there. On a hunch, I googled more specifically about NSIS and SysWOW64, and as it turns out, you have call to a macro inside of the x64.nsh header. Here is some documentation copied :

; DisableX64FSRedirection disables file system redirection.
; EnableX64FSRedirection enables file system redirection.
;
; SetOutPath $SYSDIR
; ${DisableX64FSRedirection}
; File some.dll # extracts to C:\Windows\System32
; ${EnableX64FSRedirection}
; File some.dll # extracts to C:\Windows\SysWOW64
;

I implemented it, and it works. This will be great to have in the documentation since there are many other ways to find out if a system is 32-bit or 64-bit, so x64.nsh may never be looked at.

I'm writing the solution here to hopefully help out the next person with this problem who bothers to search the forum.