NSIS Find files in silent mode not working

2019-08-29 06:25发布

问题:

I have the following function to recursively search for dll files.

Function ProcessDLLFiles
Exch $0
Push $1
Push $2
FindFirst $1 $2 "$INSTDIR\*.dll"
loop:
    IfErrors end
    DetailPrint 'Found "$0\$2"'
    FindNext $1 $2
    goto loop
end:
FindClose $1
FindFirst $1 $2 "$0\*.*"
dirloop:
    IfErrors dirend 
    IfFileExists "$0\$2\*.*" 0 dirnext
    StrCmp $2 "." dirnext
    StrCmp $2 ".." dirnext
    Push "$0\$2"
    call ${__FUNCTION__}
dirnext:
    FindNext $1 $2
    goto dirloop
dirend:
    FindClose $1
Pop $2
Pop $1
Pop $0
FunctionEnd

When I run the installer normally, it works as expected and finds all dll files in the associated folder.

However, it does not find these files in silent mode, even though I can navigate to the directory it is searching in and see that the files are there. I already request admin privileges during installation, and Administrators have full permissions on the dll files in the folder.

Any ideas why it may not be finding the files?

回答1:

When calling the nxs plugin to create a banner, needed to use /end parameter.