Skip to content

Commit 3ebc88a

Browse files
authored
Add files via upload
1 parent 5aa788e commit 3ebc88a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

install-winpython-to-appdata.cmd

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

0 commit comments

Comments
 (0)