pegase06
27th February 2007 21:01 UTC
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.
    
      kichik
      27th February 2007 21:04 UTC
      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
     
    
      pegase06
      27th February 2007 21:14 UTC
      
      
        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.
    
 
    
      pegase06
      28th February 2007 08:12 UTC
      Nobody ?
     
    
      Red Wine
      28th February 2007 08:27 UTC
      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.
     
    
      pegase06
      28th February 2007 13:24 UTC
      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.
     
    
      pegase06
      28th February 2007 22:16 UTC
      Nobody to help me ?
     
    
      kichik
      1st March 2007 19:19 UTC
      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.