@@ -492,7 +492,10 @@ def remove_pyradio(self, win_open_dir=False):
492
492
print ('Please report this at http://github.com/coderholic/pyradio/issues\n ' )
493
493
sys .exit (1 )
494
494
495
- def update_or_uninstall_on_windows (self , mode = 'update' ):
495
+ def update_or_uninstall_on_windows (self , mode = 'update' , from_pyradio = False ):
496
+ # Params:
497
+ # mode: the type of zip file to download
498
+ # from_pyradio: True if executed by "pyradio -d"
496
499
params = ('' , '--sng-master' , '--sng-devel' , '--devel' , '--master' )
497
500
isRunning ()
498
501
''' Creates BAT file to update or uninstall PyRadio on Windows'''
@@ -506,10 +509,17 @@ def update_or_uninstall_on_windows(self, mode='update'):
506
509
else :
507
510
bat = os .path .join (self ._dir , 'uninstall.bat' )
508
511
os .system ('CLS' )
509
- # PyRadioUpdateOnWindows.print_uninstall_bat_created()
512
+ if from_pyradio :
513
+ PyRadioUpdateOnWindows .print_uninstall_bat_created ()
510
514
511
515
if self ._package == 0 :
512
516
if self .ZIP_DIR [0 ].endswith ('-' ):
517
+ try :
518
+ if VERSION == '' :
519
+ VERSION = get_github_tag ()
520
+ except :
521
+ VERSION = get_github_tag ()
522
+ # print('VERSION = "{}"'.format(VERSION))
513
523
self .ZIP_URL [0 ] = self .ZIP_URL [0 ] + VERSION + '.zip'
514
524
self .ZIP_DIR [0 ] += VERSION
515
525
try :
@@ -538,6 +548,9 @@ def update_or_uninstall_on_windows(self, mode='update'):
538
548
else :
539
549
b .write (self ._python_exec .python + ' uninstall.py --do-uninstall ' + params [self ._package ] + '\n ' )
540
550
b .write ('if %ERRORLEVEL% == 1 GOTO downloaderror\n ' )
551
+ # print('self._dir = "{}"'.format(self._dir))
552
+ # print('self._package = "{}"'.format(self._package))
553
+ # print('self.ZIP_DIR = "{}"'.format(self.ZIP_DIR))
541
554
b .write ('cd "' + os .path .join (self ._dir , self .ZIP_DIR [self ._package ]) + '"\n ' )
542
555
b .write ('devel\\ build_install_pyradio.bat -u\n ' )
543
556
b .write ('GOTO endofscript\n ' )
0 commit comments