Search for files, any easier way?
hi back again, before im going into 24 hours of reading in the forum, witch i have allready done :-), im having some difficulties implenting a search script, and not sure if you really have to make 2 pages of script to make this installer search for a file on any location on any drive letter possibel. so far i have this section i wanna work with:
Function .onInit
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\GhostRecon.exe" "path"
StrCmp $R0 "" NotPresent Present
notpresent:
StrCpy $INSTDIR "$programfiles\Red Storm Entertainment\Ghost Recon\Mods\Navy SEALS_V2"
MessageBox MB_ICONQUESTION|MB_YESNO "Couldent Find The Location Of [..\Ghost Recon\Mods], Want This Installer To Search For The Right Location?" IDYES +2
goto done
goto search
search:
present:
strcpy $instdir "$R0\mods\Navy SEALS_V2"
goto done
so what i have read to make a search was to enter this:
ComponentText "Check the drives where you want the installer to scan for Ghost Recon Directory." "" "Select drives to scan:"
; One section to scan drive C
Section "Drive C:"
; put search root on stack, initialize stack counter
StrCpy $8 1
Push "C:"
; start searching
Call FindFiles
SectionEnd
; One section to scan drive D
Section "Drive D:"
; put search root on stack, initialize stack counter
StrCpy $8 1
Push "D:"
; start searching
Call FindFiles
SectionEnd
now here is my question, is it really meaning you have to make a section like above for every harddrive letter possible? since there is alot of harddrive letter possible since cc: dd: ee: is also possible :-).
and when i wanted to make an goto the search section where the script should search for a file i would get an error that ComponentText cannot be inside a function, ok i moved it out, but look like the function .oninit and all the thing in there must not be seperated by no function stuff, hehe can it be done? and plz dont mind cut it out for me :-), since the stuff in the archives are not any good for me, there is to little info there, i dont get the whole picture. Well i almost dont get any of this scripting anyway :-(