rem We have Python but let's check if it's in the PATH
rem We have Python but let's check if it's in the PATH
:HASPYTHON
:HASPYTHON
IF NOT "!output_on_screen!"=="False" (
IF NOT "!output_on_screen!"=="False" (
@echo %version% Python is found, checking PATH variable
@echo %version% Python is found, checking PATH variable>CON
)
)
@echo %version% Python is found, checking PATH variable
rem Check Python install path
rem Check Python install path
set install_path=
set install_path=
for /f "tokens=2,*" %%a in ('reg query "hklm\SOFTWARE\%python_registry%Python\PythonCore\%version%\InstallPath"') do (
for /f "tokens=2,*" %%a in ('reg query "hklm\SOFTWARE\%python_registry%Python\PythonCore\%version%\InstallPath"') do (
...
@@ -161,58 +180,66 @@ IF NOT "!output_on_screen!"=="False" (
...
@@ -161,58 +180,66 @@ IF NOT "!output_on_screen!"=="False" (
rem Check whether python.exe is in the install path (python uninstall doesn't delete registry entrys)
rem Check whether python.exe is in the install path (python uninstall doesn't delete registry entrys)
if NOT EXIST "%install_path%python.exe" (
if NOT EXIST "%install_path%python.exe" (
IF NOT "!output_on_screen!"=="False" (
IF NOT "!output_on_screen!"=="False" (
@echo %version% Python was installed but it is NOT now. Restarting the search for python^^!
@echo %version% Python was installed but it is NOT now. Restarting the search for python^^!>CON
)
)
@echo %version% Python was installed but it is NOT now. Restarting the search for python^^!
goto loop
goto loop
) else (
) else (
set test=%install_path:~0,-1%
set test=%install_path:~0,-1%
call ^"%running_directory%inPath^" ^"test^" && (IF NOT "!output_on_screen!"=="False" (@echo !test! is already in PATH)) || (call ^"%running_directory%addPath^" ^"test^" & setx>nul PATH "%PATH%;!test!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !test! set to PATH))
call ^"%running_directory%inPath^" ^"test^" && (IF NOT "!output_on_screen!"=="False" (@echo !test! is already in PATH>CON) && @echo !test! is already in PATH) || (call ^"%running_directory%addPath^" ^"test^" & setx>nul PATH "%PATH%;!test!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !test! set to PATH>CON) && @echo !test! set to PATH)
set test=%install_path%Scripts
set test=%install_path%Scripts
call ^"%running_directory%inPath^" ^"test^" && (IF NOT "!output_on_screen!"=="False" (@echo !test! is already in PATH)) || (call ^"%running_directory%addPath^" ^"test^" & setx>nul PATH "%PATH%;!test!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !test! set to PATH))
call ^"%running_directory%inPath^" ^"test^" && (IF NOT "!output_on_screen!"=="False" (@echo !test! is already in PATH>CON) && @echo !test! is already in PATH) || (call ^"%running_directory%addPath^" ^"test^" & setx>nul PATH "%PATH%;!test!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !test! set to PATH>CON) && @echo !test! set to PATH)
)
)
GOTO PIP_INSTALL
GOTO PIP_INSTALL
:INSTALL_EASY_INSTALL
:INSTALL_EASY_INSTALL
IF NOT "!output_on_screen!"=="False" (
IF NOT "!output_on_screen!"=="False" (
@echo Failed. Commencing installation of easy_install
@echo Failed. Commencing installation of easy_install>CON
for /f tokens^=3^ delims^=^" %%B in ('type "%Temp%\BROW5.reg" ^| find "@"') do (
set "default=%%B"
rem removing double slashes
set "default=!default:\\=\!"
rem removing end slash
set "default=!default:~0,-1!"
rem get the name
for %%D in ("!default!") do (
call :SUB_DEFAULTBROWSER %%~nD
)
)
del /Q /F "%Temp%\BROW5.reg"
)
) else (
rem Registry location depends of the architecture
if "!architecture!"=="64" (
set "browser_architect=Wow6432Node\"
set "architecture_name=x64"
) else (
if "!architecture!"=="32" (
set "browser_architect="
set "architecture_name=x86"
) else (
GOTO ERR
)
)
rem Registry names for the different browsers out there
if "!browserToUse!"=="firefox" (
set "browser_path_name=FIREFOX.EXE"
set "selenium_driver_name="
)
if "!browserToUse!"=="chrome" (
set "browser_path_name=Google Chrome"
set "selenium_driver_name=chromedriver.exe"
)
if "!browserToUse!"=="iexplore" (
set "browser_path_name=IEXPLORE.EXE"
set "selenium_driver_name=IEDriverServer.exe"
)
rem Opera have to versions (in the registry) Opera and OperaStable, we try to Stable first
if "!browserToUse!"=="opera" (
set "browser_path_name=OperaStable"
set "selenium_driver_name="
)
set "browser_path="
IF NOT "!output_on_screen!"=="False" (
@echo Check if !browserToUse!.exe is in PATH
)
:get_browser_path
set browser_path=
set query="hklm\SOFTWARE\%browser_architect%Clients\StartMenuInternet\%browser_path_name%\shell\open\command"
reg>nul query %query% 2>nul
if ERRORLEVEL 1 (
if "%browser_path%"=="" (
if "%browser_architect%"=="" (
rem If the Stable failed check out the simple Opera
if "%browser_path_name%"=="OperaStable" (
SET "browser_path_name=Opera"
SET "browser_architect=Wow6432Node\"
goto get_browser_path
)
IF NOT "!output_on_screen!"=="False" (
@echo Location not found^^! Please add !browserToUse!.exe to PATH manually
pause
)
goto install_driver
) else (
set "browser_architect="
goto get_browser_path
)
)
)
rem Get the installation path for the selected browser
for /f "tokens=2,*" %%a in ('reg query %query%') do (
set browser_path=%%b
)
set browser_path=%browser_path:"=%
call :Split "%browser_path%" test
set myTest=!test:~0,-1!
rem Set that path in the PATH environment variable
call ^"%running_directory%inPath^" ^"myTest^" && (IF NOT "!output_on_screen!"=="False" ( @echo !myTest! is already in PATH)) || (call ^"%running_directory%addPath^" ^"myTest^" & setx>nul PATH "%PATH%;!myTest!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !myTest! set to PATH) )
:install_driver
IF NOT "%install_selenium%"=="False" (
if NOT "!selenium_driver_name!"=="" (
@echo Installing the !browserToUse! Selenium driver
call ^"%running_directory%inPath^" ^"install_location^" && (IF NOT "!output_on_screen!"=="False" ( @echo !install_location! is already in PATH)) || (call ^"%running_directory%addPath^" ^"install_location^" & setx>nul PATH "%PATH%;!install_location!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !install_location! set to PATH))
call ^"%running_directory%inPath^" ^"install_location^" && (IF NOT "!output_on_screen!"=="False" ( @echo !install_location! is already in PATH>CON) && @echo !install_location! is already in PATH) || (call ^"%running_directory%addPath^" ^"install_location^" & setx>nul PATH "%PATH%;!install_location!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !install_location! set to PATH>CON) && @echo !install_location! set to PATH)
if not exist "%install_location%\" (
if not exist "%install_location%\" (
mkdir ^"%install_location%^"
mkdir ^"%install_location%^"
)
)
...
@@ -432,52 +275,41 @@ if not exist "%install_location%\.rdp\" (
...
@@ -432,52 +275,41 @@ if not exist "%install_location%\.rdp\" (