@@ -12,9 +12,24 @@ cd %ROOTPATH%
1212
1313@ REM Build WinPython distribution
1414@ REM ===========================================================================
15- " C:\Program Files\7-Zip\7z.exe" x -y -o" ." " %CI_WPI% "
16- call " %CI_WNM% \scripts\env_for_icons.bat" %*
17- cd %CI_WNM%
15+
16+ @ REM Extract WinPython distribution
17+ if not exist " %ROOTPATH% \dist" ( mkdir " %ROOTPATH% \dist" )
18+ if exist " %ROOTPATH% \dist\%CI_DST% " ( rmdir /s /q " %ROOTPATH% \dist\%CI_DST% " )
19+
20+ @ REM Rename extracted folder to %CI_DST%
21+ if not exist " .\tmp" ( mkdir " .\tmp" )
22+ " C:\Program Files\7-Zip\7z.exe" x -y -o" .\tmp" " %CI_WPI% "
23+ for /D %%I in (.\tmp\*) do set WP_FOLDER = %%~nxI
24+ pushd " .\tmp"
25+ ren %WP_FOLDER% %CI_DST%
26+ popd
27+ move " .\tmp\%CI_DST% " " %ROOTPATH% \dist\"
28+ rmdir /S /Q " .\tmp"
29+
30+ @ REM Customize WinPython distribution
31+ call " %ROOTPATH% \dist\%CI_DST% \scripts\env_for_icons.bat" %*
32+ cd %ROOTPATH% \dist\%CI_DST%
1833del IPython*.exe
1934del Jupyter*.exe
2035del Pyzo.exe
@@ -37,10 +52,10 @@ set NSIS_WORKDIR=$EXEDIR\scripts
3752set NSIS_COMMAND = wscript.exe
3853for %%f in (executables\*.bat) do (
3954 @ REM Copy each .bat file to the "scripts" folder:
40- copy " executables\%%~nxf " " %ROOTPATH% \%CI_WNM % \scripts"
55+ copy " executables\%%~nxf " " %ROOTPATH% \dist\ %CI_DST % \scripts"
4156 @ REM Set NSIS_ICON, NSIS_OUTFILE and NSIS_PARAMS for each .bat file:
4257 set NSIS_ICON = %ROOTPATH% \executables\%%~nf .ico
43- set NSIS_OUTFILE = %ROOTPATH% \%CI_WNM % \%%~nf .exe
58+ set NSIS_OUTFILE = %ROOTPATH% \dist\ %CI_DST % \%%~nf .exe
4459 set NSIS_PARAMS = Noshell.vbs %%~nxf
4560 " C:\Program Files (x86)\NSIS\makensis.exe" nsis\launcher.nsi
4661)
0 commit comments