You may try pywinauto to test it on Windows. Java part of the installer may require new "UIA" back-end which will be released in March. For early testing you may try the following steps:
- Install pyWin32 and comtypes by
pip install pypiwin32
and pip install comtypes
.
- Install UIA branch of pywinauto by
python setup.py install
.
Try the following code:
import pywinauto
pywinauto.backend.activate('uia')
app = pywinauto.Application().start('your_installer_path.exe')
app.ApproximateMainWindowName.Wait('ready', timeout=15)
app.ApproximateMainWindowName.PrintControlIdentifiers()
PrintControlIdentifiers
output is a hint for further steps. There are possible access names for the controls on the window. Only basic functionality like ClickInput()
and TypeKeys('something')
should work for now.
Available methods for the control can be advised here:
app.MainWindow.OKButton.WrapperObject(). # methods list can be displayed here in IDLE or Visual Studio Python Tools
app.MainWindow.OKButton.WrapperObject().ClickInput() # code for debugging
#app.MainWindow.OKButton.ClickInput() # it works the same way, for production code
Feel free to ask more help if something doesn't work.
Python scripts may require running as Administrator to have an access to the GUI. Or add manifest for python.exe with uiAccess="true"
.