npahucki
Posts: 6
Joined: Fri Feb 22, 2008 4:16 am
Contact: Yahoo Messenger

AutoClose not working properly on Windows XP

We have a java gui app which uses the native launcher. Our app resides in the system tray, so when you close the main window, the app does not close down. When the updater runs on Windows Vista, the main window is closed, AND you get a dialog asking you if it is ok to close down the the executable. On Windows XP however, the main window is closed, but the application keeps running in the tray, so the installer tell you that you must reboot the machine to complete the install.

Why is the behavior different on XP than on Vista? Is there anyway to get the same behavior on XP?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can try to create a dummy window which has the WS_CAPTION style set and an unique title. It will always be hidden and its responsibility will be to close the application by handling the WM_CLOSE message appropriately.

You can see a similar discussion here:
http://www.advancedinstaller.com/forums ... pplication

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
npahucki
Posts: 6
Joined: Fri Feb 22, 2008 4:16 am
Contact: Yahoo Messenger

I saw this work around already, but why should this be needed when it works just fine on Vista?
npahucki
Posts: 6
Joined: Fri Feb 22, 2008 4:16 am
Contact: Yahoo Messenger

Another interesting thing..on XP, if you install a newer version manually (i.e. not via the updater) the installer will warn you that some of the files that it needs to update are open. However, when using the updater, this does not happen at all, it just goes right ahead with the install, and then asks the user to reboot.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
why should this be needed when it works just fine on Vista?
When the Updater uses the Auto Close feature, it searches for the windows created by your application an closes them. In your case most likely your application is closed completely by Vista when the Updater closes the main window.
if you install a newer version manually (i.e. not via the updater) the installer will warn you that some of the files that it needs to update are open.
This is the normal behavior of Windows Installer. If you try to remove files which are currently in use, the "FilesInUse" dialog will be shown.
However, when using the updater, this does not happen at all, it just goes right ahead with the install, and then asks the user to reboot.
This is because of the way the Updater works. If an installation updates files which are currently in use, they will be actually updated only after a reboot (when they are not used anymore).

Please note that this works on Vista and not on XP because of some improvements in the Vista OS. Also, the Updater closes the visible windows of your application, not its process in the system tray (which is closed by Vista).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
npahucki
Posts: 6
Joined: Fri Feb 22, 2008 4:16 am
Contact: Yahoo Messenger

Thanks for the info. I implemented the workaround, but it falls down in one case, which is when our login dialog is up. The dialog is modal, so closing the hidden window fails to do anything. I'll live with it for now, but I really wish the updater knew how to kill a process instead of just closing a window.

Return to “Common Problems”