PDA

View Full Version : How to show the dialog "File in use"(MsiRMFilesInUse)?



hjsunj
03-12-2008, 06:01 AM
I have read "Minimizing Reboots on Windows Vista Systems" from the help library, and it says:
An installation displays the MsiRMFilesInUse dialog on a Windows Vista system if one or more files that need to be updated are currently in use during the installation.

But in my test I found it could not perform as aforementioned.
1. Create a Basic MSI project
2. add IPMSG.exe to Destination Computer's WindowsFolder.
3. add IPMSG.exe to C:\Windows
4. start IPMSG.exe in C:\Windows
5. start installation and use the default path to comlete it.

No "File in use" dialog appeared.

So my question is: How to make the dialog appear when some files in use?

bryanwolf
03-12-2008, 08:36 AM
You should start by looking in the installation log around the InstallValidate action and seeing what information was placed there.

For more information on creating an MSI log file, please reference this article:
http://support.installshield.com/kb/view.asp?articleid=Q104807

hjsunj
03-12-2008, 11:04 PM
The log about InstallValidate as follows:

MSI (s) (38:0C) [11:49:22:619]: Doing action: InstallValidate
Action 11:49:22: InstallValidate.
Action Start 11:49:22: InstallValidate.
MSI (s) (38:0C) [11:49:22:619]: Feature: My_Project_Name_1_Files; Installed: Absent; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: __Main.exe66; Installed: Null; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: __IPMSG.exe65; Installed: Null; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: __Main.exe65; Installed: Null; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: TestDLL.dll; Installed: Absent; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: Main.exe; Installed: Absent; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: AllOtherFiles; Installed: Absent; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: IPMSG.exe; Installed: Absent; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Component: AllOtherFiles1; Installed: Absent; Request: Local; Action: Local
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Registry
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: BindImage
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: ProgId
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: PublishComponent
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: SelfReg
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Extension
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Font
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Class
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: _RemoveFilePath
MSI (s) (38:0C) [11:49:22:619]: PROPERTY CHANGE: Modifying CostingComplete property. Its current value is '0'. Its new value: '1'.
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Registry
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: BindImage
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: ProgId
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: PublishComponent
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: SelfReg
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Extension
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Font
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2205 2: 3: Class
MSI (s) (38:0C) [11:49:22:619]: Note: 1: 2727 2:
MSI (s) (38:0C) [11:49:22:634]: Note: 1: 2727 2:
Action End 11:49:22: InstallValidate. Return 1。

But i don't understand it。Where was the error?

hjsunj
03-12-2008, 11:10 PM
I have seen there's MsiRMFilesInUse dialog in my Basic MSI project, through "User Interface > Dialogs".
But Which event/custom action will launch it?

bryanwolf
03-13-2008, 09:16 AM
I can suggest is that you look around more for it talking about files being in use or post the whole log and perhaps someone can point you in the right direction.

MichaelU
03-13-2008, 10:59 AM
One unfortunate thing I can think of related to this, is I don't remember being able to trigger a FilesInUse or MsiRMFilesInUse dialog unless the file in use was already known to MSI. The easy way to do that is to install a pacakge with an executable, launch the executable, then remove the package. The harder (but perhaps more relevant) case is to create a minor or major upgrade package which updates that previous exe to a newer version.

hjsunj
03-13-2008, 08:25 PM
Thanks MichaelU.
From your words "unless the file in use was already known to MSI", but how to make MSI known it? MSI automatically detect that by InstallValidate action, right?

MichaelU
03-14-2008, 10:29 AM
I mean that unless MSI has already installed the file, I've run across cases where it ignores the in-use nature of an identical file. So to make it known, install it. Then try an upgrade or removal. If you're not dealing with upgrading from a non-MSI installation, this is a fairly safe requirement; a customer is reasonably unlikely to have randomly copied your exe into the target location without your installer.

hjsunj
03-18-2008, 05:15 AM
Thanks MichaelU, I think I have got it.
The Files in use dialog only appeared when uninstall/upgrading, right?

MichaelU
03-18-2008, 10:42 AM
That's when I encountered it in simple tests. Note that if you're using some common-folder shared merge modules, you might encounter the ugprade case for a file even when it's not an upgrade scenario for the full package.