Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 6th February 2012, 19:43   #1
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
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
noemig is offline   Reply With Quote
Old 6th February 2012, 20:33   #2
msroboto
Junior Member
 
Join Date: Sep 2006
Posts: 47
Are you resetting the outputpath after doing this?
If not whatever files you lay down will go there.
msroboto is offline   Reply With Quote
Old 6th February 2012, 21:36   #3
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
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
noemig is offline   Reply With Quote
Old 6th February 2012, 22:08   #4
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
Why do you use the /r switch?
demiller9 is offline   Reply With Quote
Old 6th February 2012, 22:23   #5
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
The installer have to find the files between the folders directories.
noemig is offline   Reply With Quote
Old 6th February 2012, 23:34   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,410
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th February 2012, 00:58   #7
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
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?
noemig is offline   Reply With Quote
Old 7th February 2012, 07:23   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Quote:
Originally Posted by noemig View Post
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
MSG is offline   Reply With Quote
Old 7th February 2012, 16:01   #9
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
Copying some files from the installation directory to SysWow64 or system32

Now I understand. Thank you for your reply
noemig is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
copying, dlls, nsis, system32, syswow64

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump