Archive: Install to 2 different directories possible??


Install to 2 different directories possible??
Using NSIS, how do I install files to 2 different directories?

I currently have an install package installing 11 DLL files to a directory, but I also need 4 other files to be installed to a different direcory. Can I do this with 1 .exe file? Any help would be great. Thanks.


Do you want to ask the user for that directory too or do you want to copy the DLLs to a set directory, a sub-directory of $INSTDIR for example?

If you want to ask the user for another directory you'll either have to show another directory page with a leave function that will copy $INSTDIR to another variable (Page directory "" "" getSecondDir) and use that variable's content later on.

If you just want to install to another set directory all you need to do is call SetOutPath again and then File as usual. For example:

SetOutPath $INSTDIR
File myProg.exe
SetOutPath $INSTDIR\docs
File readme.html
SetOutPath $WINDIR\myProg
File myProg.ini

Current set of files going to $PROGRAMFILES\AIM\SAFARIREMOTE

I need the other 4 files to create a directory called Scanning_Temp off the root C:\

This is what I currently have...

Section "AIM"
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Puts files in $PROGRAMFILES\AIM\SAFARIREMOTE
File ..\DocScan.exe
File ..\lffax13n.dll
File ..\lftif13n.dll
File ..\ltdis13n.dll
File ..\ltefx13n.dll
File ..\ltfil13n.dll
File ..\ltimg13n.dll
File ..\ltkrn13n.dll
File ..\ltocx13n.ocx
File ..\lttwn13n.dll

Thanks again for the help. I am still trying to learn all of this.


If the name of the second directory should always be C:\Scanning_Temp then your code should look something like this:

SetOutPath $INSTDIR
File ..\DocScan.exe
File ..\lffax13n.dll
# etc...
SetOutPath C:\Scanning_Temp
File ..\other.dll
File ..\onemore.dll
# etc...

Works great, thanks for the help!!