How to handle Burn FilesInUse event

I wrote a custom managed bootstrapper app with WiX / Burn and now I am trying to extend it to handle the event ExecuteFilesInUse

. I successfully fired the event and dumped what was given to me and it confused me ... After locking the file with Powershell (using File.Open

c FileShare.None

) and starting to delete, 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 for this seeming madness? I haven't been able to find any documentation of either Burn or Windows Installer (I'm assuming it's the Windows Installer, which is the real source of data) regarding this.

+3


source to share


1 answer


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



0


source







All Articles