From ad7dce2f5a3cb80ae562baef6c4dfdae22b3889e Mon Sep 17 00:00:00 2001 From: CorpNewt Date: Thu, 14 Mar 2019 13:09:32 -0500 Subject: [PATCH] Prompt to install python --- gibMacOS.bat | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/gibMacOS.bat b/gibMacOS.bat index 3cf565a..b84c5e9 100644 --- a/gibMacOS.bat +++ b/gibMacOS.bat @@ -5,6 +5,7 @@ REM Setup initial vars set "script_name=%~n0.command" set "thisDir=%~dp0" set /a tried=0 +set "toask=yes" goto checkscript @@ -30,7 +31,12 @@ FOR /F "tokens=* USEBACKQ" %%F IN (`where python 2^> nul`) DO ( REM Check for py and give helpful hints! if /i "!python!"=="" ( if %tried% lss 1 ( - goto installpy + if /i "!toask!"=="yes" ( + REM Better ask permission first + goto askinstall + ) else ( + goto installpy + ) ) else ( cls echo ### ### @@ -53,6 +59,26 @@ if /i "!python!"=="" ( ) goto runscript +:askinstall +cls +echo ### ### +echo # Python Not Found # +echo ### ### +echo. +echo Python was not found on the system or in the PATH var. +echo. +set /p "menu=Would you like to install it now? [y/n]: " +if /i "!menu!"=="y" ( + REM We got the OK - install it + goto installpy +) else if "!menu!"=="n" ( + REM No OK here... + set /a tried=%tried%+1 + goto checkpy +) +REM Incorrect answer - go back +goto askinstall + :installpy REM This will attempt to download and install python REM First we get the html for the python downloads page for Windows