The problem is that ExecDos creates an empty file with a random (?) number name in the $EXEDIR. 🤪
nsExec & ExecCmd haven't function "isDone", which is needed for further use.
Here's just an example script:
OutFile test.exe
!include FileFunc.nsh
!include LogicLib.nsh
!include nsDialogs.nsh
Page custom window
Var hwnd_func_load
Function .onInit
InitPluginsDir
GetTempFileName $R3 $PLUGINSDIR
StrLen $R2 $EXEDIR
IntOp $R2 $R2 + 1
FunctionEnd
Function window
nsDialogs::Create 1018
${NSD_CreateGroupBox} 0 0 100% 100% 'test'
GetFunctionAddress $hwnd_func_load load
nsDialogs::CreateTimer $hwnd_func_load 1
nsDialogs::Show
FunctionEnd
Function load
nsDialogs::KillTimer $hwnd_func_load
FileOpen $R1 $R3 w
${Locate} '$EXEDIR' '/L=F /M=*.txt' writeLine
FileClose $R1
ExecDos::exec '$SYSDIR\\sort.exe "$R3" /o "$R3"'
FunctionEnd
Function writeLine
StrCpy $R8 $R8 '' $R2
${If} $R8 == ''
FileWrite $R1 ' $R7$\r$\n'
${Else}
FileWrite $R1 '\$R8\$R7$\r$\n'
${EndIf}
Push $0
FunctionEnd
Section
SectionEnd Any ideas? 😕