stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

How is Files in Use determined - can it be overridden?

I am working on an upgrade scenario where my app is already running. I want to avoid killing the process with brute force, because it lacks certain clean-up.

The app is .NET app. It normally runs without a visible top-level window, but it has a displayable configuration window.

Being a single-instance app, I can handle the case where the newly installed version starts (and automatically exits) and then gracefully restart the running instance. Since the new executable has been installed, such restarting effectively starts the new version. This seems to work fine.

But when my app has a window open on the desktop, for some reason AI then detects my executable as "in use", and displays the FilesInUse dialog.

So many questions:
- Why does AI consider the exe "in use" when it has a visible window, and not otherwise?
- How is AI able to successfully overwrite the exe in either case, while my app is running?
- How does AI determine that the exe is "in use"?
- Can AI's "file in use" function be controlled, modified, disabled?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Re: How is Files in Use determined - can it be overridden?

Hi,
- Why does AI consider the exe "in use" when it has a visible window, and not otherwise? - How is AI able to successfully overwrite the exe in either case, while my app is running?
- How does AI determine that the exe is "in use"?
This is fully controlled by Windows Installer, the "FilesInUse" dialog is displayed to the user if files that need overwrite are in use (this is done to avoid a system reboot). If you choose to ignore, the files will be overwrite after a system reboot (not immediately).
- Can AI's "file in use" function be controlled, modified, disabled?
I'm afraid "FilesInUse" is managed automatically by Windows Installer, but on Windows Vista you can use the Restart Manager Windows Installer 4.0 feature. This allows you to automatically restart your application avoiding a system reboot. Read more about Restart Manager and how to use it in Advanced Installer here:
http://www.advancedinstaller.com/user-g ... nager.html

Also if you upgrade you application through Advanced Installer Updater you can use the "Auto Close Application" feature:
http://www.advancedinstaller.com/user-g ... ialog.html

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: How is Files in Use determined - can it be overridden?

In my scenario, if I choose Ignore, I get the FilesInUse dialog a second time. If I then choose Ignore again, the exe is deleted and replaced with the new version, while the app is running.

Again, this is a .NET app.

Likewise, uninstall also works when my app is running, completely removing the installation files without disturbing the running app. Like the installation scenario, the FileInUse dialog appears my app is showing a top-level window.

Since AI provides the FilesInUse dialog, is it possible to configure my AI project to automatically Ignore?
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: How is Files in Use determined - can it be overridden?

I am attempting to skirt this issue by closing the app before the FilesInUse check is performed: http://www.advancedinstaller.com/forums ... f=2&t=8339
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: How is Files in Use determined - can it be overridden?

Hi,
Since AI provides the FilesInUse dialog, is it possible to configure my AI project to automatically Ignore?
Although the "FilesInUse" dialog can be customized in Advanced Installer, it is handled automatically by Windows Installer. Therefore, you cannot configure it to automatically use the "Ignore" option.

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

Return to “Common Problems”