Does nsExec::ExecToStack is waiting the process to finish?(NSIS)

916 Views Asked by At

I am trying to install VC_redist.x64_v14.27.29016.0.exe using NSIS installer in silent mode with no interaction. This is the code:

nsExec::ExecToStack 'VC_redist.x64_v14.27.29016.0.exe /install /quiet /norestart'
    pop $0
    pop $1  

I am using ExecToStack in order to get the exit code.

My question is: Can I be sure that nsExec::ExecToStack waits till the process exits and then returns the exit code? Is there a difference between ExecWait and nsExec::ExecToStack??

I want to know if the vcredist executable is installed successfully before proceed with the rest of my installation.

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

Yes, the nsExec plug-in will wait for the child process. It will however not wait for grandchildren that outlives its parent process.

nsExec is designed for console applications, you should probably just use ExecWait.

ExecWait '"$temp\redist.exe" /something /whatever' $0
DetailPrint "Exit code is $0"