janderssen
Posts: 18
Joined: Tue Nov 20, 2007 7:19 am

Close applications dialog

How do I stop AI from asking to close applications when installing/un-installing.

Thanx in advance
Cheers
Jason
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Close applications dialog

Hi,

Please note that this dialog ("FilesInUse" on XP and "MsiRMFilesInUse" on Vista) is shown automatically by Windows Installer, therefore it cannot be removed or hidden. The only solution is to run a custom action before the install/uninstall process which stops the processes which use the files.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
janderssen
Posts: 18
Joined: Tue Nov 20, 2007 7:19 am

Re: Close applications dialog

Hi Cosmin,

Thank you for your response, but is there anything we can do about it, as the programs it complains about that are still running have no files in use that we are going to install. I am not sure how it works out that there is files in use that our application does not touch?

I tested other program's installers (that are msi) and they somehow dont show this dialog? So there must be someway to get around this problem, or more accurately tell if a program is using the same file as one we are going to install (which is actually the real problem, it seems to be giving false positives )

Reading the documention to InstallValidate Action, it requires a dialog (which I assume is provided by you), could AI not simply respond immediately with a success value :

from msdn :
"Any other return value: The InstallValidate action immediately returns control to the installer with a status of msiDoActionStatusSuccess. In this case, since one or more files are still in use, the subsequent InstallFiles and/or InstallAdminPackage actions must schedule the in-use file(s) to be replaced or deleted when the system is restarted."

because based on the following doco :
"An entry is added to an internal FilesInUse table if any file is overwritten or removed while it is open for execution or modification by any process during file costing."

A restart will only be required at the end if the following actually takes place, else no re-start is required.

Also as another test, I had internet explorer opened (which is one of the programs it complains about), and un-install Microsoft office Power Point viewer, and not message box appears complaining about this. The more I test other program installers, I think this is some kind of bug ?

Cheers and thanx again in advance.
jason
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Close applications dialog

Hi,

Please note that this is completely managed by Windows Installer and this behavior cannot be controlled from outside. Also, sometimes Windows Installer is wrong and shows this dialog although it shouldn't.
I tested other program's installers (that are msi) and they somehow dont show this dialog?
This is because their installation does not conflict with any program. You can try the package on other machines and see if the problem persists.

I'm not sure why this bothers you because it is the normal Windows Installer behavior. Also, it allows the user to close the applications which are using the conflicted files.
However, this dialog can be avoided by running a custom action before the install/uninstall process which stops the processes which use the files.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
janderssen
Posts: 18
Joined: Tue Nov 20, 2007 7:19 am

Re: Close applications dialog

Cosmin,

I have finally worked out what is causing this issue, if i dont have the services running of our application, it does not pop up the dialog box.

My guess is that the Windows Installer is verifying that all files are ready to be deleted (ie not locked etc), and if any file is in a state it cannot remove, it just displays pretty much all my applications that are opened, thinking that one of them has the files locked.

So is there a way to stop the services before this check is done?

[quote]I'm not sure why this bothers you because it is the normal Windows Installer behavior[/quote]

The reason why this is of concern for us, is we are telling our customer to close down un-related programs, and we feel this is a kind of un-professional, and we should be able to do better. Asking our customer to close outlook, ie, and visual studio 2005, which has no relevance to our product, seems really wrong.

Cheers
Jason
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Close applications dialog

Hi,
So is there a way to stop the services before this check is done?
This could be done by using the StopService method in a VBScript custom action.

However, this will not work on Vista because the custom action needs to be "Deferred with no impersonation" (it cannot be Immediate like on XP). Deferred custom actions can be scheduled only after the "InstallInitialize" standard action and the "FilesInUse" check is performed during the "InstallValidate" standard action (which comes before "InstallInitialize").

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”