File (Application) in use? - Advanced Installer Community
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

File (Application) in use?

Hello,

I am creating an installer for a Word add-in. If I am installing version 2 which means the version 1 is already installed, then we get the MsiRMFilesInUse dialog if the Microsoft Word is open indicating the previous add-in file is in use. However, if this is the first time installation and not the update, it does not show the MsiRMFilesInUse dialog to tell Microsoft Word is open since there is no add-in in use. However, although the add-in got registered the users needs to restart Word for the changes to take affect. Is there a way to show the MsiRMFilesInUse to indicate Word is open even if there is no file is use?

To put it simply, is there way to use the Restart Manager to close Word and re-open?

;)
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: File (Application) in use?

Hello,
To put it simply, is there way to use the Restart Manager to close Word and re-open?
Indeed, applications that use Windows Installer version 4.0 for installation and servicing on Windows Vista or above automatically use the Restart Manager to reduce system restarts. The default behavior on Windows Vista or above is to shut down applications rather than shut down and restart the operating system whenever possible.

You can take a look on the Windows Restart Manager article and on our How is Files in Use determined - can it be overridden? forum thread which may be useful to you.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: File (Application) in use?

Thanks for your help so far. Where is the Auto-Close Application Dialog (http://www.advancedinstaller.com/user-g ... ialog.html) in Advanced Installer?
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: File (Application) in use?

Hello,

The Auto-Close Application dialog can be found in the Auto Close Application tab from the Updates Configuration Project file.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: File (Application) in use?

Hello,

In the Updates Configuration Project file (http://www.advancedinstaller.com/user-g ... -page.html) it says "Use the [ New Update ] toolbar button". Where is it in the Advanced Installer. Is it in the Updater page?

:)
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: File (Application) in use?

Hi,

You start an Updates Configuration project by selecting Updates in the Start Page as it can be seen below:
UpdatesProj.jpg
UpdatesProj.jpg (99.55 KiB) Viewed 8827 times
Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: File (Application) in use?

Hello,

Thanks again as always. I like to auto-close an application on a normal installer and not the update. As explained earlier, when the installer detects that the Microsoft Word is open (this I know with the custom action), it needs to close and re-open just like the MsiRMFilesInUse dialog does. Only thing is there is no file in use. If Word is detected as running then I want the MsiRMFilesInUse to be shown with Word as running and when the user select an option do the necessary.

:)
K
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: File (Application) in use?

Hello again,

OK to simplify this, it is like this, when the installer detects that the Microsoft Word is running (AI_PROCESS_STATE = "Running", etc. I know this part) the installer needs to show the MsiRMFilesInUse dialog showing that Word is running. This works if there is a file that is being installed is used by Word. What I want is to show the dialog even when there is no file in use. If Word is running then show the dialog. Because, when the add-in is installed for the first time, Word needs to be restarted to take affect. If I do this through the CustomAction it either terminates Word loosing unsaved data or shows the Save As dialog and does not close.

:)
Last edited by Codename K on Fri Nov 15, 2013 2:34 pm, edited 1 time in total.
K
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: File (Application) in use?

Hello,

To make it even simpler, is there a way in Advanced Installer (may be through CustomAction) to register applications for a restart similar to the RegisterApplicationRestart (http://msdn.microsoft.com/en-us/library ... 85%29.aspx) function? If the application is registered like this then it will automatically show the MsiRMFilesInUse dialog.

:D
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: File (Application) in use?

Hello,

I'm afraid that this dialog ("FilesInUse" on XP and "MsiRMFilesInUse" on Vista) is managed automatically by Windows Installer during the InstallValidate standard action when the installer checks if any file is in use and if so, it displays that dialog.

What you can do is to display message box custom action after the Detect process to warn the user to save and close the Microsoft Word application.
Also you can condition the execution of the custom action which display the message through the Condition field from its properties :
You can have something like:

Code: Select all

AI_PROCESS_STATE = "Running"

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: File (Application) in use?

OK Thanks.

:D
K
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: File (Application) in use?

You're welcome.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”