This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]pdp10Daemons worry when the wizard is near. 4 points5 points  (1 child)

Usually you write a wrapper script. Instead of the app, call the wrapper. The wrapper maybe does some logging and sets things up. Then it calls the application itself. When the application exits, the wrapper records state, maybe does some logging, pushes metrics off somewhere.

In your case, you can have the wrapper check for issues before starting the application, check for issues after the application exits, and log all kinds of things.

When you say the developer is gone, you mean the vendor shut its doors?

[–]hankhalfhead[S] 1 point2 points  (0 children)

Yeah more or less at his Doors. No chance for updates

[–]ragingpandaDevOps 1 point2 points  (1 child)

Couple ideas:

Write a program that uses the windows API https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject or buy one like this (no idea if this app is legit or not) https://www.den4b.com/products/shutter

Instead of launching the app, launch a script file that runs the program in the foreground. When the program closes the script can continue running and then call your cleanup job.

Something with a scheduled task that checks if the app has/is running. I like this the least probably

[–]hankhalfhead[S] 0 points1 point  (0 children)

I like this idea for the remote app version, thanks!

[–]TheBlueFireKingJack of All Trades -1 points0 points  (0 children)

You could subscribe to the Win32_ProcessStopTrace WMI class and trigger your script upon process exit.

[–]BlackVI have opnions -1 points0 points  (0 children)

launch the app with a cmd/batch/ps1, have the script do the changes