cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nosrednayduj
Level 7

Check for installer already running

I would like to check if someone has launched another installer already, and exit the second installer if so. Any ideas? Are there any registry entries that get updated when the installer launches (and cleared when it exits, of course!)
Labels (1)
0 Kudos
(4) Replies
pv7721
Level 20

Registry entries I don't think so, but you can check the default temp folder, there should be install.dir.somenumber... but also maybe the previous installer hasn't cleaned up after itself.
0 Kudos
nosrednayduj
Level 7

I thought of that, but then I looked on my current machine and there are like twelve uncleaned-up such temp dirs. So that didn't seem wise to count on; I'd refuse to run legitimately.

The only thing I can think of is writing a java program to listen on a port, and then check if it's available. If the java program was killed at the same time as the installer exited, always, because it was a tree, it might work. But it might be tricky to get it to execute the code and return to the installer leaving the listener running AND able to be killed at installer exit (since I can't count on being able to execute another custom code action, if the user shot it down with task manager). And of course, picking ports is fraught with peril -- I'm sure I'll pick some popular internet game port and then my installer won't run at all if the user has loaded that game.
0 Kudos
pv7721
Level 20

But what exactly does a running installer mean?!? It means a window being present... and something happening in it, maybe it's the wizard section or the installing section; how can a user knowingly run a second installer without noticing the first one?!?
0 Kudos
nosrednayduj
Level 7

Never underestimate the power of the clueless user 😉 Beats me, it was a requirement of my management to "disallow multiple installer launches". Also, of course, on linux, multiple people can have different X sessions and then they really might not know about each other.
0 Kudos