Archive: Copying some files from the installation directory to SysWow64 or system32


Copying some files from the installation directory to SysWow64 or system32
Hello,

I am trying to copy some files from the installation directory to SysWow64 or system32, depending is the OS is 32 or 64.

The code is written as :

Section "DLL"

${If} ${RunningX64}

SetOutPath "$WINDIR\SysWOW64"
DetailPrint "Installer running on 64-bit host"
File /r "DFORMD.DLL"
File /r "DFORRT.DLL"
File /r "Expsrv.dll"
File /r JETCOMP.exe

${Else}

SetOutPath "$WINDIR\System32"
File /r "DFORMD.DLL"
File /r "DFORRT.DLL"
File /r "Expsrv.dll"
File /r "JETCOMP.exe"

${EndIf}


SectionEnd

The installer is copying the entire folder that contains those DLL from the installation directory to SYSWOW64 or System32.

Can somebody give me a clue on how to solve this ?

Thanks.

noemig


Are you resetting the outputpath after doing this?
If not whatever files you lay down will go there.


Copying some files from the installation directory to SysWow64 or system32
Yes, I am resetting the outhpath using the instruction SetOutPath .

The issue that I am facing is is that instead of copying the dll from the installation directory to the indicated folder. The installer is copying the entire folder where the dll files are located to the indicated folder ($WINDIR\SysWOW64 or $WINDIR\System32).

Thanks for your reply.

noemig


Why do you use the /r switch?


The installer have to find the files between the folders directories.


Installing files in %windir% is evil, don't do it please!

If you always want to install files in the 32bit system32 folder you can just pretend that x64 does not exist and just install in $sysdir and the windows filesystem redirection will take care of the rest...


Copying some files from the installation directory to SysWow64 or system32
Thank you, I will try to install them on the $sysdir. Can you give me a hint why the installer is copying the entire folder instead of the corresponding files?


Originally posted by noemig
Thank you, I will try to install them on the $sysdir. Can you give me a hint why the installer is copying the entire folder instead of the corresponding files?
This is because you're using the /r switch. You can read about it here: http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.5

Copying some files from the installation directory to SysWow64 or system32
Now I understand. Thank you for your reply