Skip to content

Commit

Permalink
#36 - include Windows dependency for pack()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kensoh committed Jan 4, 2020
1 parent 9d045c1 commit a735a6c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TagUI for Python :snake:

[**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)
[**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)

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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='tagui',
version='1.20.0',
version='1.21.0',
py_modules=['tagui'],
author='Ken Soh',
author_email='[email protected]',
Expand Down
19 changes: 15 additions & 4 deletions tagui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Apache License 2.0, Copyright 2019 Tebel.Automation Private Limited
# https://github.com/tebelorg/TagUI-Python/blob/master/LICENSE.txt
__author__ = 'Ken Soh <[email protected]>'
__version__ = '1.20.0'
__version__ = '1.21.0'

import subprocess
import os
Expand Down Expand Up @@ -411,13 +411,20 @@ def setup():
# check that tagui packaged php is working, it has dependency on MSVCR110.dll
if os.system(tagui_directory + '/' + 'src' + '/' + 'php/php.exe -v > nul 2>&1') != 0:
print('[TAGUI][INFO] - now installing missing Visual C++ Redistributable dependency')
vcredist_x86_url = 'https://raw.githubusercontent.com/tebelorg/Tump/master/vcredist_x86.exe'
if download(vcredist_x86_url, tagui_directory + '/vcredist_x86.exe'):
os.system(tagui_directory + '/vcredist_x86.exe')

# download from hosted setup file, if not already present when deployed using pack()
if not os.path.isfile(tagui_directory + '/vcredist_x86.exe'):
vcredist_x86_url = 'https://raw.githubusercontent.com/tebelorg/Tump/master/vcredist_x86.exe'
if not download(vcredist_x86_url, tagui_directory + '/vcredist_x86.exe'):
return False

# run setup to install the MSVCR110.dll dependency (user action required)
os.system(tagui_directory + '/vcredist_x86.exe')

# check again if tagui packaged php is working, after installing vcredist_x86.exe
if os.system(tagui_directory + '/' + 'src' + '/' + 'php/php.exe -v > nul 2>&1') != 0:
print('[TAGUI][INFO] - MSVCR110.dll is still missing, install vcredist_x86.exe from')
print('[TAGUI][INFO] - the vcredist_x86.exe file in ' + home_directory + '\\tagui or from')
print('[TAGUI][INFO] - https://www.microsoft.com/en-us/download/details.aspx?id=30679')
print('[TAGUI][INFO] - after that, TagUI ready for use in your Python environment')
return False
Expand Down Expand Up @@ -599,6 +606,10 @@ def pack():
# next download jython to tagui/src/sikulix folder (after init() it can be moved away)
if platform.system() == 'Windows':
tagui_directory = os.environ['APPDATA'] + '/' + 'tagui'
# pack in Visual C++ MSVCR110.dll dependency from PHP for offline installation
vcredist_x86_url = 'https://raw.githubusercontent.com/tebelorg/Tump/master/vcredist_x86.exe'
if not download(vcredist_x86_url, tagui_directory + '/vcredist_x86.exe'):
return False
else:
tagui_directory = os.path.expanduser('~') + '/' + '.tagui'
sikulix_directory = tagui_directory + '/' + 'src' + '/' + 'sikulix'
Expand Down

0 comments on commit a735a6c

Please sign in to comment.