-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_iric_install.py
109 lines (91 loc) · 3.64 KB
/
run_iric_install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# run_iric_install.py
import pyautogui, sys, time
import subprocess
import os
import tkinter as tk
def capture_and_push_artifact(path):
pyautogui.screenshot(path)
if os.environ.get('APPVEYOR') is not None:
subprocess.call("appveyor PushArtifact " + path)
return
# left = location[0]; top = location[1]; width = location[2]; height = location[3]
LEFT = 0
TOP = 1
WIDTH = 2
HEIGHT = 3
pyautogui.FAILSAFE = False
# place mouse on screen to start iRIC (if multiple screens)
pyautogui.moveTo(1, 1)
# verify resolution
screenWidth, screenHeight = pyautogui.size()
print("Screen resolution: {}x{}".format(screenWidth, screenHeight))
# minimize everything
pyautogui.hotkey('win', 'm')
time.sleep(3.0)
capture_and_push_artifact("iRIC-Install-00.png") # desktop
# start iRIC install
subprocess.Popen("iRIC_Installer_" + os.environ['RELEASE'] + "_" + os.environ['SHA1'] + ".exe")
time.sleep(90.0)
capture_and_push_artifact("iRIC-Install-01.png") # Setup
# click next
nextButton = pyautogui.locateCenterOnScreen('iRIC_Installer-NextButton-2012.png')
if nextButton is None:
print("Didn't locate iRIC_Installer-NextButton-2012.png")
sys.exit(1)
pyautogui.moveTo(nextButton) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(nextButton)
time.sleep(1.0)
capture_and_push_artifact("iRIC-Install-02.png") # InstallationFolder
# copy installer location
pyautogui.hotkey('ctrl', 'a')
time.sleep(0.5)
pyautogui.hotkey('ctrl', 'c')
r = tk.Tk()
# keep the window from showing
r.withdraw()
# text from clipboard
install_location = r.clipboard_get()
print("Installation Folder:", install_location)
# click next
pyautogui.moveTo(nextButton) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(nextButton)
time.sleep(1.0)
capture_and_push_artifact("iRIC-Install-03.png") # SelectComponents
# click next
pyautogui.moveTo(nextButton) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(nextButton)
time.sleep(1.0)
capture_and_push_artifact("iRIC-Install-04.png") # LicenseAgreement
# click agree
acceptRadio = pyautogui.locateCenterOnScreen('iRIC_Installer-AcceptRadio-2012.png')
if acceptRadio is None:
print("Didn't locate iRIC_Installer-AcceptRadio-2012.png")
sys.exit(2)
pyautogui.moveTo(acceptRadio) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(acceptRadio)
time.sleep(1.0)
capture_and_push_artifact("iRIC-Install-05.png") # LicenseAgreementAccept
# click next
pyautogui.moveTo(nextButton) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(nextButton)
time.sleep(1.0)
capture_and_push_artifact("iRIC-Install-06.png") # StartMenushortcuts
# click next
pyautogui.moveTo(nextButton) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(nextButton)
time.sleep(1.0)
capture_and_push_artifact("iRIC-Install-07.png") # ReadytoInstall
# click Install
pyautogui.moveTo(nextButton) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(nextButton)
time.sleep(360.0)
capture_and_push_artifact("iRIC-Install-08.png") # Finished
# click Finish
finishButton = pyautogui.locateCenterOnScreen('iRIC_Installer-FinishButton-2012.png')
if finishButton is None:
print("Didn't locate iRIC_Installer-FinishButton-2012.png")
sys.exit(3)
pyautogui.moveTo(finishButton) # this might not be necessary (needs further testing - at least for iric installers)
pyautogui.click(finishButton)
time.sleep(1.0)
capture_and_push_artifact("iRIC-Install-09.png") # Done