Changeset 1cecc91 in sasview for build_tools
- Timestamp:
- Aug 18, 2016 7:37:27 AM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 250fec92
- Parents:
- e68c9bf
- git-author:
- Piotr Rozyczko <rozyczko@…> (08/18/16 07:36:55)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (08/18/16 07:37:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
build_tools/sasview_deploy_test.au3
r6bb4edd r1cecc91 6 6 ; 7 7 ; 0 - OK 8 ; 1 - Installer failure 9 ; 2 - Problems running SasView (simple fitting) 10 ; 3 - Uninstaller failure 8 ; 1 - Download failure 9 ; 2 - Installer failure 10 ; 3 - Problems running SasView (simple fitting) 11 ; 4 - Uninstaller failure 11 12 12 13 #include <Constants.au3> 13 14 #include <FileConstants.au3> 14 15 #include <MsgBoxConstants.au3> 16 #include <InetConstants.au3> 15 17 #include <WinAPIFiles.au3> 16 18 … … 19 21 20 22 ; Modifiable globals 21 Global $fInstallerLocation = "C:\util\setupSasView.exe" 23 if $CmdLine[0] == 0 Then 24 ; Expected command line with the build number as argument 25 Exit (-1) 26 EndIf 27 28 Local $lBuildNumber = $CmdLine[1] 29 ;Global $fInstallerLocation = "C:\util\setupSasView.exe" ; debug and testing location 30 Global $fInstallerLocation = @TempDir & "\setupSasView.exe" 31 Global $fRemoteInstallerLocation = "https://jenkins.esss.dk/sasview/job/SasView_Win7_Test/" & $lBuildNumber & "/artifact/sasview/dist/setupSasView.exe" 32 Global $fUninstallerLocation = "C:\Program Files (x86)\SasView\unins000.exe" 22 33 Global $lTimeout = 10 ; 10 sec timeout for waiting on windows 23 34 Global $lInstallTimeout = 120 ; 2 min timeout for the installation process … … 28 39 29 40 ;; MAIN SCRIPT 41 Download() 30 42 Install() 31 43 RunSasView() 32 44 Uninstall() 45 33 46 Exit(0) 34 47 35 48 ;============================================================== 49 Func Download() 50 ; Download the file in the background with the selected option of 'force a reload from the remote site.' 51 ConsoleWrite("Downloading...." & @CRLF) 52 Local $iFailFlag = 1 53 Local $hDownload = InetGet($fRemoteInstallerLocation, $fInstallerLocation, $INET_FORCERELOAD) 54 55 ; Close the handle returned by InetGet. 56 InetClose($hDownload) 57 Assert($hDownload, $iFailFlag) 58 ConsoleWrite("Installer downloaded successfully to " & $fInstallerLocation & @CRLF) 59 60 EndFunc 61 36 62 Func Install() 37 63 ;;;;; APPLICATION INSTALLED ;;;;;;; 38 64 Local $sSetupWindow = "Setup - SasView" 39 65 Local $iFailFlag = 2 40 66 ; Run setup 41 67 if FileExists($fInstallerLocation) Then 42 68 $installerPID = Run($fInstallerLocation) 43 Assert($installerPID, 1)69 Assert($installerPID, $iFailFlag) 44 70 Sleep(1000) 45 71 Else 46 72 ;$Error = ObjEvent(AutoIt.Error, "Setup file does not exist","123") 47 Exit( 1)73 Exit($iFailFlag) 48 74 EndIf 49 75 50 76 ; License click through 77 WinActivate($sSetupWindow) ; <-- REQUIRED when connecting from another host 51 78 Local $test = WinWaitActive($sSetupWindow, "License Agreement", $lTimeout) 52 79 ;ConsoleWrite("license agreement: " & $test) 53 Assert($test, 1)80 Assert($test, $iFailFlag) 54 81 sleep(1000) 55 82 … … 59 86 Sleep(1000) 60 87 $test = WinWaitActive($sSetupWindow, "Select Destination Location", $lTimeout) 61 Assert($test, 1)88 Assert($test, $iFailFlag) 62 89 Send("{ENTER}") 63 90 … … 65 92 Sleep(1000) 66 93 $test = WinWaitActive($sSetupWindow, "Select Additional Tasks", $lTimeout) 67 Assert($test, 1)94 Assert($test, $iFailFlag) 68 95 Send("{ENTER}") 69 96 … … 71 98 Sleep(1000) 72 99 $test = WinWaitActive($sSetupWindow, "Ready to Install", $lTimeout) 73 Assert($test, 1)100 Assert($test, $iFailFlag) 74 101 Send("{ENTER}") 75 102 … … 77 104 Sleep(5000) 78 105 $test = WinWaitActive($sSetupWindow, "Completing the SasView Setup Wizard", $lInstallTimeout) 79 Assert($test, 1)106 Assert($test, $iFailFlag) 80 107 Send("{ENTER}") 81 108 ;ConsoleWrite("Installed" & @CRLF) … … 88 115 ; Start app - DEBUG ONLY 89 116 ;;Run("C:\Program Files (x86)\SasView\SasView.exe") 90 117 Local $iFailFlag = 2 91 118 ; Wait for the window 92 119 Sleep(1000) 93 120 Local $hWnd = WinWaitActive("SasView - Fitting -", "", $lTimeout) 94 Assert($hWnd, 2)121 Assert($hWnd, $iFailFlag) 95 122 96 123 ;;;;; Load a File … … 98 125 Send("!{f}{ENTER}") 99 126 WinWaitActive("Choose a file", "", $lTimeout) 100 Assert($hWnd, 2)127 Assert($hWnd, $iFailFlag) 101 128 Sleep(200) 102 129 … … 119 146 120 147 Local $hEnd = WinWaitActive("Confirm Exit", "", $lTimeout) 121 Assert($hEnd, 2)148 Assert($hEnd, $iFailFlag) 122 149 ControlClick($hEnd, "", "[CLASS:Button; INSTANCE:1]") 123 150 124 151 Local $sv_closed = WinWaitClose($hWnd, "", $lTimeout) 125 Assert($sv_closed, 2)152 Assert($sv_closed, $iFailFlag) 126 153 127 154 EndFunc … … 129 156 Func Uninstall() 130 157 ;;;;; UNINSTALL ;;;;;;; 131 $installerPID = Run("C:\Program Files (x86)\SasView\unins000.exe") 158 Local $iFailFlag = 3 159 $installerPID = Run($fUninstallerLocation) 160 Assert($installerPID, $iFailFlag) 132 161 133 162 Local $sSetupWindow = "SasView Uninstall" 134 163 135 164 Local $test = WinWaitActive($sSetupWindow, "", $lTimeout) 136 Assert($test, 3)165 Assert($test, $iFailFlag) 137 166 Send("{TAB}{ENTER}") 138 167 139 168 WinActivate("SasView Uninstal") 140 169 $test = WinWaitActive($sSetupWindow, "SasView was successfully removed", $lTimeout) 141 Assert($test, 3)170 Assert($test, $iFailFlag) 142 171 Send("{ENTER}") 143 172
Note: See TracChangeset
for help on using the changeset viewer.