eyebex
Aug 28 2005, 13:31
I've learned that foobar creates a named mutex, which I want to use to check if foobar is running (which is more reliable than using the classname). However, it seems each foobar installation appends a random string to the mutex, e.g. "FOOBAR2000_01234567", where "01234567" is an uppercase hexadecimal random string (all in unicode). Where does this string come from? Is there a way to calculate it?
Thanks in advance.
foosion
Aug 28 2005, 14:06
Undocumented features of the core are not to be relied upon. They may change at any time without notice.
eyebex
Aug 28 2005, 14:13
I see. How about making the mutex a documented feature then, or introducing an additional mutex with a common name across all installed instances? As the classname can be changed, this seems like the best way to detect running instances of foobar.
kode54
Aug 28 2005, 15:49
And why do you need to do that? If you have your own component which can communicate with external software, why not write your own mechanism for detecting a running installation? What is it you desire?
eyebex
Aug 29 2005, 01:24
I'm writing an installer for a foobar component. If the user installs the component while foobar is running, the installer will fail to replace an existing version of the component. So I'd like to remind the user that he needs to shut down foobar before the installation can continue (or else he will have to restart whole Windows to get the file replaced). As the installer (Inno Setup; I dislike NSIS) already has a built-in CheckMutex feature for that purpose, using a mutex seems the cleanest solution.
What do you mean by "why not write your own mechanism for detecting a running installation", by the way? That's exactly what I'm doing, and the best way to detect a running installation is to check against a mutex. All other methods (e.g. checking the window / class name) are not fool-proof.
Why do you need to make an installer for a component? Why can't you just distribute the dll file(s)?
eyebex
Aug 29 2005, 05:56
Of course I could distribute only the DLL(s), but that won't solve the issue that you can't replace a component while foobar is running. Still, for advanced users, this might be the prefered solution. But as my component does not only consist of a single DLL for foobar, but also contains plug-ins for other applications (it builds a bridge between foobar and these applications), many users have asked for an installer to simplify the setup.
foosion
Aug 29 2005, 06:13
Perhaps a more generic solution would be useful. The installer for
TortoiseSVN detects applications that currently use files it wants to update. It displays this list and asks the user to close them.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.