Last active
April 24, 2018 05:49
-
-
Save vasily-v-ryabov/7a04717af4584cbb840f to your computer and use it in GitHub Desktop.
Install script for 7zip 9.20 (64-bit)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: | |
# - Win7 or Win8.1 x64, 64-bit Python | |
# - pywinauto 0.5.2+ | |
# - 7z920-x64.msi is in the same folder as the script | |
# - UAC is fully disabled | |
from __future__ import print_function | |
import sys, os | |
os.chdir(os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]))) | |
import pywinauto | |
app = pywinauto.Application().Start(r'msiexec.exe /i 7z920-x64.msi') | |
Wizard = app['7-Zip 9.20 (x64 edition) Setup'] | |
Wizard.NextButton.Click() | |
Wizard['I &accept the terms in the License Agreement'].Wait('enabled').CheckByClick() | |
Wizard.NextButton.Click() | |
Wizard['Custom Setup'].Wait('enabled') | |
Wizard.NextButton.Click() | |
Wizard.Install.Click() | |
Wizard.Finish.Wait('enabled', timeout=30) | |
Wizard.Finish.Click() | |
Wizard.WaitNot('visible') | |
# final check | |
if os.path.exists(r"C:\Program Files\7-Zip\7zFM.exe"): | |
print('OK') | |
else: | |
print('FAIL') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment