Archive: Registered all the files of a directory


Registered all the files of a directory
Hello,

I want to registered all the files (dll) of a directory automaticaly.

Something likes

!insertmacro InstallLib DLL 0 REBOOT_PROTECTED "dossier\*.DLL" "$SYSDIR\*.DLL" "$SYSDIR"

Maybe with loop.

I have try :
FindFirst $0 $1 $folder1\*.dll
loop:
StrCmp $1 "" done
!insertmacro InstallLib DLL 0 REBOOT_PROTECTED "folder1\$1.DLL" "$SYSDIR\$1.DLL" "$SYSDIR"
FindNext $0 $1
Goto loop
done:


But the compilation say : "folder1\$1.DLL" doesn't exist.

Tanks.

It must compress the file and find it and therefore you can't do that at runtime. Use the following:

http://nsis.sourceforge.net/Invoking...n_compile-time


Originally posted by kichik
It must compress the file and find it and therefore you can't do that at runtime. Use the following:

http://nsis.sourceforge.net/Invoking...n_compile-time
Sorry, but I don't understand how I must use this solution.

Nobody ?


It's quite simple, you can't use runtime commands and variables in compile time.
kichik's suggestion is to create a header following the method described in the link.


I don't understand how to use runtime commands and variables in compile time for my problem. :(
Maybe somebody can show me another example who help me to understand.


Nobody to help me ?


Your problem is using runtime commands and variables in compile time. The compiler tries to pack folder1\$1.dll but that only has meaning when the user actually runs the installer on his computer. $1 is a runtime variable and its value is calculated when the user launches the installer.

The Wiki page I linked to shows how to use a script to create a file that the compiler can eat. What it actually does is running another installer that'd generate the script for your real installer.