Archive: I want to check if my installer is running from command line


I want to check if my installer is running from command line
Hi everybody,
I love NSIS and like to do things with it beyond the normal installer. NSIS is a special most powerful tool, can make everyone feel like a programmer :-) Now I'm working on a script where I want to check if my installer is running from command line and if it is true executute the installation, else if it is running from clicking on it terminate the installation. Is it possible to make?
Thanks in advance


You could have a switch that is required to pass in via command-line. If the switch isn't passed in, exit.


Maybe you could write a plugin to get the PID of the parent process, then find the module for the parent process. If the module is cmd.exe or command.exe, then you know it is run from the command line.
http://www.codeproject.com/threads/ParentPID.asp