3
votes

I have written a custom managed bootstrapper application with WiX/Burn, and now I'm trying to extend it to handle the ExecuteFilesInUse event. I have successfully triggered the event and done a dump of what I'm given, and it has me confused... After locking a file with Powershell (using File.Open with FileShare.None) and starting an uninstall, I get two callbacks with this data:

[0484:0B48][2014-08-21T15:14:22]i000: Intercepted ExecuteFilesInUse event. Parameters: 
        PackageId = TheProduct.msi
        Files = {
            "1524"
            "Windows PowerShell"
            ""
            ""
            ""
            ""
            ""
            ""
        }
        Result = None
[0484:0B48][2014-08-21T15:14:22]i000: Intercepted ExecuteFilesInUse event. Parameters: 
        PackageId = TheProduct.msi
        Files = {
            "Windows PowerShell"
            "Windows PowerShell (Process Id: 1524)"
        }
        Result = None

So, two callbacks, with the "same", but differently formatted data. Also, the first one has a bunch of empty elements.

Is there some method to this apparent madness? I failed to find any documentation of either Burn or Windows Installer (I'm guessing it is the Windows installer that is the real originator of the data) regarding this.

1

1 Answers

0
votes

Since I was unable to get the Burn events to work for me, I ended up running my own FilesInUse check, creating a short-lived RestartManager session, before starting the Apply phase. There is an obvious race condition here, where the application is started just after the check is complete, but it has been deemed acceptable in this case.