Click here to Skip to main content
15,887,937 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello friends,

I know checking the process existence by name or PID, but in my scenario, i need to check the process is running or not, with the help of Process description.
Is there any way or workaround to do this?

In my scenario i have to detect whether a Suite installer by Process Name (setup64) and Process Description (Setup Suite Launcher Unicode) is running or not. If running then i need to wait for it to exit.

I can detect the process by name Setup64 but then chances are there that it may not be unique on some machines as setup is kind of generic name. So to maintain uniqueness i need to detect by Process description. Any idea how can i achieve this. Please help.

What I have tried:

Tried detecting process by name and PID.
But unable to detect using Process description
Posted
Updated 3-Oct-18 2:58am
Comments
#realJSOP 3-Oct-18 8:40am    
Show us your code.

1 solution

You can't use the PID because it's assigned by the system when you execute the process, and therefore it is highly probably that it will be DIFFERENT every time the process runs. You shouldn't use the description, because that could be changed by a developer between executions. You SHOULD use the executable name. There is plenty of code on the internet that illustrates how to go about doing this.
 
Share this answer
 
Comments
Dinesh Kumar Dora 4-Oct-18 1:24am    
thanks for your response John. But the problem here is that we are talking about installer exe, where the executable name (_is56.exe) will be changing everytime the build is taken. So i cant keep a static executable name for process checking. I agree with your PID justification too. Process name i cant use as that will show up as "Setup" or "Setup64" which is way too generic and chances are there that another setup might be running on the host machine. So, process name is also apt. Now the only option left is Process description - which in our case is unique and it will never be changed as we have developed it. So any ideas or workaround to detect a process is running or not, based on the process description? Thanks
#realJSOP 4-Oct-18 5:27am    
Nope - you can't do it by description. Since you HAVE to do it by name, my advice is to give your app a name that starts with a known prefix, so that the executable name looks something like this: "myapp_is56.exe", and then you could look for processes that start with "myapp_is", or some such thing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900