[wix-users] hold a mutex or file lock for the whole lifetime of an msi installation/update
Jacob.Hoover at greenheck.com
Thu Oct 19 08:28:00 PDT 2017
An easier alternative to the mutex would be a CA at the beginning and end of the install process that would write a flag to the registry. You could also alter you application to include a sync object in the global namespace, and you could have a delayed CA at the beginning of the deferred install execute sequence verify that the object hasn't been created.
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Roland Kieslinger via wix-users
Sent: Thursday, October 19, 2017 7:59 AM
To: wix-users at lists.wixtoolset.org
Cc: Roland Kieslinger <rkieslinger at rzl.at>
Subject: [wix-users] hold a mutex or file lock for the whole lifetime of an msi installation/update
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!
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users