首页 > 解决方案 > 使用 python 脚本安装程序

问题描述

我正在尝试编写一个在 Windows 上下载和安装 notepad++ 的脚本,不幸的是,我找不到自动安装 notepad++ 的方法。我用了:

from pywinauto.application import Application
fsv =Application(backend="uia").start("notepad++.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() + "\Notepad++", with_spaces=True)
fsv.InstallDialog.InstallButton.wait('ready', timeout=30).click_input()
fsv.InstallDialog.FinishButton.wait('ready', timeout=30).click_input()

标签: python-3.xinstallationpywinauto

解决方案


推荐阅读