From 90e1f5ddb02ec3b3b64400f660ac5f3b109dd349 Mon Sep 17 00:00:00 2001 From: Andrew Krug Date: Tue, 28 Feb 2017 09:29:02 -0500 Subject: [PATCH 1/2] Update windows_install.bat setting the get tools location for chocolately within path --- windows_install.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows_install.bat b/windows_install.bat index 046f7ea..badd45b 100644 --- a/windows_install.bat +++ b/windows_install.bat @@ -9,4 +9,4 @@ choco install phantomjs -y choco install selenium-all-drivers -y choco install jdk8 -y choco install maven -y -SETX PATH "%PATH%;C:\tools\selenium" \ No newline at end of file +SETX PATH "%PATH%;%ChocolateyToolsLocation%" From 1429e1fb04d1815aec83990508eac374e354ad74 Mon Sep 17 00:00:00 2001 From: Andrew Krug Date: Sun, 5 Mar 2017 09:26:31 -0500 Subject: [PATCH 2/2] Update windows_install.bat adding in elevating to admin so that the gettools env is set system wide thus usable --- windows_install.bat | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/windows_install.bat b/windows_install.bat index badd45b..80ac762 100644 --- a/windows_install.bat +++ b/windows_install.bat @@ -1,7 +1,22 @@ -@echo off -title Setting up your machine for Selenium Testing! + @echo off + title Setting up your machine for Selenium Testing! + call :isAdmin -@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" + if %errorlevel% == 0 ( + goto :run + ) else ( + echo Requesting administrative privileges... + goto :UACPrompt + ) + + exit /b + + :isAdmin + fsutil dirty query %systemdrive% >nul + exit /b + + :run + @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" choco install firefox -y choco install googlechrome -y @@ -10,3 +25,14 @@ choco install selenium-all-drivers -y choco install jdk8 -y choco install maven -y SETX PATH "%PATH%;%ChocolateyToolsLocation%" + + exit /b + + :UACPrompt + echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + echo UAC.ShellExecute "cmd.exe", "/c %~s0 %~1", "", "runas", 1 >> "%temp%\getadmin.vbs" + + "%temp%\getadmin.vbs" + del "%temp%\getadmin.vbs" + exit /B` +