0

Just a question that interested me, I noticed that modern installers (for various types of programs) alert you to wait until another installation is finished before running themselves.

How can I check for that / notify other installers?

Using c# or python

Dan Barzilay
  • 4,974
  • 5
  • 27
  • 39

1 Answers1

0

AFAIK there is no way to "find" other running installers. At least not on every system and every installer. The only good way is to use an installer which supports that like windows installer (but also that only checks for other running windows installers).

A probably working way would be to use a list of process names of installers and check if one of them is running.
Another way found as answers this question is to check a registry key (1) or use the windows api (2). But this two ways would only work on windows.

For ways to check if a process is running you could use the python module psutil. An example which prints all process names would be:

import psutil
for p in psutil.process_iter():
    print p.name
Community
  • 1
  • 1
TobiMarg
  • 3,667
  • 1
  • 20
  • 25
  • Thank you for your answer, so according to the second link (named `2`) I should update that registry value if I want other installers to know i'm installing and they shouldn't interrupt? BTW i'm talking only about windows. Another thing, from your answer and the links in it, how can I check if other programs/installers(which are programs...) use files I want to change? and how do I let other programs know I use a specific file and they should not "touch" it. – Dan Barzilay May 27 '13 at 09:41
  • 1
    I can't answer all this questions, but I *think* it should work to simply create this registry key (e.g. with http://docs.python.org/2.7/library/_winreg.html from the python standard lib). To check if files are in use you could also use psutil (there is already a question: http://stackoverflow.com/q/11114492/2325172). For all this things I would recommend to search for an open source installer and look into it (e.g. https://github.com/jrsoftware/issrc but it is written in delphi). – TobiMarg May 27 '13 at 10:24