[wix-users] hold a mutex or file lock for the whole lifetime of an msi installation/update

Roland Kieslinger rkieslinger at rzl.at
Thu Oct 19 05:58:31 PDT 2017


Hello!

I have a custom bootstrapper with an msi inside.

If somebody installs an update (MajorUpgrade), I have to lock app starts in the meantime. When my custom bootstrapper is used, I have no problem. I have some good entry points where I create a mutex before installing, and release it afterwards. My apps check at startup, if the mutex exists and if yes they exit automatically. If my bootstrapper crashes, the mutex is released anyway.

But when somebody uses my msi, how can I create a mutex or a file lock and hold it for the whole lifetime of an installation/update? If I use a custom action of type "check", the process gets spawned, i create my lock, the process gets killed and the lock is gone. So that doesn't work. I found out, there's a custom action type "asyncWait" which sounds really like what I'm looking for. But as I tried it out, I experienced a serious problem. I described it in an stackoverflow post, see here: https://stackoverflow.com/questions/44500740/wix-error-sfxca-failed-to-create-communication-pipe-for-new-ca-process-error
Most of the time I got the error: SFXCA: Failed to create communication pipe for new CA process. Error code: 231

Why do I get this error and is there probably another solution?

Thank you in advance!


More information about the wix-users mailing list