@@ -489,7 +489,7 @@ def _copy_documentation(self):
489489 self ._print_action_done ()
490490
491491
492- def _create_launchers (self ):
492+ def _copy_launchers (self ):
493493 """Copies pre-made launchers to the WinPython directory."""
494494 self ._print_action ("Creating launchers" )
495495 launchers_source_dir = PORTABLE_DIR / "launchers_final"
@@ -636,52 +636,6 @@ def _create_initial_batch_scripts(self):
636636"""
637637 self .create_batch_script ("WinPython_PS_Prompt.ps1" , ps1_content , replacements = batch_replacements )
638638
639-
640- env_for_icons_bat_content = r"""@echo off
641- call "%~dp0env.bat"
642-
643- rem default is as before: Winpython ..\Notebooks
644- set WINPYWORKDIR=%WINPYDIRBASE%\Notebooks
645- set WINPYWORKDIR1=%WINPYWORKDIR%
646-
647- rem if we have a file or directory in %1 parameter, we use that directory to define WINPYWORKDIR1
648- if not "%~1"=="" (
649- if exist "%~1" (
650- if exist "%~1\" (
651- rem echo it is a directory %~1
652- set WINPYWORKDIR1=%~1
653- ) else (
654- rem echo it is a file %~1, so we take the directory %~dp1
655- set WINPYWORKDIR1=%~dp1
656- )
657- )
658- ) else (
659- rem if it is launched from another directory than icon origin , we keep it that one echo %__CD__%
660- if not "%__CD__%"=="%~dp0" if not "%__CD__%scripts\"=="%~dp0" set WINPYWORKDIR1="%__CD__%"
661- )
662- rem remove potential doublequote
663- set WINPYWORKDIR1=%WINPYWORKDIR1:"=%
664- rem remove some potential last \
665- if "%WINPYWORKDIR1:~-1%"=="\" set WINPYWORKDIR1=%WINPYWORKDIR1:~0,-1%
666-
667- rem you can use winpython.ini to change defaults
668- FOR /F "delims=" %%i IN ('""%WINPYDIR%\python.exe" "%~dp0WinpythonIni.py""') DO set winpythontoexec=%%i
669- %winpythontoexec%set winpythontoexec=
670-
671-
672- rem Preventive Working Directories creation if needed
673- if not "%WINPYWORKDIR%"=="" if not exist "%WINPYWORKDIR%" mkdir "%WINPYWORKDIR%"
674- if not "%WINPYWORKDIR1%"=="" if not exist "%WINPYWORKDIR1%" mkdir "%WINPYWORKDIR1%"
675-
676- rem Change of directory only if we are in a launcher directory
677- if "%__CD__%scripts\"=="%~dp0" cd/D %WINPYWORKDIR1%
678- if "%__CD__%"=="%~dp0" cd/D %WINPYWORKDIR1%
679-
680- if not exist "%HOME%\.spyder-py%WINPYVER:~0,1%" mkdir "%HOME%\.spyder-py%WINPYVER:~0,1%"
681- if not exist "%HOME%\.spyder-py%WINPYVER:~0,1%\workingdir" echo %HOME%\Notebooks>"%HOME%\.spyder-py%WINPYVER:~0,1%\workingdir"
682- """
683- self .create_batch_script ("env_for_icons.bat" , env_for_icons_bat_content , replacements = batch_replacements )
684-
685639 self ._print_action_done ()
686640
687641
@@ -756,7 +710,7 @@ def build(self, remove_existing: bool = True, requirements=None, winpy_dirname:
756710 self ._create_initial_batch_scripts ()
757711 self ._copy_default_scripts ()
758712 self ._create_standard_batch_scripts ()
759- self ._create_launchers ()
713+ self ._copy_launchers ()
760714
761715 utils .python_execmodule ("ensurepip" , self .distribution .target ) # Ensure pip is installed for PyPy
762716 self .distribution .patch_standard_packages ("pip" )
0 commit comments