Archive: doesn't work, but why?


doesn't work, but why?
hi there, i need to list the files to the file, something like


nsExec::Exec '"dir" $EXEDIR /B > $EXEDIR\temp.txt'

(there will be $PLUGINSDIR instead of second $EXEDIR, this is just for testing)
how to do it? i put this into .onInit, but it does nothing, please help, i ran out of ideas

thanks in advance

This works:

ReadEnvStr $R0 COMSPEC
SetOutPath $EXEDIR
nsExec::Exec '$R0 /C dir /B >"$EXEDIR\temp.txt"'

You should really use NSIS to do it though for compatibility on other Windows platforms (i.e. Longhorn / Vista):


Function .onInit
FileOpen $R0 "$EXEDIR\temp.txt" w
FindFirst $R1 $R2 "$EXEDIR\*.*"
Loop:
IfErrors Done
FileWrite $R0 $R2
ClearErrors
FindNext $R1 $R2
Goto Loop
Done:
FindClose $R1
FileClose $R0
FunctionEnd


-Stu

thanks for reply

ad Vista: yeah, i know, but i need those files sorted by time. i searched in nsis documentation, but found nothing that could do that. probably there is some plugin for this? if anyone knows something about it, please let me know.


You'd need to have an array of files and times, and a way to get the times out of the files... NSIS Array + System plugins I think will do. I'm not certain if the Arrray plugin by Afrow UK can sort numbers.


http://forums.winamp.com/showthread....hreadid=215844


If you're still interested, I put together an example which does this task using my array plugin.
You can get the array plugin here:
http://nsis.sf.net/wiki/File:NSISArray.zip

The example is called MakeFileList.nsi which is in the Examples\NSISArray folder.

-Stu


AWESOME!!
sure i am interested, thank you very much
i appreciate your help :up: