Search code examples
windowsvisual-studio-2010installationsetup-project

MessageBox.Show is not modal in the setup project


I have a VS2010 setup project, and one of it's uninstall custom actions shows notifications using MessageBox.Show method, but they sometimes appear to be behind the setup wizard window, which is totally unacceptable. Is there a way to show them on top of the wizard, maybe make them modal? Or should I create custom windows if it is impossible to show message boxes in a always-on-top or modal way? I am not specifying any owners in the messagebox.show method. The custom action calls a method of a class inside dll, not exe file. I tried to find the process with name "msiexec" and mainwindowtitle == my setup project wizard window title, but in case of uninstall both processes just don't have any window titles and handles, although the uninstall window is displayed!


Solution

  • I should use MessageBoxOptions.DefaultDesktopOnly in the MessageBox.Show method.