Current software is build on Electron framework
Python is used as backend to download the software (compiled to .exe to avoid Python dependency)
In order to work with project you need to
- Install npm (node package manager)
- Open PowerShell/CMD in project folder and run:
- Installation of Electron globally
cd electron_ui npm install electron -g
- Rest packages could be installed automatically from package.json
npm install cd ..
- Installation of Electron globally
- Install all required Python modules
python -m pip install -r requirements.txt
- Compile python code to the executable (see Test on your local machine)
- Finally to launch Electron app (see package.json for command)
cd electron_ui electron .
Generally builds would be created during branch merge via Azure Pipeline (see configuration in azure-pipelines.yml)
All commands below you run from electron_ui folder (app folder)
First create an executable from python using Pyinstaller.
You may need a fresh environment for the build (in order to exclude unused modules from Python)
cd electron_ui
python -m pip install --user pipenv
python -m venv D:\build_env
D:\build_env\Scripts\pip.exe install pyinstaller
D:\build_env\Scripts\pyinstaller.exe ..\downloader_backend.py --distpath python_build --workpath %TEMP% --exclude-module tkinter --onefile
To generate build (executable) electron-builder is used (see scripts section in package.json):
npm run build
Releases of the tool are published on GitHub.
In order to publish a release you will need a Personal Access Token to GitHub set as GH_TOKEN
environment variable
and then just run
npm run deploy
Due to high demand of downloading from SharePoint (SP) new method was introduced that allows users to download latest builds from SP.
We collect statistics in two ways:
- Download count for each version via GitHub API.
- Downloads count sent from user machine. See send_statistics() function in backend. This will send data to the InfluxDB. To postprocess data Grafana is used. To open Grafana use in web browser http://ottbld02:3000 and connect to the datasource of InfluxDB. For more info read server.md
Note: do not forget to set Null value: null as zero for a plot
For testing you can use python unittest module.
Use test_downloader_backend.py script from unittests folder and input folder to mock up input parameters.
At this moment you can mock up input for the downloader and test following features:
- Download test: download specified version
- History test: verify that installation history is written
- Installation test: uninstall version if exists and install new one
- Uninstallation test: only uninstallation
- Updating of Electronics Desktop registry
- Cleaning temp folder after installation
- Full test including: get recent build, download, unpack, uninstall, install, update registry, update of history