Commit 65959e4c by Csók Tamás

Added checking for registry trash

parent 51ae3a0b
......@@ -22,8 +22,8 @@ SET "website="
IF NOT "%3"=="" (
IF "%install_selenium%"=="False" (
SET site=%3
SET site=!site:"=!
SET "website= -t ^"!site!^""
SET my_site=!site:"=!
SET "website= -t ^"!my_site!^""
)
)
......@@ -40,7 +40,8 @@ if '%errorlevel%' NEQ '0' (
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "cmd.exe", "/c %~s0 !output_on_screen! !install_selenium! ^"!site!^"", "", "runas", 1 >> "%temp%\getadmin.vbs"
set vbs_site=!site:"=""!
echo UAC.ShellExecute "cmd.exe", "/c %~s0 !output_on_screen! !install_selenium! !vbs_site!", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
......@@ -153,10 +154,18 @@ IF NOT "!output_on_screen!"=="False" (
for /f "tokens=2,*" %%a in ('reg query "hklm\SOFTWARE\%python_registry%Python\PythonCore\%version%\InstallPath"') do (
set install_path=%%b
)
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 "!output_on_screen!"=="False" (
@echo %version% Python was installed but it is NOT now. Restarting the search for python^^!
)
goto loop
) else (
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%" & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to local PATH))
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%" & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to local PATH))
)
GOTO PIP_CHECK
......
......@@ -22,8 +22,8 @@ SET "website="
IF NOT "%3"=="" (
IF "%install_selenium%"=="False" (
SET site=%3
SET site=!site:"=!
SET "website= -t ^"!site!^""
SET my_site=!site:"=!
SET "website= -t ^"!my_site!^""
)
)
......@@ -40,7 +40,8 @@ if '%errorlevel%' NEQ '0' (
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "cmd.exe", "/c %~s0 !output_on_screen! !install_selenium! ^"!site!^"", "", "runas", 1 >> "%temp%\getadmin.vbs"
set vbs_site=!site:"=""!
echo UAC.ShellExecute "cmd.exe", "/c %~s0 !output_on_screen! !install_selenium! !vbs_site!", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
......@@ -153,10 +154,18 @@ IF NOT "!output_on_screen!"=="False" (
for /f "tokens=2,*" %%a in ('reg query "hklm\SOFTWARE\%python_registry%Python\PythonCore\%version%\InstallPath"') do (
set install_path=%%b
)
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 "!output_on_screen!"=="False" (
@echo %version% Python was installed but it is NOT now. Restarting the search for python^^!
)
goto loop
) else (
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%" & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to local PATH))
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%" & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to local PATH))
)
GOTO PIP_CHECK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment