Reputation: 9487
We are installing out program via inno setup. We have one main exe file, that runs our actual program, but we install some other exes that are always running in the background.
When main.exe runs for the first time it starts this other exe. Other exe is OK to run all the time, it is in fact necessary. However, if main.exe is stopped via task manager or something other.exe keeps running. When other.exe is running, the user cannot run main.exe. How can we change this behavior?
EDIT
Seems unrelated to innosetup, so I will have to go the route suggested in the answer.
EDIT AGAIN The problem was ultimately that windows saw main.exe starting other.exe and considered it a sub-process. Finding a way to start other.exe outside of main.exe was ultimately the solution
Upvotes: 2
Views: 1271
Reputation: 9192
If I understand correctly, you have two (or more) programs(EXEs). If MAIN.EXE starts first, it starts OTHER.EXE and this is correct. If OTHER.EXE is started first or is running and MAIN.EXE is stopped, then MAIN.EXE will not restart until OTHER.EXE is stopped. Is that correct? If so, you'll need to change both MAIN.EXE and OTHER.EXE. In MAIN.EXE, you'd need to check for OTHER.EXE and either stop it or tell the user to stop OTHER.EXE before starting MAIN.EXE. In OTHER.EXE at startup, you need to check for MAIN.EXE. If it's not running, start it or tell the user to start it before starting OTHER.EXE.
After reading the other comment, I don't think my original answer is correct. Two programs (APPLICATION.EXE and SERVICE.EXE) don't inherently share a mutex and aren't automatically prevented from running at the same time. You need to look at why APPLICATION.EXE doesn't run when SERVICE.EXE is running and what error is returned. That might help determine what you need to do. You'll probably still need to change SERVICE.EXE and APPLICATION.EXE.
Upvotes: 1