There’s AFAIK no general way to handle this. If you have an installer file, than it may have command line options like /q for quiet or --silent or something similar.
Have you tried using win_package with it yet?
What application are you trying to install?
I ran the installer and here’s its CLI options, start using the --silent option and give it a try. You can run the program itself with ansible.windows.win_command or pass the options to ansible.windows.win_package, like so: