Skip to content

Instantly share code, notes, and snippets.

@aristotll
Forked from vasily-v-ryabov/install_7zip.py
Created December 17, 2015 05:37
Show Gist options
  • Save aristotll/d6b5872588aff6f684ab to your computer and use it in GitHub Desktop.
Save aristotll/d6b5872588aff6f684ab to your computer and use it in GitHub Desktop.
Install script for 7zip 9.20 (64-bit)
# 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