@@ -249,18 +249,6 @@ def architecture_bits(self) -> int:
249249 return self .distribution .architecture
250250 return 64
251251
252- @property
253- def pre_path_entries (self ) -> list [str ]:
254- """Returns a list of PATH entries to prepend to the environment."""
255- return [
256- r"Lib\site-packages\PyQt5" ,
257- "" , # Python root directory
258- "DLLs" ,
259- "Scripts" ,
260- r"..\t" ,
261- rf"..\{ self .NODEJS_RELATIVE_PATH } " ,
262- ]
263-
264252 def create_installer_7zip (self , installer_type : str = ".exe" ):
265253 """Creates a WinPython installer using 7-Zip: ".exe", ".7z", ".zip")"""
266254 self ._print_action (f"Creating WinPython installer ({ installer_type } )" )
@@ -324,24 +312,12 @@ def _create_initial_batch_scripts(self):
324312 """Creates initial batch scripts, including environment setup."""
325313 self ._print_action ("Creating initial batch scripts" )
326314
327- path_entries_string = ";" .join ([rf"%WINPYDIR%\{ path } " for path in self .pre_path_entries ])
328- full_path_environment_variable = f"{ path_entries_string } ;%PATH%"
329-
330- path_entries_powershell_string = ";" .join ([rf"$env:WINPYDIR\\{ path } " for path in self .pre_path_entries ])
331- full_path_powershell_environment_variable = f"{ path_entries_powershell_string } ;$env:path"
332-
333315 # Replacements for batch scripts (PyPy compatibility)
334316 executable_name = self .distribution .short_exe if self .distribution else "python.exe" # default to python.exe if distribution is not yet set
335317
336- destination = self .winpython_directory / "scripts"
337- for script_name in ('env.bat' , 'WinPython_PS_Prompt.ps1' ):
338- destination_script_path = str (destination / script_name )
339- print ('destination_script_path:' , destination_script_path )
340- utils .patch_sourcefile (destination_script_path , 'python.exe' , executable_name )
341- utils .patch_sourcefile (destination_script_path , '{self.python_dir_name}' , self .python_directory_name )
342- utils .patch_sourcefile (destination_script_path , '{self.winpython_version_name}' , self .winpython_version_name )
343- utils .patch_sourcefile (destination_script_path , '{full_path_env_var}' , full_path_environment_variable )
344- utils .patch_sourcefile (destination_script_path , '{full_path_ps_env_var}' , full_path_powershell_environment_variable )
318+ init_variables = [('WINPYthon_exe' , executable_name ), ('WINPYthon_subdirectory_name' , self .python_directory_name ), ('WINPYVER' , self .winpython_version_name )]
319+ with open (self .winpython_directory / "scripts" / "env.ini" , "w" ) as f :
320+ f .writelines ([f'{ a } ={ b } \n ' for a , b in init_variables ])
345321
346322 def build (self , rebuild : bool = True , requirements_files_list = None , winpy_dirname : str = None ):
347323 """Make or finalise WinPython distribution in the target directory"""
0 commit comments