Assuming you can't close the application and that you must reboot, you can use $CMDLINE to check the command line parameters passed on to the installer. To make the installer start up silent all you need to do is pass /S and NSIS will take care of the rest. To check if the installer is silent by command line you can use
IsSilent. To get the command line parameters alone, without the executable path use
GetParameters.
If I were you I would try to avoid the reboot and seek a way to close the process that doesn't involve TerminateProcess. Maybe if you specify the application you're trying to close someone can help you with it. If it is a service you can use Sunjammer's services handler plug-in from the
archive's downloads page.