@@ -347,16 +347,18 @@ def create_launcher(self, name, icon, command=None,
347347 build_nsis ('launcher.nsi' , fname , data )
348348
349349 def create_python_batch (self , name , script_name ,
350- workdir = None , options = None ):
350+ workdir = None , options = None , command = None ):
351351 """Create batch file to run a Python script"""
352352 if options is None :
353353 options = ''
354354 else :
355355 options = ' ' + options
356- if script_name .endswith ('.pyw' ):
357- cmd = 'start %WINPYDIR%\pythonw.exe'
358- else :
359- cmd = '%WINPYDIR%\python.exe'
356+
357+ if command is None :
358+ if script_name .endswith ('.pyw' ):
359+ command = 'start %WINPYDIR%\pythonw.exe'
360+ else :
361+ command = '%WINPYDIR%\python.exe'
360362 changedir = ''
361363 if workdir is not None :
362364 workdir = osp .join ('%WINPYDIR%' , workdir )
@@ -366,7 +368,7 @@ def create_python_batch(self, name, script_name,
366368 script_name = ' ' + script_name
367369 self .create_batch_script (name , r"""@echo off
368370call %~dp0env.bat
369- """ + changedir + cmd + script_name + options + " %*" )
371+ """ + changedir + command + script_name + options + " %*" )
370372
371373 def create_installer (self ):
372374 """Create installer with NSIS"""
@@ -517,12 +519,13 @@ def _create_launchers(self):
517519 workdir = '${WINPYDIR}\Lib\idlelib' )
518520 settingspath = osp .join ('.spyder2' , '.spyder.ini' )
519521 self .create_launcher ('Spyder.exe' , 'spyder.ico' ,
520- command = '${WINPYDIR}\Scripts\spyder.exe' ,
522+ command = '${WINPYDIR}\python.exe' ,
523+ args = '-m spyderlib.start_app' ,
521524 workdir = '${WINPYDIR}\Scripts' ,
522525 settingspath = settingspath )
523526 self .create_launcher ('Spyder (light).exe' , 'spyder_light.ico' ,
524- args = '--light ' ,
525- command = '${WINPYDIR}\Scripts\spyder.exe ' ,
527+ command = '${WINPYDIR}\python.exe ' ,
528+ args = '-m spyderlib.start_app --light ' ,
526529 workdir = '${WINPYDIR}\Scripts' ,
527530 settingspath = settingspath )
528531
@@ -944,9 +947,13 @@ def _create_batch_scripts(self):
944947call %~dp0env.bat
945948cmd.exe /k""" )
946949 self .create_python_batch ('python.bat' , '' )
947- self .create_python_batch ('spyder.bat' , 'spyder' , workdir = 'Scripts' )
948- self .create_python_batch ('spyder_light.bat' , 'spyder' ,
949- workdir = 'Scripts' , options = '--light' )
950+ self .create_python_batch ('spyder.bat' , 'spyderlib.start_app' ,
951+ workdir = 'Scripts' ,
952+ command = '%WINPYDIR%\python.exe -m' )
953+ self .create_python_batch ('spyder_light.bat' , 'spyderlib.start_app' ,
954+ workdir = 'Scripts' ,
955+ command = '%WINPYDIR%\python.exe -m' ,
956+ options = '--light' )
950957 self .create_python_batch ('register_python.bat' , 'register_python' ,
951958 workdir = 'Scripts' )
952959 self .create_batch_script ('register_python_for_all.bat' ,
0 commit comments