mondofan
8th August 2005 15:55 UTC
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
Afrow UK
8th August 2005 17:27 UTC
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
mondofan
9th August 2005 06:35 UTC
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.
deguix
9th August 2005 09:54 UTC
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.
Afrow UK
10th August 2005 11:17 UTC
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
mondofan
11th August 2005 09:37 UTC
AWESOME!!
sure i am interested, thank you very much
i appreciate your help :up: