It seems myCreateProcess(), in exehead/util.c, doesn't care about $OUTDIR (== state_output_directory).
######### test script
OutFile "exetest.exe"
Function .OnInit
StrCpy $OUTDIR "C:"
MessageBox MB_OK 'Execshell should open prompt "c:\>"'
ExecShell "" "CMD"
MessageBox MB_OK 'Exec should also open prompt "c:\>" but...'
Exec "CMD"
Quit
FunctionEnd
Section
SectionEnd
Logged In: NO
SetOutPath sets the working dir...
Logged In: YES
user_id=1045042
Originator: NO
From the documentation:
4.9.1.9 SetOutPath
outpath
Sets the output path ($OUTDIR) and creates it (recursively if necessary), if it does not exist. Must be a full pathname, usually is just $INSTDIR (you can specify $INSTDIR if you are lazy with a single "-").
SetOutPath $INSTDIR
File program.exe
===
Clearly, as the script is accurate, setting OUTDIR does not affect the working direct used by Exec
Logged In: YES
user_id=584402
Originator: NO
As said, it's SetOutPath that sets the working directory. Setting $OUTDIR itself with StrCpy is not enough.