eSim Installer (Windows OS) ==== It contains all the documentation for making eSim executable (using PyInstaller) and packaging eSim for Windows 8 and above. > Note: Do not develop eSim on Windows OS. Work only with `installers` branch on Windows OS and do development on Linux OS. > Reference : https://stackoverflow.com/questions/37672886/cannot-get-rid-of-unstaged-files-in-git-on-my-local ## eSim Executable: 1. Download and install "Python-3.6.8", "Git For Windows". Use "Git Bash" for all following shell commands. Ensure that `tcl/tk` (`tkinter`) is also installed with Python as it is required by `matplotlib` dependency Reference - https://gitforwindows.org/ 2. Add alias to python.exe in Git shell: $ alias python='winpty python.exe' #Need to be done for each new shell created 3. Download `virtualenv` package as: $ pip install virtualenv 4. Create a virtual environment as: $ virtualenv eSim 5. Activate the virtual environment as: $ source eSim/Scripts/activate 6. Install the following Python dependencies through pip for eSim within the virtual environment: $ pip install pyinstaller matplotlib==3.0.3 tornado setuptools $ pip install PyQt5==5.9.2 pypiwin32 psutil $ pip install watchdog hdlparse 7. Test whether only eSim dependencies are available or not: $ pip freeze 8. Create spec file as: $ pyi-makespec --onefile -n eSim /src/frontEnd/Application.py --icon= 9. Create onefile executable using pyinstaller as: $ pyinstaller -F --clean eSim.spec 10. Verify whether all eSim `src` files (`*.py`) have been included in `Analysis-00.toc` file under the build folder generated by PyInstaller. ## How to package eSim? 1. Take the `master` branch of eSim. Rename the folder to `eSim`. 2. Add eSim executable (`eSim.exe`) to the `eSim` folder. Also, remove following files from that folder: - `.git` folder - `code` folder - `src` folder - conf.py - setup.py - index.rst - requirement.txt - .gitignore - .travis.yml - INSTALL - library/modelParamXML/Nghdl/.gitignore - library/modelParamXML/Ngveri/.gitignore - `library/browser/User-Manual/figures` folder - library/browser/User-Manual/eSim.html 3. Remove following from `eSim\library\kicadLibrary` folder as same will be repeated in KiCad installer: - entire `library` folder - everything from `modules` folder except `Connectors_Terminal_Blocks.pretty/TerminalBlock_Altech_AK300-2_P5.00mm.kicad_mod` and `TO_SOT_Packages_THT.pretty/TO-220-3_Vertical.kicad_mod` - everything from `temmplate` folder except `kicad.pro` file Now, compress it in zip format (`kicadLibrary.zip`), place it at `eSim/library` and delete that folder. 4. Update the ``image`` directory path in the `library/browser/welcome.html` as: From `src="../../images/logo.png"` to `src="images/logo.png"` 5. Add eSim user manual `eSim_Manual_.pdf` at location `library/browser/User-Manual`. 6. Replace `LICENSE` file with `LICENSE.rtf` file in `eSim` folder. 7. Compress `eSim` folder in 7z format and add it to the installer folder (Make sure that there is folder named `eSim` inside this compressed file). 8. Add the dependencies for `NGHDL` to the installer folder. > Note: Refer this [documentation](https://github.com/fossee/nghdl/tree/installers/Windows/README.md) on packaging NGHDL for Windows OS. 9. Apply NSIS plugins. Refer [here](https://github.com/fossee/nghdl/tree/installers/Windows/NSISplugins/) for the same. 10. Add KiCad installer `kicad-4.0.7-i686.exe` to the installer folder. > Note: Refer this [documentation](https://github.com/fossee/KiCad-eSim/blob/executables/README.md) on packaging KiCad for Windows OS 11. Add following files/folder to the installer folder: - License file (`rtf` format) - Logo (`ico` format) - `esim-setup-script` file - Makerchip executables (`makerchip.7z` file) > Note: Refer this [documentation](https://github.com/fossee/tree/installers/Windows/Makerchip-Build.md) on packaging Makerchip-App and Sandpiper SaaS for Windows OS - `nghdl-setup-script` file from the `NGHDL` repository 12. Compile the NSI script (`esim-setup-script` file). Now only use the generated installer for distribution. > Note: If there is any warning on `Eliminating "zeroing code out"`, then have a look at this reference - https://nsis-dev.github.io/NSIS-Forums/html/t-358040.html