Spilly
10th April 2008 18:45 UTC
Differntiating between Application and Installer with the same process name
Hey guys,
I'm trying to close an application if it is running while the installer is running, but the problem is that the application has the same process name as the installer.
How can I find which is which to close the application properly?
Anders
10th April 2008 18:51 UTC
well, if you look for a window, you can compare class names or compare with $hwndparent
Spilly
10th April 2008 23:36 UTC
Good suggestions.
I tried, but the class name is too generic to rely on and the window title shares the first two words of the installer title and the final word is different based on the locale.
For instance:
Company AppName Setup (Installer, with Setup localized and re-arranged based on locale)
Company AppName Trial (Trial is localized in four languages)
Company AppName (Registered Version of App)
Thoughts?
Joel
11th April 2008 02:43 UTC
I don't recall right, isn't there like a RegEx plugin for nsis? You can use it to detect "Setup", "Trial" or non in the given window titles.
Anders
11th April 2008 09:48 UTC
If you call GetWindowThreadProcessId with the system plugin, passing in $hwndparent, you know which process/PID not to kill
Afrow UK
11th April 2008 10:35 UTC
Using the LockedList plug-in is your safest answer.
Stu