|
2 | 2 | # Apache License 2.0, Copyright 2019 Tebel.Automation Private Limited |
3 | 3 | # https://github.com/tebelorg/TagUI-Python/blob/master/LICENSE.txt |
4 | 4 | __author__ = 'Ken Soh <opensource@tebel.org>' |
5 | | -__version__ = '1.20.0' |
| 5 | +__version__ = '1.21.0' |
6 | 6 |
|
7 | 7 | import subprocess |
8 | 8 | import os |
@@ -411,13 +411,20 @@ def setup(): |
411 | 411 | # check that tagui packaged php is working, it has dependency on MSVCR110.dll |
412 | 412 | if os.system(tagui_directory + '/' + 'src' + '/' + 'php/php.exe -v > nul 2>&1') != 0: |
413 | 413 | print('[TAGUI][INFO] - now installing missing Visual C++ Redistributable dependency') |
414 | | - vcredist_x86_url = 'https://raw.githubusercontent.com/tebelorg/Tump/master/vcredist_x86.exe' |
415 | | - if download(vcredist_x86_url, tagui_directory + '/vcredist_x86.exe'): |
416 | | - os.system(tagui_directory + '/vcredist_x86.exe') |
417 | 414 |
|
| 415 | + # download from hosted setup file, if not already present when deployed using pack() |
| 416 | + if not os.path.isfile(tagui_directory + '/vcredist_x86.exe'): |
| 417 | + vcredist_x86_url = 'https://raw.githubusercontent.com/tebelorg/Tump/master/vcredist_x86.exe' |
| 418 | + if not download(vcredist_x86_url, tagui_directory + '/vcredist_x86.exe'): |
| 419 | + return False |
| 420 | + |
| 421 | + # run setup to install the MSVCR110.dll dependency (user action required) |
| 422 | + os.system(tagui_directory + '/vcredist_x86.exe') |
| 423 | + |
418 | 424 | # check again if tagui packaged php is working, after installing vcredist_x86.exe |
419 | 425 | if os.system(tagui_directory + '/' + 'src' + '/' + 'php/php.exe -v > nul 2>&1') != 0: |
420 | 426 | print('[TAGUI][INFO] - MSVCR110.dll is still missing, install vcredist_x86.exe from') |
| 427 | + print('[TAGUI][INFO] - the vcredist_x86.exe file in ' + home_directory + '\\tagui or from') |
421 | 428 | print('[TAGUI][INFO] - https://www.microsoft.com/en-us/download/details.aspx?id=30679') |
422 | 429 | print('[TAGUI][INFO] - after that, TagUI ready for use in your Python environment') |
423 | 430 | return False |
@@ -599,6 +606,10 @@ def pack(): |
599 | 606 | # next download jython to tagui/src/sikulix folder (after init() it can be moved away) |
600 | 607 | if platform.system() == 'Windows': |
601 | 608 | tagui_directory = os.environ['APPDATA'] + '/' + 'tagui' |
| 609 | + # pack in Visual C++ MSVCR110.dll dependency from PHP for offline installation |
| 610 | + vcredist_x86_url = 'https://raw.githubusercontent.com/tebelorg/Tump/master/vcredist_x86.exe' |
| 611 | + if not download(vcredist_x86_url, tagui_directory + '/vcredist_x86.exe'): |
| 612 | + return False |
602 | 613 | else: |
603 | 614 | tagui_directory = os.path.expanduser('~') + '/' + '.tagui' |
604 | 615 | sikulix_directory = tagui_directory + '/' + 'src' + '/' + 'sikulix' |
|
0 commit comments