cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Snoopstah
Level 7

Finish dialog "hidden" with add/remove

Uninstall my app by
1. Go to add/remove programs
2. Select application and click Uninstall
3. When it finishes uninstallation the "finish" window hides behind the main add/remove window

Findings:
This also happens in other situations, e.g when doing a new installation , at the end the "finish" window hides behind any other window which might be open at that time.
This can be avoided by not having any other windows open but the Add/Remove main window cannot be closed till user has clicked "Finish" on the final window of the uninstallation.

Why is this happening and how can I resolve it. I have a MSI InstallScript project.
Labels (1)
0 Kudos
(1) Reply
Snoopstah
Level 7

to post the solution in case anyone else needs to know:

My OnBegin script contains the following to prevent the "browse" dialog losing foucs on Destination Folder selection.

hMain = GetWindowHandle( HWND_INSTALL );
SetWindowLong( hMain, GWL_STYLE, GetWindowLong( hMain,GWL_STYLE ) | WS_OVERLAPPEDWINDOW );
SetWindowPos( hMain, 0, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_HIDEWINDOW );


That code is what caused the finish dialog to lose focus.
To prevent that from happening the following is added in OnFirstUIAfter (or whereever your finish dialog is caleld)


Disable(INDVFILESTATUS);


Also, the actual dialog's need to be edited (SdFinish and SdFinishReboot). Change the windows style to include [DS_SETFOREGROUND]
0 Kudos