|
|
@ -1,33 +1,56 @@ |
|
|
@echo off |
|
|
@echo off |
|
|
|
|
|
|
|
|
|
|
|
REM set up parent and current directory constants |
|
|
for %%d in (%~dp0.) do set Directory=%%~fd |
|
|
for %%d in (%~dp0.) do set Directory=%%~fd |
|
|
|
|
|
|
|
|
for %%d in (%~dp0..) do set ParentDirectory=%%~fd |
|
|
for %%d in (%~dp0..) do set ParentDirectory=%%~fd |
|
|
|
|
|
|
|
|
for /f "usebackq tokens=*" %%a in (`dir /B installer`) do ( |
|
|
|
|
|
set setup=installer\%%a |
|
|
|
|
|
|
|
|
REM find installer |
|
|
|
|
|
for /f "usebackq tokens=*" %%a in (`dir /B "%Directory%\install" ^| findstr /r /i "\.exe$"`) do ( |
|
|
|
|
|
set setup="%%a" |
|
|
goto skipA |
|
|
goto skipA |
|
|
) |
|
|
) |
|
|
:skipA |
|
|
:skipA |
|
|
REM set Directory=%~dp0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REM run installer |
|
|
|
|
|
move "%Directory%\install\%setup%" "%Directory%\%setup%" |
|
|
"%Directory%\%setup%" |
|
|
"%Directory%\%setup%" |
|
|
REM set winpython=%%a |
|
|
|
|
|
|
|
|
move "%Directory%\%setup%" "%Directory%\install\%setup%" |
|
|
|
|
|
|
|
|
|
|
|
REM find winpython dir |
|
|
for /f "usebackq tokens=*" %%a in (`dir /A:D /B ^| findstr /r /i w.*py.*`) do ( |
|
|
for /f "usebackq tokens=*" %%a in (`dir /A:D /B ^| findstr /r /i w.*py.*`) do ( |
|
|
set winpython=%%a |
|
|
set winpython=%%a |
|
|
goto skipB |
|
|
goto skipB |
|
|
) |
|
|
) |
|
|
:skipB |
|
|
:skipB |
|
|
set winpython="%Directory%\%winpython%" |
|
|
|
|
|
for /f "usebackq tokens=*" %%a in (`dir /A:D /B %winpython% ^| findstr /r /i python.*`) do ( |
|
|
|
|
|
|
|
|
set winpython=%Directory%\%winpython% |
|
|
|
|
|
|
|
|
|
|
|
REM find python binary dir |
|
|
|
|
|
for /f "usebackq tokens=*" %%a in (`dir /b "%winpython%" ^| findstr /r /i "python-[0-9]\.[0-9]\.[0-9]"`) do ( |
|
|
set exe=%%a |
|
|
set exe=%%a |
|
|
goto skipC |
|
|
goto skipC |
|
|
) |
|
|
) |
|
|
:skipC |
|
|
:skipC |
|
|
workers\path_append "%winpython%\%exe%" |
|
|
|
|
|
set exe="%winpython%\%exe%\python.exe" |
|
|
|
|
|
|
|
|
set pa="%Directory%\workers\path_append.bat" |
|
|
|
|
|
REM python setup |
|
|
|
|
|
set PATH="%winpython%\%exe%";%PATH% |
|
|
setx winpython %winpython% |
|
|
setx winpython %winpython% |
|
|
|
|
|
python -m pip install -r "%Directory%\google_api_wrapper\requirements.txt" |
|
|
|
|
|
|
|
|
|
|
|
REM adding path_append.bat to user script dir |
|
|
|
|
|
echo:@echo off > "%Directory%\ua-path\path_append.bat" |
|
|
|
|
|
echo:"%Directory%\workers\path_append.bat" %%1 >> "%Directory%\ua-path\path_append.bat" |
|
|
|
|
|
|
|
|
|
|
|
REM adding user script dir to path |
|
|
|
|
|
|
|
|
|
|
|
REM idle settings |
|
|
md "%winpython%\settings\.idlerc" |
|
|
md "%winpython%\settings\.idlerc" |
|
|
copy config-highlight.cfg %winpython%\settings\.idlerc |
|
|
|
|
|
|
|
|
copy config-highlight.cfg "%winpython%\settings\.idlerc" |
|
|
|
|
|
|
|
|
|
|
|
REM notepad++ settings |
|
|
md "%appdata%\Notepad++\themes" |
|
|
md "%appdata%\Notepad++\themes" |
|
|
copy themes "%appdata%\Notepad++\themes" |
|
|
copy themes "%appdata%\Notepad++\themes" |
|
|
"%exe%" -m pip install -r %Directory%\google_api_wrapper\requirements.txt |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REM append to PATH |
|
|
|
|
|
call %pa% "%winpython%\%exe%" |
|
|
|
|
|
call %pa% "%winpython%\%exe%\Scripts" |
|
|
|
|
|
call %pa% "%Directory%\ua-path" |
|
|
|
|
|
:end |