summaryrefslogtreecommitdiff
path: root/Windows/README.md
blob: e9cd867375064fd6e87920d04810056406ea7aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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 <path_to_eSim>/src/frontEnd/Application.py --icon=<path_to_eSim_logo>

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_<version>.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