As Roing noted, pywinauto is a good choice for a Windows installer. Here is a good video example: http://pywinauto.imtqy.com/
To wait for the next page, use something like this: app.WizardPageTitle.wait('ready')
After installation is complete: app.FinishPage.wait_not('visible')
To enter in the input field: app.WizardPage.Edit.type_keys('some input path', with_spaces=True)
For button clicks, I would recommend click_input() as a more robust method.
If you want to install the application on many computers automatically, you can create a remote desktop or VNC session and run a local copy of the Python script inside that session. Just don't minimize the RDP or VNC window to prevent loss of GUI context. Loss of focus is safe, and you can continue to work on the host computer in a different window without affecting the remote installation.
An example of an easy installation script for FastStone Image Viewer 4.6:
import os from pywinauto.application import Application fsv = Application(backend="win32").start("FSViewerSetup46.exe") fsv.InstallDialog.NextButton.wait('ready', timeout=30).click_input() fsv.InstallDialog.IAgreeRadioButton.wait('ready', timeout=30).click_input() fsv.InstallDialog.Edit.Wait('ready', timeout=30).type_keys(os.getcwd() + "\FastStone Image Viewer", with_spaces=True) fsv.InstallDialog.InstallButton.wait('ready', timeout=30).click_input() fsv.InstallDialog.FinishButton.wait('ready', timeout=30).click_input()
source share