View Single Post
Old 8th April 2020, 20:08   #2
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 69
Exec is a built-in keyword
(as is ExecWait and ExecShell).

The nsExec plugin is included with NSIS. It also has 3 flavors:
nsExec::Exec or nsExec::ExecToLog or nsExec::ExecToStack

1. If it's a GUI program and you want the installer to wait until execution is complete, you probably want ExecWait. If you want install to continue in the background, use Exec.
2. If it's a command line program and you'd like the user to see the output, you could also use ExecWait or Exec.
3. If it's command line program and you want to hide the window, and have the install continue while it's working, and you don't care about the exit value, then you could use ExecShell with SW_HIDE.
4. If it's a command line program and you do care about the exit value, you'll need to wait until execution completes, so you'd use ExecWait or nsExec::Exec (depending on whether you want the output to be shown). Note that nsExec has a nice timeout feature just in case your program hangs.
5. If it's a command line window and you want to capture the output without making it visible to the user, you'd use nsExec::ExecToLog if the output might be fairly long (greater than 1024 characters for the default NSIS build), or you could use nsExec::ExecToStack if you're sure it's shorter than that.
Nutzzz is offline   Reply With Quote