PDA

View Full Version : FilesInUse



pmcclosk
03-01-2006, 05:20 PM
I've been working on a C++ custom action to populate the FilesInUse dialog box. This is for a Basic Msi Project.

It works great when run on Win2k, but does nothing on XP Pro sp2. Is this a known issue across versions of Windows Installer itself? I use Msi Database functions in other custom actions (with other MSI tables), and have never experienced behavior like this before.

Thanks

Zweitze
03-02-2006, 04:43 PM
I didn't experience that.
Maybe you bumped into some improved security, a function that worked in Win2000 may fail in WinXPsp2.

pmcclosk
03-03-2006, 10:00 AM
Thanks for the reply. I ran across a forum posting at eggheadcafe.com that described the exact same situation that I've been seeing. The poster even had an identical error message in his log file.

My approach was to use the function below:
MsiProcessMessage(hInstall, INSTALLMESSAGE_FILESINUSE, hRecord);

I even put a fake message in the record to make sure that the dialog was getting the information I wanted it to. Running on W2K, the files in use dialog had my message. When run on XP, the dialog contains the window title of the open application. I know this is correct behavior, but we're seeing a bug that allows someone to have the app open from a network drive during uninstall and after clicking retry once, the filesinuse dialog is never displayed again with the app still open. The uninstall grinds to a crawl and eventually completes, but leaves everything behind on the network install location. I had thought to make a custom action that finds the app process and loops until someone actually closes it and the process disappears. It all works on 2k. I'm starting to take this personally...

Zweitze
03-03-2006, 01:29 PM
You've got to process the results of MsiProcessMessage() - it doesn't do anything but show the dialog. When user presses Retry, your code should check again, and display the message if necessary. When the user presses abort, your CA should terminate and return UserCancel (I believe 1602).

BTW: Do you do the check in a ControlEvent? (eg. on a PushButton, not a sequence) In that case MsiProcessMessage won't show any dialog.

pmcclosk
03-06-2006, 11:28 AM
Thanks again for the reply, I do have the CA as a sequence. My main question is still why does it work in Windows 2000 as a sequence? I'll see about changing it to a Control Event.

Zweitze
03-06-2006, 01:03 PM
Well, don't schedule your CA in a ControlEvent: the dialog won't be displayed.
In my case I scheduled the CA just before InstallValidate, in the InstallExecute sequence.

BTW My case was checking for the existence of Outlook, for uninstalling an Outlook COM Add-in. InstallValidate itself (which is responsible for detecting Files in use) could not figure out that the file belongs to Outlook, so I had to do this myself.