|
|
#1 |
|
Junior Member
|
Hi,
I am trying to figure out how to make my app find only certain files types ".map" in a dirctory and get name of those files and make a list with the ".map" removed at the end. Can some one plaese help me. Thanks |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jul 2004
Posts: 655
|
http://forums.winamp.com/showthread....ghlight=Locate
Use "GetBaseName" function from latest versions of headers: http://forums.winamp.com/attachment....postid=1590305 |
|
|
|
|
|
#3 |
|
Junior Member
|
Im looking for somthing like this.
but this 1 is crashing. and when i does work i get hi.txt.res or lala.txt.res.......Hellp me. ![]() Section hello FindFirst $R0 $R1 $INSTDIR\*.txt Loop1: Push $R0 ;store file handle Push $INSTDIR\$R1 ;current found file Push addtext Call addtext Pop $R0 ClearErrors FindNext $R0 $R1 IfErrors 0 Loop1 FileClose $R0 SectionEnd Function addtext ClearErrors FileOpen $0 "$INSTDIR\the1.res" "r" GetTempFileName $R0 FileOpen $1 $R0 "w" loop: FileRead $0 $2 IfErrors done StrCmp $2 "datapaste" 0 +3 FileWrite $1 "Something" Goto loop FileWrite $1 $2 Goto loop done: FileClose $0 FileClose $1 Delete "$INSTDIR\the1.res" CopyFiles /SILENT $R0 "$INSTDIR\$R3.res" Delete $R0 FunctionEnd Last edited by WiLdWoLfStray; 1st March 2005 at 01:58. |
|
|
|
|
|
#4 |
|
Junior Member
|
ok more in depth.
I am trying to figure out how to make my app find only certain files types ".map" in a dirctory and get name of those files and make a list with the ".map" removed at the end. and then with thows file names make .res files with this in them. ---------------------------------- "resources" { "Some inputted data from insaller" } ------------------------------------ Can some one plaese help me. Thanks Somthing like this, but i need more info http://forums.winamp.com/showthread....light=FindNext Last edited by WiLdWoLfStray; 1st March 2005 at 02:55. |
|
|
|
|
|
#5 |
|
Major Dude
|
The functions are much better to use:
Search For a File Search file or directory (alternative) I think the easier to follow is the first one and it has an example of use. The second one has more options but doesn't have examples. |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
I will write a simplified function for you today (when I get home!)
It's simpler to do than the code you have. -Stu |
|
|
|
|
|
#7 |
|
Junior Member
|
Thx 4 hellp'n the n00b.
Afrow UK, I looked in your profile and at "FindIt: Simple search for file / directory" could not figure it out. |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
I had time in Computing to do it:
http://nsis.sourceforge.net/archive/...22&instances=0 I haven't tested it, but it should work. -Stu |
|
|
|
|
|
#9 |
|
Junior Member
|
works ok, but there is still the file extension at the end.
|
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
Change this:
code: To this: code: -Stu |
|
|
|
|
|
#11 |
|
Junior Member
|
Afrow UK = #1 [NISI] Friend.
Thanks. |
|
|
|
|
|
#12 |
|
Junior Member
|
Hello.......
Need some more help. With this, how do i get just the acount name? ========== ReadRegStr $R0 HKCU "Software\Valve\Steam" ModInstallPath StrCmp $R0 "" NotPresent Present NotPresent: StrCpy $INSTDIR "$PROGRAMFILESC\Valve\Steam\SteamApps\[Find it u'r self.]" Goto Done Present: StrLen $R3 $R0 loop: IntOp $R1 $R1 - 1 IntCmp $R1 -$R3 exit exit StrCpy $R2 $R0 1 $R1 StrCmp $R2 "\" exit Goto loop exit: StrCpy $R0 $R0 $R1 StrCpy $INSTDIR "$R0$0" WriteIniStr "$PLUGINSDIR\main.ini" "Field 2" ListItems "$R0|" Done: |
|
|
|
|
|
#13 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
Use GetParent from the docs (i.e. to strip "half-life" from the end). Then use this function to get the account name.
-Stu |
|
|
|
|
|
#14 |
|
Junior Member
|
Thanks but can you also help me with this?
I need to be able to new line it but if i do. it craps out Please help ;------------------------------------------------------ ReadINIStr $R8 "$PLUGINSDIR\main.ini" "Field 6" "State" Push "$INSTDIR\outputintores.txt" # output file Push "*.*" # filter Push "$R8" # folder to search in ;------------------------------------- Exch $R0 #path Exch Exch $R1 #filter Exch Exch 2 Push $R3 Push $R4 Push $R5 Push $R9 ClearErrors FindFirst $R3 $R4 "$R0\$R1" Loop: IfErrors Done3 FindNext $R3 $R4 StrCmp $R4 "." loop StrCmp $R4 ".." loop WriteINIStr "$PLUGINSDIR\main.ini" "Field 8" "State" "$R6$\r$\n$R4" GetDlgItem $1 $HWND 1210 ReadINIStr $R6 "$PLUGINSDIR\main.ini" "Field 8" "State" SendMessage $1 ${WM_SETTEXT} 0 "STR:$R6" Goto Loop Done3: Pop $R9 Pop $R5 Pop $R4 Pop $R3 Pop $R2 Pop $R1 Pop $R0 Abort ; Return to the page |
|
|
|
|
|
#15 |
|
Forum King
|
is there a way to get MakeFileList work recursively?
|
|
|
|
|
|
#16 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|