File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ @ echo off
2+ pushd " %~dp0 "
3+
4+ set " INSTALLPATH = %localappdata% \autoactuary\WinPython"
5+
6+ REM Get the location of the Winpython installer
7+ set " PYINSTALLER = %~1 "
8+ IF " %PYINSTALLER% " equ " " FOR /F " delims=" %%i IN ('dir /b Winpython64-3.*.exe') DO set " PYINSTALLER = %%i "
9+
10+
11+ if " %PYINSTALLER% " equ " " (
12+ echo Script requirements
13+ echo 1. Winpython64-3*.exe must be in same directory as the script
14+ echo 2. Or installer location must be passed directly: `%~n0 [installer_path]`
15+ GOTO EOF-PAUSE
16+ )
17+
18+
19+ REM Ensure a clean instalation directory
20+ if exist " %INSTALLPATH% " rmdir /s /q " %INSTALLPATH% "
21+ mkdir " %INSTALLPATH% "
22+
23+
24+ Echo Extract WinPython files to " %INSTALLPATH% "
25+ call " %PYINSTALLER% " -y -o" %INSTALLPATH% "
26+
27+ REM Move files from extracted subdirectory to top-level directory
28+ set " WPy64 = "
29+ FOR /F " delims=" %%i IN ('dir /b " %INSTALLPATH% \WPy64-*" ') DO set " WPy64 = %INSTALLPATH% \%%i "
30+ if " %WPy64% " neq " " FOR /F " delims=" %%i IN ('dir /b " %WPy64% \*" ') DO move " %WPy64% \%%i " " %INSTALLPATH% \%%i "
31+
32+
33+ :EOF-PAUSE
34+ :EOF-PAUSE
35+ if /i " %comspec% /c %~0 " equ " %cmdcmdline:" =% " pause
You can’t perform that action at this time.
0 commit comments