@@ -310,9 +310,8 @@ def create_batch_script(self, name, contents):
310
310
fd .close ()
311
311
312
312
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' ):
316
315
"""Create exe launcher with NSIS"""
317
316
assert name .endswith ('.exe' )
318
317
portable_dir = osp .join (osp .dirname (osp .abspath (__file__ )), 'portable' )
@@ -333,39 +332,16 @@ def create_launcher(self, name, icon, command=None,
333
332
if workdir is None :
334
333
workdir = ''
335
334
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
-
343
335
fname = osp .join (self .winpydir , osp .splitext (name )[0 ]+ '.nsi' )
344
336
345
337
data = [('WINPYDIR' , '$EXEDIR\%s' % self .python_name ),
346
338
('WINPYVER' , self .winpyver ),
347
339
('COMMAND' , command ),
348
340
('PARAMETERS' , args ),
349
341
('WORKDIR' , workdir ),
350
- ('PREPATH' , prepath ),
351
- ('POSTPATH' , postpath ),
352
- ('BETTERCOMMAND' , bettercommand ),
353
- ('BETTERWORKDIR' , betterworkdir ),
354
- ('BETTERPARAMETERS' , betterargs ),
355
- ('JUPYTER_DATA_DIR' , '$EXEDIR\%s' % 'settings' ),
356
342
('Icon' , icon_fname ),
357
343
('OutFile' , name )]
358
344
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
-
369
345
build_nsis (launcher , fname , data )
370
346
371
347
def create_python_batch (self , name , script_name ,
@@ -522,14 +498,12 @@ def _create_launchers(self):
522
498
self .create_launcher ('WinPython Command Prompt.exe' , 'cmd.ico' ,
523
499
command = '$SYSDIR\cmd.exe' ,
524
500
args = r'/k cmd.bat' ,
525
- workdir = '$EXEDIR\scripts' ,
526
- launcher = 'launcher_basic.nsi' )
501
+ workdir = '$EXEDIR\scripts' )
527
502
528
503
self .create_launcher ('WinPython Interpreter.exe' , 'python.ico' ,
529
504
command = 'wscript.exe' ,
530
505
args = r'Noshell.vbs python.bat' ,
531
- workdir = '$EXEDIR\scripts' ,
532
- launcher = 'launcher_basic.nsi' )
506
+ workdir = '$EXEDIR\scripts' )
533
507
534
508
#self.create_launcher('IDLEX (students).exe', 'python.ico',
535
509
# command='$SYSDIR\cmd.exe',
@@ -538,84 +512,55 @@ def _create_launchers(self):
538
512
self .create_launcher ('IDLEX (Python GUI).exe' , 'python.ico' ,
539
513
command = 'wscript.exe' ,
540
514
args = r'Noshell.vbs IDLEX.bat' ,
541
- workdir = '$EXEDIR\scripts' ,
542
- launcher = 'launcher_basic.nsi' )
515
+ workdir = '$EXEDIR\scripts' )
543
516
544
517
self .create_launcher ('Spyder.exe' , 'spyder.ico' ,
545
518
command = 'wscript.exe' ,
546
519
args = r'Noshell.vbs spyder.bat' ,
547
- workdir = '$EXEDIR\Scripts' ,
548
- launcher = 'launcher_basic.nsi' )
520
+ workdir = '$EXEDIR\Scripts' )
549
521
550
522
self .create_launcher ('Spyder reset.exe' , 'spyder_reset.ico' ,
551
523
command = 'wscript.exe' ,
552
524
args = r'Noshell.vbs spyder_reset.bat' ,
553
- workdir = '$EXEDIR\Scripts' ,
554
- launcher = 'launcher_basic.nsi' )
525
+ workdir = '$EXEDIR\Scripts' )
555
526
556
527
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' )
560
531
561
532
# Multi-Qt launchers (Qt5 has priority if found)
562
533
self .create_launcher ('Qt Demo.exe' , 'qt.ico' ,
563
534
command = 'wscript.exe' ,
564
535
args = r'Noshell.vbs qtdemo.bat' ,
565
- workdir = '$EXEDIR\Scripts' ,
566
- launcher = 'launcher_basic.nsi' )
536
+ workdir = '$EXEDIR\Scripts' )
567
537
568
538
self .create_launcher ('Qt Assistant.exe' , 'qtassistant.ico' ,
569
539
command = 'wscript.exe' ,
570
540
args = r'Noshell.vbs qtassistant.bat' ,
571
- workdir = '$EXEDIR\Scripts' ,
572
- launcher = 'launcher_basic.nsi' )
541
+ workdir = '$EXEDIR\Scripts' )
573
542
574
543
self .create_launcher ('Qt Designer.exe' , 'qtdesigner.ico' ,
575
544
command = 'wscript.exe' ,
576
545
args = r'Noshell.vbs qtdesigner.bat' ,
577
- workdir = '$EXEDIR\Scripts' ,
578
- launcher = 'launcher_basic.nsi' )
546
+ workdir = '$EXEDIR\Scripts' )
579
547
580
548
self .create_launcher ('Qt Linguist.exe' , 'qtlinguist.ico' ,
581
549
command = 'wscript.exe' ,
582
550
args = r'Noshell.vbs qtlinguist.bat' ,
583
- workdir = '$EXEDIR\Scripts' ,
584
- launcher = 'launcher_basic.nsi' )
551
+ workdir = '$EXEDIR\Scripts' )
585
552
586
553
# Jupyter launchers
587
554
self .create_launcher ('IPython Qt Console.exe' , 'ipython.ico' ,
588
555
command = 'wscript.exe' ,
589
556
args = r'Noshell.vbs qtconsole.bat' ,
590
- workdir = '$EXEDIR\Scripts' ,
591
- launcher = 'launcher_basic.nsi' )
557
+ workdir = '$EXEDIR\Scripts' )
592
558
593
559
# this one needs a shell to kill fantom processes
594
560
self .create_launcher ('Jupyter Notebook.exe' , 'jupyter.ico' ,
595
561
command = '$SYSDIR\cmd.exe' ,
596
562
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' )
619
564
620
565
self ._print_done ()
621
566
@@ -914,8 +859,15 @@ def _create_batch_scripts(self):
914
859
r"""@echo off
915
860
call %~dp0env.bat
916
861
call %~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"')
919
871
920
872
self .create_batch_script ('upgrade_pip.bat' , r"""@echo off
921
873
call %~dp0env.bat
0 commit comments