Skip to content

Commit a735a6c

Browse files
committed
#36 - include Windows dependency for pack()
Including vcredist_x86.exe as part of pack() to streamline deployment on Windows without internet. This lets users enjoy the automated setup on the air-gapped computer without having to download vcredist_x86.exe elsewhere and transfer the file to that computer to install.
1 parent 9d045c1 commit a735a6c

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TagUI for Python :snake:
22

3-
[**Use Cases**](#use-cases) | [**API Reference**](#api-reference) | [**About & Credits**](#about--credits) | [**PyCon Video**](https://www.youtube.com/watch?v=F2aQKWx_EAE) | [**Free Starbucks \***](#api-reference) | [**v1.20**](https://github.com/tebelorg/TagUI-Python/releases)
3+
[**Use Cases**](#use-cases) | [**API Reference**](#api-reference) | [**About & Credits**](#about--credits) | [**PyCon Video**](https://www.youtube.com/watch?v=F2aQKWx_EAE) | [**Free Starbucks \***](#api-reference) | [**v1.21**](https://github.com/tebelorg/TagUI-Python/releases)
44

55
![TagUI for Python demo in Jupyter notebook](https://raw.githubusercontent.com/tebelorg/Tump/master/tagui_python.gif)
66

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='tagui',
5-
version='1.20.0',
5+
version='1.21.0',
66
py_modules=['tagui'],
77
author='Ken Soh',
88
author_email='opensource@tebel.org',

tagui.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Apache License 2.0, Copyright 2019 Tebel.Automation Private Limited
33
# https://github.com/tebelorg/TagUI-Python/blob/master/LICENSE.txt
44
__author__ = 'Ken Soh <opensource@tebel.org>'
5-
__version__ = '1.20.0'
5+
__version__ = '1.21.0'
66

77
import subprocess
88
import os
@@ -411,13 +411,20 @@ def setup():
411411
# check that tagui packaged php is working, it has dependency on MSVCR110.dll
412412
if os.system(tagui_directory + '/' + 'src' + '/' + 'php/php.exe -v > nul 2>&1') != 0:
413413
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')
417414

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+
418424
# check again if tagui packaged php is working, after installing vcredist_x86.exe
419425
if os.system(tagui_directory + '/' + 'src' + '/' + 'php/php.exe -v > nul 2>&1') != 0:
420426
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')
421428
print('[TAGUI][INFO] - https://www.microsoft.com/en-us/download/details.aspx?id=30679')
422429
print('[TAGUI][INFO] - after that, TagUI ready for use in your Python environment')
423430
return False
@@ -599,6 +606,10 @@ def pack():
599606
# next download jython to tagui/src/sikulix folder (after init() it can be moved away)
600607
if platform.system() == 'Windows':
601608
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
602613
else:
603614
tagui_directory = os.path.expanduser('~') + '/' + '.tagui'
604615
sikulix_directory = tagui_directory + '/' + 'src' + '/' + 'sikulix'

0 commit comments

Comments
 (0)