[wix-users] FilesInUse event

Blair Murri osito at live.com
Wed Oct 18 10:17:42 PDT 2017


In Windows, there are basically two kinds of in-use file locks: soft (the file can be moved and deleted during next reboot) and hard (can't). If the file is soft-locked, then only that process needs to be recycled, not the entire system, thus eliminating the dreaded reboot.



MSI does what it can to avoid reboots, because of the negative effect they have on customer satisfaction. If the file is hard-locked, the new version of the file will be written to a temporary location and will only replace the old file during the next reboot, while soft-locks allow for inplace replacement, where removal of the old file isn't critical. Thus, only hard-locks will result in FilesInUse prompts.



If you need to ensure that your application processes are recycled during upgrades, it's recommend you register them with the restart manager (services should already be authored in such a way as to already be stopped and started as part of the upgrade sequence). WiX includes support for this registration.



Blair Murri



Sent from my Windows 10 phone



From: Roland K via wix-users<mailto:wix-users at lists.wixtoolset.org>
Sent: Wednesday, October 11, 2017 6:52 AM
To: wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>
Cc: Roland K<mailto:rolandkieslinger at gmail.com>
Subject: Re: [wix-users] FilesInUse event



I found the following lines in the log:

Aktion gestartet um 15:38:27: InstallValidate.
MSI (s) (DC:90) [15:38:27:724]: PROPERTY CHANGE: Deleting
MsiRestartManagerSessionKey property. Its current value is
'3c5e7e74b929e943bf1e2d63080c406c'.
...
MSI (s) (DC:90) [15:38:32:404]: RESTART MANAGER: Did detect that a critical
application holds file[s] in use, so a reboot will be necessary.
...
Aktion gestartet um 15:38:35: RemoveExistingProducts. *(old msi is getting
started - I'm doing MajorUpgrades with Schedule="afterInstallInitialize")*
*...*
Aktion gestartet um 15:38:36: InstallValidate.
MSI (s) (DC:48) [15:38:36:696]: PROPERTY CHANGE: Deleting
MsiRestartManagerSessionKey property. Its current value is
'f9337d59ae6e2247a247bae8eec8a76f'.
...
MSI (s) (DC:48) [15:38:38:347]: RESTART MANAGER: Did detect that a critical
application holds file[s] in use, so a reboot will be necessary.
...
MSI (s) (DC:48) [15:38:48:084]: PROPERTY CHANGE: Adding ReplacedInUseFiles
property. Its value is '1'.
MSI (s) (DC:48) [15:38:48:085]: PROPERTY CHANGE: Deleting UpdateStarted
property. Its current value is '1'.
Aktion beendet um 15:38:48: InstallFinalize. Rückgabewert 1.


As we see here, the installer detected the replaced files, shouldn't it
then raise the "FilesInUse" event in the parents bootstrapper?

2017-10-11 15:18 GMT+02:00 Roland K <rolandkieslinger at gmail.com>:

> I have a custom bootstrapper with a msi inside.
>
> If I wanna update an existing installation, but there's still an
> application open (or a file in use) which should be replaced, I wanna show
> a dialog, so the user can decide if he wants to retry, ignore or cancel it.
> Sometimes the "FilesInUse" event of BootstrapperApplication gets raised so
> I can show the dialog, but sometimes NOT.
>
> Why?
>
> What can be the reasons the event is not raised?
>
> Thanks in advance!
>

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list