schadek Posted November 14, 2006 Share Posted November 14, 2006 In general I'm trying to halt execution until a complete program installation completes. I'm running a process called setup.exe that spawns msiexec.exe processes. I'm not sure how many of these actually get spawned. I can't use the RunWait with setup.exe because it ends before the msiexec.exe processes have finished. Any idea how I can monitor for spawned processes of a known running process and halt execution until they are done. I'm familiar with all of the process and run functions. Link to comment Share on other sites More sharing options...
GaryFrost Posted November 14, 2006 Share Posted November 14, 2006 May depend on the product being installed. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 14, 2006 Share Posted November 14, 2006 ProcessExists("msiexec.exe")? Link to comment Share on other sites More sharing options...
GaryFrost Posted November 14, 2006 Share Posted November 14, 2006 ProcessExists("msiexec.exe")?Most of the time even after the install is done one msiexec.exe stays loaded for some time. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
bhoar Posted November 14, 2006 Share Posted November 14, 2006 Most of the time even after the install is done one msiexec.exe stays loaded for some time.http://www.autoitscript.com/forum/index.ph...mp;#entry215406This thread shows how to find the parent process ID for all processes. I suppose what you could do is start creating a tree of processes by scanning all processes to get their parents, starting with your forked process then all of it's children, iteratively on downward. Then mark any discovered processes as children to wait for.Note that non-root/non-leaf processes in the middle of the tree can exit while leaving their children intact. I'm not sure what happens then, but I suspect the children are adopted by another process having to do with the session or the system. Hmm, google says the parentprocessid doesn't change and it may point to a terminated process.Keep checking on a regular basis adding any new children and removing any exited children until all subtrees or former subtrees finally exit.-brendan Link to comment Share on other sites More sharing options...
schadek Posted November 14, 2006 Author Share Posted November 14, 2006 http://www.autoitscript.com/forum/index.ph...mp;#entry215406This thread shows how to find the parent process ID for all processes. I suppose what you could do is start creating a tree of processes by scanning all processes to get their parents, starting with your forked process then all of it's children, iteratively on downward. Then mark any discovered processes as children to wait for.Note that non-root/non-leaf processes in the middle of the tree can exit while leaving their children intact. I'm not sure what happens then, but I suspect the children are adopted by another process having to do with the session or the system. Hmm, google says the parentprocessid doesn't change and it may point to a terminated process.Keep checking on a regular basis adding any new children and removing any exited children until all subtrees or former subtrees finally exit.-brendanThanks, I'll investigate this. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now