I'm assuming that you have a ruby script which is running an EXE installer program (via the system
call or similar), and the installer opens a popup message which can't be suppressed and prohibits the script from continuing.
If this is the case, then you could use the ruby Win32 API to call functions like EnumWindows and CloseWindow. Of course, they'd have to be run concurrently to the installer (but perhaps necessarily in a separate process, depending on ruby/win32 threading implementation details) and it would have to know how to identify the correct message box before attempting to close it.
Here's how I might hack it. Write a separate program named "CloseMsgBox.exe" which takes a single command-line argument which is the title of the MessageBox which it will close; the program will periodically call EnumWindows with a callback function which calls GetWindowText until it finds the target title and closes the window via CloseWindow. The outer Ruby script would first run this program in a separate thread via a system
call (or popen
, etc.) then exec
the installer. Once the installer opens the message box, the CloseMsgBox program will close it, so the installer will exit, CloseMsgBox will exit, and the outer Ruby script will exit.