diff options
Diffstat (limited to 'Windows')
-rw-r--r-- | Windows/README.md (renamed from Windows/readme.md) | 25 | ||||
-rw-r--r-- | Windows/esim-setup-script.nsi | 78 |
2 files changed, 63 insertions, 40 deletions
diff --git a/Windows/readme.md b/Windows/README.md index cd8ff979..8dae6dc1 100644 --- a/Windows/readme.md +++ b/Windows/README.md @@ -7,6 +7,7 @@ It contains all the documenation for making eSim executable (using PyInstaller) > 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.5.2", "Git For Windows". Use "Git Bash" for all following shell commands. @@ -88,27 +89,24 @@ It contains all the documenation for making eSim executable (using PyInstaller) > - six > - cycler.py -8. Download eSim Manual from eSim website, add it to `library/browser/User-Manual/` and update the file name of Manual in `src/browser/UserManual.py` accordingly. - -9. Create spec file as: +8. Create spec file as: $ pyi-makespec --onefile -n eSim <path_to_eSim>/src/frontEnd/Application.py --icon=<path_to_eSim_logo> -10. Create onefile executable using pyinstaller as: +9. Create onefile executable using pyinstaller as: $ pyinstaller -F --clean eSim.spec -11. Verify whether all eSim `src` files (`*.py`) have been included in `Analysis-00.toc` file under the build folder generated by PyInstaller. - +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. Update `VERSION` file to this release number. Also, update version number in NSI script and `Installation.txt` file. +1. Take the `master` branch of eSim. Rename the folder to `eSim`. 2. Compress `spice` folder in zip format (Make sure that there is folder named `spice` inside this compressed file). -3. Add eSim executable file to the eSim source folder. Also, remove following files from the eSim source folder: +3. Add eSim executable to the `eSim` folder. Also, remove following files from that folder: - `.git` folder - `code` folder - `src` folder @@ -118,15 +116,12 @@ It contains all the documenation for making eSim executable (using PyInstaller) - requirement.txt - .gitignore - .travis.yml - - `Examples\NGHDL_Examples\` folder - -4. Remove `eSim_Nghdl.lib` file from `eSim\library\kicadLibrary\kicad_eSim-Library\`. Also, remove `library` folder, duplicate files from `template` and `modules` folders under `eSim\library\kicadLibary\`. -5. Now, compress `eSim\library\kicadLibrary` in zip format, place it at `eSim\library` and delete that folder. +4. Now, compress `eSim\library\kicadLibrary` in zip format, place it at `eSim\library` and delete that folder. -6. Compress `eSim` folder in zip format (Make sure that there is folder named `eSim` inside this compressed file). +5. Compress `eSim` folder in zip format (Make sure that there is folder named `eSim` inside this compressed file). -7. Add following files/folder to the installer folder: +6. Add following files/folder to the installer folder: - KiCad installer. - License file (`rtf` format). - Logo (`ico` format). @@ -134,4 +129,4 @@ It contains all the documenation for making eSim executable (using PyInstaller) - eSim (compressed file in `zip` format) containing eSim folder. - `esim-setup-script` file. -8. Compile the NSI script (`esim-setup-script` file). Now only use the generated installer for distribution. +7. Compile the NSI script (`esim-setup-script` file). Now only use the generated installer for distribution. diff --git a/Windows/esim-setup-script.nsi b/Windows/esim-setup-script.nsi index 87f54bee..daaf4cc1 100644 --- a/Windows/esim-setup-script.nsi +++ b/Windows/esim-setup-script.nsi @@ -8,7 +8,6 @@ !include "MUI2.nsh" !include "ZipDLL.nsh" - !include "EnvVarUpdate.nsh" !include "x64.nsh" ;-------------------------------- @@ -169,18 +168,14 @@ Section -NgspiceSim SetOutPath "$EXEDIR" - File "spice.zip" - File "eSim.zip" + File "eSim.7z" File "logo.ico" SetOutPath "$INSTDIR" - ;ADD YOUR OWN FILES HERE... - ZipDLL::extractall "$EXEDIR\spice.zip" "$INSTDIR\" - ZipDLL::extractall "$EXEDIR\eSim.zip" "$INSTDIR\" + ;ADD YOUR OWN FILES HERE... + Nsis7z::ExtractWithDetails "$EXEDIR\eSim.7z" "Extracting eSim %s..." - ;Setting Env Variable for Ngspice - ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\spice\bin" ;Copying Folder to install directory SetOutPath "$INSTDIR\eSim" @@ -208,12 +203,13 @@ Section -NgspiceSim ;create desktop shortcut CreateShortCut "$PROFILE\..\Public\Desktop\eSim.lnk" "$INSTDIR\eSim\eSim" "" "$PROFILE\.esim\logo.ico" "" SW_SHOWMINIMIZED + !insertmacro MUI_STARTMENU_WRITE_END + ;Remove not required files - Delete "$EXEDIR\spice.zip" - Delete "$EXEDIR\eSim.zip" + Delete "$EXEDIR\eSim.7z" Delete "$EXEDIR\logo.ico" - !insertmacro MUI_STARTMENU_WRITE_END + SectionEnd @@ -233,11 +229,14 @@ Section -InstallKiCad Goto endActiveSync endActiveSync: - ;Remove not required files - Delete "$EXEDIR\kicad-4.0.7-i686.exe" - Delete "$PROFILE\..\Public\Desktop\KiCad.lnk" + ;Remove not required files + Delete "$EXEDIR\kicad-4.0.7-i686.exe" + Delete "$PROFILE\..\Public\Desktop\KiCad.lnk" - ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\KiCad\bin" + EnVar::SetHKLM + EnVar::AddValue "Path" "$INSTDIR\KiCad\bin" + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" ZipDLL::extractall "$INSTDIR\eSim\library\kicadLibrary.zip" "$INSTDIR\eSim\library\" @@ -266,7 +265,7 @@ Section -InstallKiCad RMDir /r "$INSTDIR\eSim\library\kicadLibrary" SectionEnd - + Section -AdditionalIcons @@ -276,6 +275,7 @@ Section -AdditionalIcons SectionEnd +!include "installnghdl.nsi" Section -Post @@ -300,14 +300,48 @@ FunctionEnd Section Uninstall + ; Set to HKLM + EnVar::SetHKLM + + GetFullPathName $1 $INSTDIR\..\eSim\nghdl\src + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\mingw64\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\mingw64\msys\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\mingw64\GHDL\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + GetFullPathName $1 $INSTDIR\..\ngspice-nghdl\install_dir\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" + + RMDir /r "$INSTDIR\..\mingw64" + RMDir /r "$INSTDIR\..\ngspice-nghdl" + RMDir /r "$INSTDIR\..\eSim\nghdl" + ;Note that in uninstaller code, $INSTDIR contains the directory where the uninstaller lies Delete "$INSTDIR\uninst-eSim.exe" Delete "$SMPROGRAMS\eSim\Uninstall.lnk" ;Removing Env Variable for KiCad - GetFullPathName $0 $INSTDIR\..\KiCad\bin - ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" $0 + GetFullPathName $1 $INSTDIR\..\KiCad\bin + EnVar::DeleteValue "Path" $1 + Pop $0 + DetailPrint "EnVar::AddValue returned=|$0|" ;Remove KiCad config RMDir /r "$PROFILE\AppData\Roaming\kicad" @@ -318,17 +352,11 @@ Section Uninstall Goto endActiveSync endActiveSync: - ;Removing Env Variable for Ngspice - GetFullPathName $0 $INSTDIR\..\spice\bin - ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" $0 - - ;Removing Ngspice - RMDir /r "$INSTDIR\..\spice" - ;Removing eSim RMDir /r "$PROFILE\.esim" RMDir "$SMPROGRAMS\eSim" RMDir /r "$INSTDIR\..\eSim" + RMDir /r "$INSTDIR\..\KiCad" Delete "$PROFILE\..\Public\Desktop\eSim.lnk" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" |