Index: build_tools/conda_qt5_win_commercial.yml
===================================================================
--- build_tools/conda_qt5_win_commercial.yml	(revision 13c552ba581cd8e9b274a35d5cf9496028ffaadc)
+++ build_tools/conda_qt5_win_commercial.yml	(revision 13c552ba581cd8e9b274a35d5cf9496028ffaadc)
@@ -0,0 +1,29 @@
+name: qt5_win
+channels:
+  - conda-forge
+dependencies:
+ - colorama
+ - ipykernel=4.9.0
+ - nbformat
+ - pyopencl=2018.2.2
+ - scipy=1.2.0
+ - hdf5=1.10.4
+ - h5py=2.9.0
+ - lxml=4.3.0
+ - twisted=18.9.0
+ - sphinx=1.8.4
+ - pytest=4.2.0
+ - cython=0.29.4
+ - sip
+ - pip:
+   - matplotlib
+   - bumps==0.7.11
+   - pyinstaller==3.3.1
+   - periodictable==1.5.0
+   - xhtml2pdf==0.2.3
+   - ../../../PyQt5_commercial-5.11.3-5.11.2-cp35.cp36.cp37.cp38-none-win_amd64.whl
+   - qt5reactor==0.5
+   - qtconsole
+   - tinycc==1.1
+
+
Index: build_tools/jenkins_qt5_win_commercial.bat
===================================================================
--- build_tools/jenkins_qt5_win_commercial.bat	(revision 17f7df4db0ec49844a5f87fa81fb7d07c676fdd0)
+++ build_tools/jenkins_qt5_win_commercial.bat	(revision 17f7df4db0ec49844a5f87fa81fb7d07c676fdd0)
@@ -0,0 +1,86 @@
+:: Find ENV NAME
+cd %WORKSPACE%
+cd sasview
+cd build_tools
+findstr "name:" conda_qt5_win.yml > condaenv_name.txt
+set /p condaname=<condaenv_name.txt
+
+:: ACTIVATE ENV
+call activate %condaname:~6%
+
+
+:: BUILD SETUP
+set PYTHON=python.exe
+set EASY_INSTALL=easy_install.exe
+set PYLINT= pylint.exe
+set PYINSTALLER=pyinstaller.exe
+set INNO=C:\"Program Files (x86)"\"Inno Setup 5"\ISCC.exe
+set GIT_SED=C:\"Program Files"\Git\bin\sed.exe
+set SAS_COMPILER=tinycc
+
+
+:: REMOVE INSTALLATION ################################################
+pip uninstall -y sasview
+pip uninstall -y sasmodels
+pip uninstall -y tinycc
+
+:: TINYCC build ####################################################
+cd %WORKSPACE%
+cd tinycc
+%PYTHON% setup.py build install
+
+:: SASMODELS build ####################################################
+cd %WORKSPACE%
+cd sasmodels
+%PYTHON% setup.py build
+
+:: SASMODELS doc ######################################################
+cd doc
+make html
+
+:: SASMODELS install ################################################
+cd %WORKSPACE%
+cd sasmodels
+%PYTHON% setup.py install
+
+
+:: NOW BUILD SASVIEW
+
+:: SASVIEW check dep ################################################
+cd %WORKSPACE%
+cd sasview
+%PYTHON% check_packages.py
+
+
+:: SASVIEW build install ################################################
+cd %WORKSPACE%
+cd sasview
+
+:: MAKE GUI FROM UI FILES
+%PYTHON% src\sas\qtgui\convertUI.py
+%PYTHON% setup.py build docs install
+
+
+:: :: SASVIEW utest ######################################################
+:: NOT YET IMPLEMENTED FOR THE NEW Qt5 SasView 5.0 
+:: cd %WORKSPACE%\sasview\test
+:: %PYTHON% utest_sasview.py
+
+
+:: SASVIEW INSTALLER ##################################################
+cd %WORKSPACE%
+cd sasview
+cd installers
+
+:: USING PYINSTALLER
+%PYINSTALLER% sasview_qt5_commercial.spec
+
+::# :: USING PY2EXE
+::# %PYTHON% setup_exe.py py2exe
+
+
+:: READY FOR INNO
+%PYTHON% installer_generator.py
+%INNO% installer.iss
+cd Output
+xcopy setupSasView.exe %WORKSPACE%\sasview\dist
Index: installers/sasview_qt5_commercial.spec
===================================================================
--- installers/sasview_qt5_commercial.spec	(revision 17f7df4db0ec49844a5f87fa81fb7d07c676fdd0)
+++ installers/sasview_qt5_commercial.spec	(revision 17f7df4db0ec49844a5f87fa81fb7d07c676fdd0)
@@ -0,0 +1,189 @@
+# -*- mode: python -*-
+# Modifiable location
+import sys
+import os
+import platform
+
+import warnings
+from distutils.filelist import findall
+
+PYTHON_LOC = sys.exec_prefix
+# Portability settings
+if os.name == 'posix':
+    LIBPREFIX='lib'
+    LIBSUFFIX='so'
+    LIBLOC = os.path.join(PYTHON_LOC,'lib')
+    # Darwin needs UPX=False, Linux actually builds with both...
+    if platform.system() == 'Darwin':
+        UPX=False
+    else:
+        UPX=True
+else:
+    LIBPREFIX=''
+    LIBSUFFIX='dll'
+    LIBLOC = os.path.join(PYTHON_LOC,'Library','bin')
+    UPX=True
+
+SCRIPT_TO_SOURCE = 'sasview.py'
+
+# Warning! pyinstaller/py2exe etc. don't have the __file__ attribute
+WORK_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
+
+#### LOCAL METHODS
+def add_data(data):
+    for component in data:
+        target = component[0]
+        for filename in component[1]:
+           datas.append((filename, target))
+
+def add_binary(binary):
+    return (os.path.join(LIBLOC,binary),'.')
+
+# ADDITIONAL DATA ############################################################
+datas = [('../src/sas/sasview/images', 'images')]
+
+#datas = [('../src/sas/sasview/images/ball.png', '.')]
+
+datas.append(('../src/sas/sasview/media','media'))
+datas.append(('../src/sas/sasview/test','test'))
+datas.append(('../src/sas/sasview/custom_config.py','.'))
+datas.append(('../src/sas/sasview/local_config.py','.'))
+datas.append(('../src/sas/sasview/wxcruft.py','.'))
+datas.append(('../src/sas/logger_config.py','.'))
+datas.append(('../src/sas/logging.ini','.'))
+
+# pyinstaller gets mightily confused by upper/lower case,
+# so some modules need to be copied explicitly to avoid
+# messages like
+# WARNING: Attempted to add Python module twice with different upper/lowercases
+datas.append((os.path.join(PYTHON_LOC,'Lib','SocketServer.py'),'.'))
+datas.append((os.path.join(PYTHON_LOC,'Lib','Queue.py'),'.'))
+
+# TODO
+# NEED BETTER WAY TO DEAL WITH THESE RELATIVE PATHS
+datas.append((os.path.join('..', '..','sasmodels','sasmodels'),'sasmodels'))
+datas.append((os.path.join('..', 'src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models'))
+#datas.append((os.path.join(PYTHON_LOC,'Library','plugins','platforms'),'platforms'))
+datas.append((os.path.join(PYTHON_LOC,'Lib','site-packages','PyQt5','Qt','plugins','platforms'),'platforms'))
+datas.append((os.path.join(PYTHON_LOC,'Lib','site-packages','jedi'),'jedi'))
+
+# These depend on whether we have MKL or Atlas numpy
+if os.path.exists(os.path.join(LIBLOC, LIBPREFIX + 'mkl_core.' + LIBSUFFIX)):
+    datas.append(add_binary(LIBPREFIX + 'mkl_avx2.' + LIBSUFFIX))
+    datas.append(add_binary(LIBPREFIX + 'mkl_def.' + LIBSUFFIX))
+elif os.path.exists(os.path.join(LIBLOC, LIBPREFIX + 'numpy-atlas.' + LIBSUFFIX)):
+    datas.append(add_binary(LIBPREFIX + 'numpy-atlas.' + LIBSUFFIX))
+else:
+    raise Exception("No numerical library for numpy found.")
+
+#import sas.sascalc.dataloader.readers
+#f = os.path.join(sas.sascalc.dataloader.readers.get_data_path(), 'defaults.json')
+#datas.append((f, '.'))
+
+# Add a custom pyopencl hook, as described in
+# https://github.com/pyinstaller/pyinstaller/issues/2130
+from PyInstaller.utils.hooks import copy_metadata
+datas.append(copy_metadata('pyopencl')[0])
+
+import sasmodels
+add_data(sasmodels.data_files())
+
+try:
+    import tinycc
+    add_data(tinycc.data_files())
+except ImportError:
+    warnings.warn("TinyCC package is not available and will not be included")
+
+import periodictable
+add_data(periodictable.data_files())
+
+import matplotlib
+matplotlibdatadir = matplotlib.get_data_path()
+matplotlibdata = findall(matplotlibdatadir)
+for f in matplotlibdata:
+    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
+    datas.append((f, os.path.split(dirname)[0]))
+
+binaries = []
+
+# EXCLUDED FILES ############################################################
+# Spelled out to enable easier editing
+excludes = []
+
+# Need to explicitly exclude sasmodels here!!
+excludes.append('sasmodels')
+
+# HIDDEN MODULES ############################################################
+hiddenimports = [
+ 'PyQt5',
+ 'PyQt5.sip',
+ 'periodictable.core',
+ 'sasmodels.core',
+ 'pyopencl',
+ 'tinycc',
+ 'SocketServer',
+ 'logging',
+ 'logging.config',
+ 'reportlab', 'reportlab.graphics',
+ 'reportlab.graphics.barcode.common',
+ 'reportlab.graphics.barcode.code128',
+ 'reportlab.graphics.barcode.code93',
+ 'reportlab.graphics.barcode.code39',
+ 'reportlab.graphics.barcode.lto',
+ 'reportlab.graphics.barcode.qr',
+ 'reportlab.graphics.barcode.usps',
+ 'reportlab.graphics.barcode.usps4s',
+ 'reportlab.graphics.barcode.eanbc',
+ 'reportlab.graphics.barcode.ecc200datamatrix',
+ 'reportlab.graphics.barcode.fourstate',
+ 'ipykernel', 'ipykernel.datapub',
+ 'pygments', 'pygments.lexers','pygments.lexers.python',
+ 'pygments.styles','pygments.styles.default',
+ 'atexit', 'cython', 'sip', 'xhtml2pdf',
+ 'zmq', 'zmq.utils', 'zmq.utils.strtypes',
+ 'zmq.utils.jsonapi','zmq.utils.garbage',
+ 'zmq.backend.cython','zmq.backend.cffi',
+ 'site','lxml._elementpath','lxml.etree',
+ 'scipy._lib.messagestream',
+]
+
+a = Analysis([SCRIPT_TO_SOURCE],
+             pathex=[WORK_DIR],
+             binaries=binaries,
+             datas=datas,
+             hiddenimports=hiddenimports,
+             hookspath=[],
+             runtime_hooks=[],
+             excludes=excludes,
+             win_no_prefer_redirects=False,
+             win_private_assemblies=False,
+             cipher=None)
+
+pyz = PYZ(a.pure, a.zipped_data,
+             cipher=None)
+
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=True,
+          name='sasview',
+          debug=False,
+          upx=UPX,
+          icon=os.path.join("../src/sas/sasview/images","ball.ico"),
+          version="version.txt",
+          console=False )
+
+# COLLECT creates a directory instead of a single file.
+coll = COLLECT(exe,
+               a.binaries,
+               a.zipfiles,
+               a.datas,
+               strip=False,
+               upx=UPX,
+               name='sasview')
+
+if platform.system() == 'Darwin':
+    app = BUNDLE(exe,
+        name='SasView.app',
+        icon='../src/sas/sasview/images/ball.ico',
+        bundle_identifier=None)
+
