SB10: "Detect Active Application" not working
Having an issue with setups not able to detect that an application is
running. Then, because of this, it proceeds with an update and tells
the user they have to re-start.
NOTE: This detection seems to WORK FINE in a VM.
If the user has the software on a non-VM, then it gives a 603 (fail)
instead of 1 (success).
If anybody is willing to check this out and/or tell me what I'm doing
wrong, I'd really appreciate it.
This zip file should have all you need to run "junk2" then run
"JunkIsRunning" to see if junk2 is running.
If it's detected, you should get a "1". If it fails, it's a 603.
I turned off requireAdmin because it was a PITB when testing and not
needed.
https://jssoftware.com/SBTest/junk2.zip
Jeff Slarve
www.github.com/jslarve
Re: SB10: "Detect Active Application" not working
Dunno, Jeff.
I tried on three laptops (two Win 10 and one Win 8.1). The two Win 10
machines do have VMware installed, but I ran your stuff on the host.
The Win 8.1 has no VMware.
All three return 1 if junk2 is running, 603 if not.
Are your users running on single-user computers (not RDP or any kind
of shared environment?
I couldn't make it break. Sorry...
jf
Re: SB10: "Detect Active Application" not working
Thanks Jane. Weird.
My work machine (brand new Dell with Windows 11) will not detect
junk2.
My personal dev machine (5 year old Dell Precision workstation) fails
too. But a Windows 10 VM finds it just fine.
Another dev is the one that discovered the VM thing. But I guess
that's a red herring.
Jeff Slarve
www.github.com/jslarve
Re: SB10: "Detect Active Application" not working
I think I've discovered the actual issue.
If I had to guess, I'd say that Friedrich allocated an array of ~250
DWORDs for use in EnumProcesses. If the name of your desired process
isn't within those first 250, then it fails.
Try closing junk2.exe, then opening a bunch of apps until tasklist gets
more than 250 processes, then open junk2 and try the test app.
Jeff Slarve
Re: SB10: "Detect Active Application" not working
I think you're right, Jeff.
I opened a gazillion Chrome and Firefox windows and your app returned
603. Then closed those and it returned 1.
It would be interesting to build a similar test with Capesoft's
OddJob.
I have a watchdog monitoring some web apps. If anything becomes
unresponsive, Oddjob tries to stop the service in question, then
searches for and kills any running instances showing in Task Manager.
Then restarts the service.
I haven't tried the "250 things" test with it but it's running on a
normal production server that has a fair bit of stuff going on.
jf
Re: SB10: "Detect Active Application" not working
Hi Jeff,
I have created a small SetupBuilder 2019 project to start (from within a
Loop/End) a "dummy" JUNK.EXE Clarion executables 250 times. After that, I
started one instance of JUNK2.EXE and fired a "Detect Active Application"
action.
It returned 603. That means, JUNK2.EXE is not active. But this is WRONG
because JUNK2.EXE is definitely running!
Then I compiled the very same project with the internal version of
SetupBuilder 2023.
This time it returned 1.
So it seems to me I already fixed this. Checked my source code history and
see that I already worked with Capesoft on a similar issue. So it seems to
be related.
If you are interested, I can send you a small compiler library to check it
out.
Thank you for bringing this to my attention.
Friedrich
Re: SB10: "Detect Active Application" not working
Hi Friedrich -
I am interested in your library update. Thank you very much. :)
Jeff Slarve
Re: SB10: "Detect Active Application" not working
Hi Jeff,
did you receive it? I sent it 8 hours ago.
Friedrich
Re: SB10: "Detect Active Application" not working
Thanks for the help, Jane
Jeff Slarve
Re: SB10: "Detect Active Application" not working
BTW - CreateToolhelp32SnapShot() doesn't require pre-determining how
many PIDs to accommodate, unlike EnumProcesses.
Jeff Slarve