@@ -310,9 +310,8 @@ def create_batch_script(self, name, contents):
310310 fd .close ()
311311
312312 def create_launcher (self , name , icon , command = None ,
313- args = None , workdir = None , settingspath = None ,
314- bettercommand = None , betterworkdir = None , betterargs = None ,
315- launcher = 'launcher.nsi' ):
313+ args = None , workdir = None ,
314+ launcher = 'launcher_basic.nsi' ):
316315 """Create exe launcher with NSIS"""
317316 assert name .endswith ('.exe' )
318317 portable_dir = osp .join (osp .dirname (osp .abspath (__file__ )), 'portable' )
@@ -333,39 +332,16 @@ def create_launcher(self, name, icon, command=None,
333332 if workdir is None :
334333 workdir = ''
335334
336- if bettercommand is None :
337- bettercommand = command
338- if betterworkdir is None :
339- betterworkdir = workdir
340- if betterargs is None :
341- betterargs = args
342-
343335 fname = osp .join (self .winpydir , osp .splitext (name )[0 ]+ '.nsi' )
344336
345337 data = [('WINPYDIR' , '$EXEDIR\%s' % self .python_name ),
346338 ('WINPYVER' , self .winpyver ),
347339 ('COMMAND' , command ),
348340 ('PARAMETERS' , args ),
349341 ('WORKDIR' , workdir ),
350- ('PREPATH' , prepath ),
351- ('POSTPATH' , postpath ),
352- ('BETTERCOMMAND' , bettercommand ),
353- ('BETTERWORKDIR' , betterworkdir ),
354- ('BETTERPARAMETERS' , betterargs ),
355- ('JUPYTER_DATA_DIR' , '$EXEDIR\%s' % 'settings' ),
356342 ('Icon' , icon_fname ),
357343 ('OutFile' , name )]
358344
359- # handle well Flavor with R or JULIA
360- data += [('R_HOME' , '$EXEDIR%s' % r'\tools\R' ),
361- ('JULIA_PKGDIR' , '$EXEDIR%s' % r'\settings\.julia' ),
362- ('JULIA_HOME' , '$EXEDIR%s' % r'\tools\Julia\bin' ),
363- ('JULIA' , '$EXEDIR%s' % r'\tools\Julia\bin\julia.exe' )]
364-
365- if settingspath is not None :
366- data += [('SETTINGSDIR' , osp .dirname (settingspath )),
367- ('SETTINGSNAME' , osp .basename (settingspath ))]
368-
369345 build_nsis (launcher , fname , data )
370346
371347 def create_python_batch (self , name , script_name ,
@@ -522,14 +498,12 @@ def _create_launchers(self):
522498 self .create_launcher ('WinPython Command Prompt.exe' , 'cmd.ico' ,
523499 command = '$SYSDIR\cmd.exe' ,
524500 args = r'/k cmd.bat' ,
525- workdir = '$EXEDIR\scripts' ,
526- launcher = 'launcher_basic.nsi' )
501+ workdir = '$EXEDIR\scripts' )
527502
528503 self .create_launcher ('WinPython Interpreter.exe' , 'python.ico' ,
529504 command = 'wscript.exe' ,
530505 args = r'Noshell.vbs python.bat' ,
531- workdir = '$EXEDIR\scripts' ,
532- launcher = 'launcher_basic.nsi' )
506+ workdir = '$EXEDIR\scripts' )
533507
534508 #self.create_launcher('IDLEX (students).exe', 'python.ico',
535509 # command='$SYSDIR\cmd.exe',
@@ -538,84 +512,55 @@ def _create_launchers(self):
538512 self .create_launcher ('IDLEX (Python GUI).exe' , 'python.ico' ,
539513 command = 'wscript.exe' ,
540514 args = r'Noshell.vbs IDLEX.bat' ,
541- workdir = '$EXEDIR\scripts' ,
542- launcher = 'launcher_basic.nsi' )
515+ workdir = '$EXEDIR\scripts' )
543516
544517 self .create_launcher ('Spyder.exe' , 'spyder.ico' ,
545518 command = 'wscript.exe' ,
546519 args = r'Noshell.vbs spyder.bat' ,
547- workdir = '$EXEDIR\Scripts' ,
548- launcher = 'launcher_basic.nsi' )
520+ workdir = '$EXEDIR\Scripts' )
549521
550522 self .create_launcher ('Spyder reset.exe' , 'spyder_reset.ico' ,
551523 command = 'wscript.exe' ,
552524 args = r'Noshell.vbs spyder_reset.bat' ,
553- workdir = '$EXEDIR\Scripts' ,
554- launcher = 'launcher_basic.nsi' )
525+ workdir = '$EXEDIR\Scripts' )
555526
556527 self .create_launcher ('WinPython Control Panel.exe' , 'winpython.ico' ,
557- command = '${WINPYDIR}\pythonw .exe' ,
558- args = '-m winpython.controlpanel ' ,
559- workdir = '${WINPYDIR} \Scripts' )
528+ command = 'wscript .exe' ,
529+ args = r'Noshell.vbs wpcp.bat ' ,
530+ workdir = '$EXEDIR \Scripts' )
560531
561532 # Multi-Qt launchers (Qt5 has priority if found)
562533 self .create_launcher ('Qt Demo.exe' , 'qt.ico' ,
563534 command = 'wscript.exe' ,
564535 args = r'Noshell.vbs qtdemo.bat' ,
565- workdir = '$EXEDIR\Scripts' ,
566- launcher = 'launcher_basic.nsi' )
536+ workdir = '$EXEDIR\Scripts' )
567537
568538 self .create_launcher ('Qt Assistant.exe' , 'qtassistant.ico' ,
569539 command = 'wscript.exe' ,
570540 args = r'Noshell.vbs qtassistant.bat' ,
571- workdir = '$EXEDIR\Scripts' ,
572- launcher = 'launcher_basic.nsi' )
541+ workdir = '$EXEDIR\Scripts' )
573542
574543 self .create_launcher ('Qt Designer.exe' , 'qtdesigner.ico' ,
575544 command = 'wscript.exe' ,
576545 args = r'Noshell.vbs qtdesigner.bat' ,
577- workdir = '$EXEDIR\Scripts' ,
578- launcher = 'launcher_basic.nsi' )
546+ workdir = '$EXEDIR\Scripts' )
579547
580548 self .create_launcher ('Qt Linguist.exe' , 'qtlinguist.ico' ,
581549 command = 'wscript.exe' ,
582550 args = r'Noshell.vbs qtlinguist.bat' ,
583- workdir = '$EXEDIR\Scripts' ,
584- launcher = 'launcher_basic.nsi' )
551+ workdir = '$EXEDIR\Scripts' )
585552
586553 # Jupyter launchers
587554 self .create_launcher ('IPython Qt Console.exe' , 'ipython.ico' ,
588555 command = 'wscript.exe' ,
589556 args = r'Noshell.vbs qtconsole.bat' ,
590- workdir = '$EXEDIR\Scripts' ,
591- launcher = 'launcher_basic.nsi' )
557+ workdir = '$EXEDIR\Scripts' )
592558
593559 # this one needs a shell to kill fantom processes
594560 self .create_launcher ('Jupyter Notebook.exe' , 'jupyter.ico' ,
595561 command = '$SYSDIR\cmd.exe' ,
596562 args = r'/k ipython_notebook.bat' ,
597- workdir = '$EXEDIR\Scripts' ,
598- launcher = 'launcher_basic.nsi' )
599-
600- # R console launchers
601- r_exe = self .R_PATH + r"\i386\R.exe"
602- if osp .isfile (self .winpydir + r_exe ):
603- self .create_launcher ('R Console32.exe' , 'r.ico' ,
604- command = '$EXEDIR' + r_exe ,
605- workdir = r'$EXEDIR\notebooks' )
606- r_exe = self .R_PATH + r"\x64\R.exe"
607- if osp .isfile (self .winpydir + r_exe ):
608- self .create_launcher ('R Console64.exe' , 'r.ico' ,
609- command = '$EXEDIR' + r_exe ,
610- workdir = r'$EXEDIR\notebooks' )
611-
612- # Julia console launcher
613- julia_exe = self .JULIA_PATH + r"\julia.exe"
614- if osp .isfile (self .winpydir + julia_exe ):
615- self .create_launcher ('Julia Console.exe' , 'julia.ico' ,
616- command = '$EXEDIR' + julia_exe ,
617- workdir = r'$EXEDIR\notebooks' )
618-
563+ workdir = '$EXEDIR\Scripts' )
619564
620565 self ._print_done ()
621566
@@ -914,8 +859,15 @@ def _create_batch_scripts(self):
914859 r"""@echo off
915860call %~dp0env.bat
916861call %~dp0register_python.bat --all""" )
917- self .create_python_batch ('wpcp.bat' , '-m winpython.controlpanel' ,
918- workdir = r'"%WINPYDIR%\Scripts"' )
862+
863+ self .create_batch_script ('wpcp.bat' ,r"""@echo off
864+ call "%~dp0env_for_icons.bat"
865+ cd/D "%WINPYWORKDIR%"
866+ %WINPYDIR%\python.exe -m winpython.controlpanel --reset %*
867+ """ )
868+
869+ #self.create_python_batch('wpcp.bat', '-m winpython.controlpanel',
870+ # workdir=r'"%WINPYDIR%\Scripts"')
919871
920872 self .create_batch_script ('upgrade_pip.bat' , r"""@echo off
921873call %~dp0env.bat
0 commit comments