From 32aaf7101c7b04b4dd44dd6dac69fbb2ae3ba0f3 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Fri, 31 Jul 2020 23:18:28 +0530 Subject: building KiCad installer for eSim-Windows --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index bfb9e7e..0346ef6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # KiCad-eSim This repository is maintained by FOSSEE team for KiCad v4.0.7 + +## Creating KiCad installer for eSim + +1. Download the KiCad installer from - https://kicad-downloads.s3.cern.ch/windows/stable/kicad-4.0.7-i686.exe + +2. Install KiCad from the executable [kicad-4.0.7-i686.exe] downloaded in step 1 at preferred location. Henceforth this location is to be referred to as `installdirectory`. + +3. Clone the folder `nsis` present in this reporsitory and place it at the Kicad install location, i.e. installdirectory/. + +4. Delete the folder `packages3d` present at the location installdirectory/share/kicad/modules/. + +5. Compress the folders `bin`, `lib`, `share` and `ssl` into file named **KiCad.7z**. This file should be placed at `installdirectory`.\ +(7z compresssion tool can be obtained at - https://www.7-zip.org/download.html ) + +6. Goto the nsis folder and compile the script `install.nsi`.\ +(NSIS compiler can be obtained at - https://prdownloads.sourceforge.net/nsis/nsis-3.05-setup.exe?download) + +7. Use the generated `kicad-4.0.7-i686.exe` as the default installer for KiCad when building installer for eSim. + +8. Uninstall the KiCad used to build this installer. -- cgit From bc6432e2b71d91fb2eeb69ba087de245b7693291 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Fri, 31 Jul 2020 23:20:51 +0530 Subject: KiCad installer for eSim-Windows --- NSIS/install.nsi | 216 +++++++++++++++++++++++++++++++++---------------- NSIS/kicad-header.bmp | Bin 0 -> 25818 bytes NSIS/kicad-header.svg | 143 ++++++++++++++++++++++++++++++++ NSIS/kicad-welcome.bmp | Bin 0 -> 154542 bytes NSIS/kicad-welcome.svg | 153 +++++++++++++++++++++++++++++++++++ 5 files changed, 441 insertions(+), 71 deletions(-) create mode 100644 NSIS/kicad-header.bmp create mode 100644 NSIS/kicad-header.svg create mode 100644 NSIS/kicad-welcome.bmp create mode 100644 NSIS/kicad-welcome.svg diff --git a/NSIS/install.nsi b/NSIS/install.nsi index 5e93e99..b004a89 100644 --- a/NSIS/install.nsi +++ b/NSIS/install.nsi @@ -1,23 +1,30 @@ ; Installation script for KiCad generated by Alastair Hoyle ; -; This installation script requires NSIS (Nullsoft Scriptable Install System) version 2.18 http://nsis.sourceforge.net/Main_Page -; This script was created with HM NIS Edit version 2.0.3 http://hmne.sourceforge.net/ +; This installation script requires NSIS (Nullsoft Scriptable Install System) +; version 3.x http://nsis.sourceforge.net/Main_Page +; +; This script is provided as is with no warranties. ; -; This script is provided as is with no warranties and has only been tested on Windows XP. ; Copyright (C) 2006 Alastair Hoyle -; This program is free software; you can redistribute it and/or modify it under the terms of the -; GNU General Public License as published by the Free Software Foundation. This program is distributed -; in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +; Copyright (C) 2015 Nick Østergaard +; Copyright (C) 2015 Brian Sidebotham +; +; This program is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the Free +; Software Foundation. This program is distributed in the hope that it will be +; useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +; Public License for more details. ; -; This script should be in a subdirectory of the full build directory (Kicad/NSIS by default) -; When the build is updated the product and installer versions should be updated before recompiling the installation file +; This script should be in a subdirectory of the full build directory +; (Kicad/NSIS by default). When the build is updated the product and installer +; versions should be updated before recompiling the installation file ; -; This script expects the install.ico, uninstall.ico, language and license files to be in the same directory as this script +; This script expects the install.ico, uninstall.ico, language and license +; files to be in the same directory as this script ; General Product Description Definitions !define PRODUCT_NAME "KiCad" -!define PRODUCT_VERSION "2014.03.05" !define ALT_DOWNLOAD_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" !define LIBRARIES_WEB_SITE "https://github.com/KiCad/" !define KICAD_MAIN_SITE "www.kicad-pcb.org/" @@ -32,18 +39,41 @@ !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define UNINST_ROOT "HKLM" +!define gflag ;Needed to use ifdef and such +;Define on command line //DPRODUCT_VERSION=42 +!ifndef PRODUCT_VERSION + !define PRODUCT_VERSION "4.0.7" +!endif + +!ifndef OPTION_STRING + !define OPTION_STRING "i686" +!endif ;Comment out the following SetCompressor command while testing this script ;SetCompressor /final /solid lzma CRCCheck force -XPStyle on +;XPStyle on Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "${PRODUCT_NAME}_stable-${PRODUCT_VERSION}-BZR4xxx_Win_full_version.exe" -;InstallDir "$PROGRAMFILES\KiCad" -InstallDir "C:\KiCad" -ShowInstDetails hide -ShowUnInstDetails hide + +!ifndef OUTFILE + !define OUTFILE "kicad-${PRODUCT_VERSION}-${OPTION_STRING}.exe" +!endif +OutFile ${OUTFILE} + +; Request that we are executed as admin rights so we can install into +; PROGRAMFILES without ending up in the virtual store +RequestExecutionLevel admin + +!if ${ARCH} == 'x86_64' + InstallDir "$PROGRAMFILES64\KiCad" +!else + InstallDir "$PROGRAMFILES\KiCad" +!endif + +ShowInstDetails show +ShowUnInstDetails show +BrandingText "KiCad installer for windows" ; MUI 1.67 compatible ------ !include "MUI.nsh" @@ -52,6 +82,9 @@ ShowUnInstDetails hide !define MUI_ABORTWARNING !define MUI_ICON "install.ico" !define MUI_UNICON "uninstall.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "kicad-header.bmp" ; optional +!define MUI_WELCOMEFINISHPAGE_BITMAP "kicad-welcome.bmp" ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${UNINST_ROOT}" @@ -61,6 +94,8 @@ ShowUnInstDetails hide ; Installer pages !define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit !define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGuiInit +!define MUI_WELCOMEPAGE_TEXT $(WELCOME_PAGE_TEXT) +;!define MUI_WELCOMEPAGE_TEXT "test" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE $(MUILicense) !insertmacro MUI_PAGE_COMPONENTS @@ -79,33 +114,58 @@ ShowUnInstDetails hide ; - To add another language; add an insert macro line here and include a language file as below ; - This must be after all page macros have been inserted !insertmacro MUI_LANGUAGE "English" ;first language is the default language -!insertmacro MUI_LANGUAGE "French" -!insertmacro MUI_LANGUAGE "Italian" -!insertmacro MUI_LANGUAGE "Polish" -!insertmacro MUI_LANGUAGE "Portuguese" -!insertmacro MUI_LANGUAGE "Dutch" -!insertmacro MUI_LANGUAGE "Russian" -!insertmacro MUI_LANGUAGE "Japanese" +;!insertmacro MUI_LANGUAGE "French" +;!insertmacro MUI_LANGUAGE "Italian" +;!insertmacro MUI_LANGUAGE "Polish" +;!insertmacro MUI_LANGUAGE "Portuguese" +;!insertmacro MUI_LANGUAGE "Dutch" +;!insertmacro MUI_LANGUAGE "Russian" +;!insertmacro MUI_LANGUAGE "Japanese" !include "English.nsh" -!include "French.nsh" -!include "Dutch.nsh" -!include "Italian.nsh" -!include "Japanese.nsh" -!include "Polish.nsh" -!include "Portuguese.nsh" -!include "Russian.nsh" +;!include "French.nsh" +;!include "Dutch.nsh" +;!include "Italian.nsh" +;!include "Japanese.nsh" +;!include "Polish.nsh" +;!include "Portuguese.nsh" +;!include "Russian.nsh" ; MUI end ------ Function .onInit - ReserveFile "install.ico" - ReserveFile "uninstall.ico" - ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll" - ReserveFile "${NSISDIR}\Plugins\LangDLL.dll" - ReserveFile "${NSISDIR}\Plugins\System.dll" - ReserveFile "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini" - !insertmacro MUI_LANGDLL_DISPLAY + ; Request that we get elevated rights to install so that we don't end up in + ; the virtual store + ClearErrors + UserInfo::GetName + IfErrors Win9x + Pop $0 + UserInfo::GetAccountType + Pop $1 + UserInfo::GetOriginalAccountType + Pop $2 + StrCmp $1 "Admin" 0 AdminQuit + Goto LangDisplay + + AdminQuit: + MessageBox MB_OK "Admin rights are required to install KiCad!" + Quit + + LangDisplay: + ReserveFile "install.ico" + ReserveFile "uninstall.ico" + ReserveFile "${NSISDIR}\Plugins\x86-unicode\InstallOptions.dll" + ReserveFile "${NSISDIR}\Plugins\x86-unicode\LangDLL.dll" + ReserveFile "${NSISDIR}\Plugins\x86-unicode\System.dll" + ReserveFile "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini" + !insertmacro MUI_LANGDLL_DISPLAY + Goto done + + Win9x: + MessageBox MB_OK "Error! This can't run under Windows 9x!" + Quit + + done: FunctionEnd Function myGuiInit @@ -119,47 +179,58 @@ Function ModifyFinishPage !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0" ;hide cancel button - already installed!! FunctionEnd -Section $(TITLE_SEC01) SEC01 +Section $(TITLE_SEC_MAIN) SEC01 SectionIn RO SetOverwrite try SetOutPath "$INSTDIR" File /nonfatal "..\AUTHORS.txt" File /nonfatal "..\COPYRIGHT.txt" File /nonfatal "..\license_for_documentation.txt" + + ;------20.July.2020 - BM - Package Kicad internal fles as .7z to reduce size---------- + File "..\KiCad.7z" + Nsis7z::ExtractWithDetails "$INSTDIR\KiCad.7z" "Extracting KiCad %s..." + Delete $INSTDIR\KiCad.7z + SetOutPath "$INSTDIR\share\kicad\template" - File /nonfatal /r "..\share\kicad\template\*" + ;File /nonfatal /r "..\share\kicad\template\*" SetOutPath "$INSTDIR\bin" - File /r "..\bin\*" + ;File /r "..\bin\*" + SetOutPath "$INSTDIR\lib" + ;File /r "..\lib\*" SetOutPath "$INSTDIR\share\kicad\internat" - File /r "..\share\kicad\internat\*" + ;File /nonfatal /r "..\share\kicad\internat\*" SectionEnd -Section $(TITLE_SEC02) SEC02 +Section $(TITLE_SEC_SCHLIB) SEC02 SetOverwrite try - SetOutPath "$INSTDIR\share\library" - File /nonfatal /r "..\share\library\*" - SetOutPath "$INSTDIR\share\modules" - File /nonfatal /r "..\share\modules\*" + SetOutPath "$INSTDIR\share\kicad\library" + ;File /nonfatal /r "..\share\kicad\library\*" SectionEnd -Section $(TITLE_SEC03) SEC03 +Section $(TITLE_SEC_FPLIB) SEC03 + SetOverwrite try + SetOutPath "$INSTDIR\share\kicad\modules" + ;File /nonfatal /r "..\share\kicad\modules\*" +SectionEnd + +Section $(TITLE_SEC_DEMOS) SEC04 SetOverwrite try SetOutPath "$INSTDIR\share\kicad\demos" - File /nonfatal /r "..\share\kicad\demos\*" + ;File /nonfatal /r "..\share\kicad\demos\*" SetOutPath "$INSTDIR\share\doc\kicad\tutorials" - File /nonfatal /r "..\share\doc\kicad\tutorials\*" + ;File /nonfatal /r "..\share\doc\kicad\tutorials\*" SectionEnd -Section $(TITLE_SEC04) SEC04 +Section $(TITLE_SEC_DOCS) SEC05 SetOverwrite try SetOutPath "$INSTDIR\share\doc\kicad\help" - File /nonfatal /r "..\share\doc\kicad\help\*" + ;File /nonfatal /r "..\share\doc\kicad\help\*" SectionEnd Section -CreateShortcuts SetOutPath $INSTDIR WriteIniStr "$INSTDIR\HomePage.url" "InternetShortcut" "URL" "${KICAD_MAIN_SITE}" - WriteIniStr "$INSTDIR\AltDownloadSite.url" "InternetShortcut" "URL" "${ALT_DOWNLOAD_WEB_SITE}" WriteIniStr "$INSTDIR\UserGroup.url" "InternetShortcut" "URL" "${HELP_WEB_SITE}" WriteIniStr "$INSTDIR\DevelGroup.url" "InternetShortcut" "URL" "${DEVEL_WEB_SITE}" WriteIniStr "$INSTDIR\LibrariesGroup.url" "InternetShortcut" "URL" "${LIBRARIES_WEB_SITE}" @@ -167,13 +238,19 @@ Section -CreateShortcuts SetShellVarContext all CreateDirectory "$SMPROGRAMS\KiCad" CreateShortCut "$SMPROGRAMS\KiCad\Home Page.lnk" "$INSTDIR\HomePage.url" - CreateShortCut "$SMPROGRAMS\KiCad\Kicad Alternate Download.lnk" "$INSTDIR\AltDownloadSite.url" - CreateShortCut "$SMPROGRAMS\KiCad\Kicad Libraries.lnk" "$INSTDIR\LibrariesGroup.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad Alternate Download.lnk" "$INSTDIR\AltDownloadSite.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad Libraries.lnk" "$INSTDIR\LibrariesGroup.url" CreateShortCut "$SMPROGRAMS\KiCad\Wings3D.lnk" "$INSTDIR\Wings3D.url" - CreateShortCut "$SMPROGRAMS\KiCad\User Group.lnk" "$INSTDIR\UserGroup.url" - CreateShortCut "$SMPROGRAMS\KiCad\Devel Group.lnk" "$INSTDIR\DevelGroup.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad User Group.lnk" "$INSTDIR\UserGroup.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad Devel Group.lnk" "$INSTDIR\DevelGroup.url" CreateShortCut "$SMPROGRAMS\KiCad\Uninstall.lnk" "$INSTDIR\uninstaller.exe" CreateShortCut "$SMPROGRAMS\KiCad\KiCad.lnk" "$INSTDIR\bin\kicad.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Eeschema.lnk" "$INSTDIR\bin\eeschema.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Pcbnew.lnk" "$INSTDIR\bin\pcbnew.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Gerbview.lnk" "$INSTDIR\bin\gerbview.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Bitmap2component.lnk" "$INSTDIR\bin\bitmap2component.exe" + CreateShortCut "$SMPROGRAMS\KiCad\PCB calculator.lnk" "$INSTDIR\bin\pcb_calculator.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Pagelayout editor.lnk" "$INSTDIR\bin\pl_editor.exe" CreateShortCut "$DESKTOP\KiCad.lnk" "$INSTDIR\bin\kicad.exe" SectionEnd @@ -195,10 +272,11 @@ Section -CreateAddRemoveEntry SectionEnd !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC01) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC02) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC03) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC04) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC_MAIN) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC_SCHLIB) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC_FPLIB) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC_DEMOS) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC_DOCS) !insertmacro MUI_FUNCTION_DESCRIPTION_END Function un.onInit @@ -241,6 +319,7 @@ Section Uninstall ;remove all program files now RMDir /r "$INSTDIR\bin" + RMDir /r "$INSTDIR\lib" RMDir /r "$INSTDIR\library" RMDir /r "$INSTDIR\modules" RMDir /r "$INSTDIR\template" @@ -255,7 +334,12 @@ Section Uninstall RMDir /r "$INSTDIR\share\kicad\demos" RMDir /r "$INSTDIR\share\doc\kicad\tutorials" RMDir /r "$INSTDIR\share\doc\kicad\help" + RMDir /r "$INSTDIR\share\doc\kicad" + RMDir /r "$INSTDIR\share\doc" + RMDir /r "$INSTDIR\share" RMDir /r "$INSTDIR\wings3d" + + RMDir /r "$INSTDIR\ssl" ;don't remove $INSTDIR recursively just in case the user has installed it in c:\ or ;c:\program files as this would attempt to delete a lot more than just this package Delete "$INSTDIR\*.txt" @@ -270,16 +354,6 @@ Section Uninstall SetAutoClose true SectionEnd -;Setup.exe file version information - VIProductVersion "${PRODUCT_VERSION}.01" ;must be in x.x.x.x format - product version plus last digit for installer version number - VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_NAME}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "${COMMENTS}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${COMPANY_NAME}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "${TRADE_MARKS}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© ${COPYRIGHT}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${PRODUCT_NAME} Installer" - VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" - Function PreventMultiInstances System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e' Pop $R0 diff --git a/NSIS/kicad-header.bmp b/NSIS/kicad-header.bmp new file mode 100644 index 0000000..d602b4c Binary files /dev/null and b/NSIS/kicad-header.bmp differ diff --git a/NSIS/kicad-header.svg b/NSIS/kicad-header.svg new file mode 100644 index 0000000..bf77a4c --- /dev/null +++ b/NSIS/kicad-header.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/NSIS/kicad-welcome.bmp b/NSIS/kicad-welcome.bmp new file mode 100644 index 0000000..ec1d333 Binary files /dev/null and b/NSIS/kicad-welcome.bmp differ diff --git a/NSIS/kicad-welcome.svg b/NSIS/kicad-welcome.svg new file mode 100644 index 0000000..0bab8aa --- /dev/null +++ b/NSIS/kicad-welcome.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit From 0b8021d0523323b6d4171f709bb91bc2a43a0db8 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Fri, 31 Jul 2020 23:23:34 +0530 Subject: NSIS plugin for 7z extraction --- NSIS/Nsis7z_19.00.7z | Bin 0 -> 461078 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 NSIS/Nsis7z_19.00.7z diff --git a/NSIS/Nsis7z_19.00.7z b/NSIS/Nsis7z_19.00.7z new file mode 100644 index 0000000..78d88ab Binary files /dev/null and b/NSIS/Nsis7z_19.00.7z differ -- cgit From 940f5aaa294ac461a2533328a67c259fa1d63555 Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Sat, 1 Aug 2020 12:29:21 +0530 Subject: building KiCad installer for eSim-Windows --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0346ef6..91e723f 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ # KiCad-eSim This repository is maintained by FOSSEE team for KiCad v4.0.7 -## Creating KiCad installer for eSim +## Building KiCad installer for eSim 1. Download the KiCad installer from - https://kicad-downloads.s3.cern.ch/windows/stable/kicad-4.0.7-i686.exe 2. Install KiCad from the executable [kicad-4.0.7-i686.exe] downloaded in step 1 at preferred location. Henceforth this location is to be referred to as `installdirectory`. -3. Clone the folder `nsis` present in this reporsitory and place it at the Kicad install location, i.e. installdirectory/. +3. Clone the folder `NSIS` present in this repository and place it at the KiCad install location, i.e. installdirectory/. 4. Delete the folder `packages3d` present at the location installdirectory/share/kicad/modules/. -5. Compress the folders `bin`, `lib`, `share` and `ssl` into file named **KiCad.7z**. This file should be placed at `installdirectory`.\ +5. Compress the folders `bin`, `lib`, `share` and `ssl` into file named **KiCad.7z**. This file should be placed at `installdirectory/`.\ (7z compresssion tool can be obtained at - https://www.7-zip.org/download.html ) -6. Goto the nsis folder and compile the script `install.nsi`.\ +6. Goto the `NSIS` folder and compile the script `install.nsi`.\ (NSIS compiler can be obtained at - https://prdownloads.sourceforge.net/nsis/nsis-3.05-setup.exe?download) -7. Use the generated `kicad-4.0.7-i686.exe` as the default installer for KiCad when building installer for eSim. +7. Use the generated `kicad-4.0.7-i686.exe` in the `NSIS` folder as the default installer for KiCad when building installer for eSim. 8. Uninstall the KiCad used to build this installer. -- cgit From a0938b0c0c37999260e4cf6889b3aba18a3cfc8b Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Wed, 12 Aug 2020 12:30:31 +0530 Subject: merge kicad latest installer script with older script --- NSIS/English.nsh | 55 +++++-- NSIS/install.nsi | 422 ++++++++++++++++++++++++++++++++++++++----------- NSIS/kicad-header.bmp | Bin 0 -> 25818 bytes NSIS/kicad-welcome.bmp | Bin 0 -> 154542 bytes 4 files changed, 374 insertions(+), 103 deletions(-) create mode 100644 NSIS/kicad-header.bmp create mode 100644 NSIS/kicad-welcome.bmp diff --git a/NSIS/English.nsh b/NSIS/English.nsh index c3b5263..b28d51f 100644 --- a/NSIS/English.nsh +++ b/NSIS/English.nsh @@ -3,26 +3,61 @@ ;File name of license file LicenseLangString MUILicense ${LANG_ENGLISH} "..\COPYRIGHT.txt" +;Welcome page +LangString WELCOME_PAGE_TEXT ${LANG_ENGLISH} "This installer will guide you through the installation of KiCad ${PRODUCT_VERSION}.$\r$\n$\r$\n\ +It is not required to close any other applications before starting the installer, neither is it necessary to reboot your computer.$\r$\n$\r$\n\ +This is free open source software licensed under the GPL.$\r$\n$\r$\n\ +Click Next to continue." + +;Error messages +LangString ERROR_ADMIN_REQ ${LANG_ENGLISH} "Admin rights are required to install KiCad!" +LangString ERROR_WIN9X ${LANG_ENGLISH} "Error! This can't run under Windows 9x!" + +;Other languages +LangString LANGUAGE_NAME_EN ${LANG_ENGLISH} "English" +LangString LANGUAGE_NAME_DE ${LANG_ENGLISH} "German" +LangString LANGUAGE_NAME_ES ${LANG_ENGLISH} "Spanish" +LangString LANGUAGE_NAME_FR ${LANG_ENGLISH} "French" +LangString LANGUAGE_NAME_IT ${LANG_ENGLISH} "Italian" +LangString LANGUAGE_NAME_JA ${LANG_ENGLISH} "Japanese" +LangString LANGUAGE_NAME_NL ${LANG_ENGLISH} "Dutch" +LangString LANGUAGE_NAME_PL ${LANG_ENGLISH} "Polish" + ;Component option -LangString TITLE_SEC01 ${LANG_ENGLISH} "Main application" -LangString TITLE_SEC02 ${LANG_ENGLISH} "Libraries and components" -LangString TITLE_SEC03 ${LANG_ENGLISH} "Demonstration projects" -LangString TITLE_SEC04 ${LANG_ENGLISH} "Help files" +LangString TITLE_SEC_MAIN ${LANG_ENGLISH} "Main application" +LangString TITLE_SEC_SCHLIB ${LANG_ENGLISH} "Schematic libraries" +LangString TITLE_SEC_FPLIB ${LANG_ENGLISH} "Footprint libraries" +LangString TITLE_SEC_FPWIZ ${LANG_ENGLISH} "Footprint wizards" +LangString TITLE_SEC_DEMOS ${LANG_ENGLISH} "Demonstration projects" +LangString TITLE_SEC_DOCS ${LANG_ENGLISH} "Help files" +LangString TITLE_SEC_ENV ${LANG_ENGLISH} "Environment variables" ;Component option descriptions -LangString DESC_SEC01 ${LANG_ENGLISH} "Main application files." -LangString DESC_SEC02 ${LANG_ENGLISH} "Libraries and components are required unless they have been previously installed." -LangString DESC_SEC03 ${LANG_ENGLISH} "Some demonstration projects and tutorials." -LangString DESC_SEC04 ${LANG_ENGLISH} "Help files in pdf format." +LangString DESC_SEC_MAIN ${LANG_ENGLISH} "Main application files." +LangString DESC_SEC_SCHLIB ${LANG_ENGLISH} "Schematic libraries are required unless they have been previously installed." +LangString DESC_SEC_FPLIB ${LANG_ENGLISH} "Footprint libraries are required unless they have been previously installed." +LangString DESC_SEC_FPWIZ ${LANG_ENGLISH} "Default python based footprint wizards available in the footprint editor. This is an experimental feature on windows." +LangString DESC_SEC_DEMOS ${LANG_ENGLISH} "Some demonstration projects and tutorials." +LangString DESC_SEC_DOCS ${LANG_ENGLISH} "Help files in PDF format." +LangString DESC_SEC_DOCS_EN ${LANG_ENGLISH} "$(LANGUAGE_NAME_EN) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_DOCS_DE ${LANG_ENGLISH} "$(LANGUAGE_NAME_DE) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_DOCS_ES ${LANG_ENGLISH} "$(LANGUAGE_NAME_ES) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_DOCS_FR ${LANG_ENGLISH} "$(LANGUAGE_NAME_FR) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_DOCS_IT ${LANG_ENGLISH} "$(LANGUAGE_NAME_IT) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_DOCS_JA ${LANG_ENGLISH} "$(LANGUAGE_NAME_JA) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_DOCS_NL ${LANG_ENGLISH} "$(LANGUAGE_NAME_NL) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_DOCS_PL ${LANG_ENGLISH} "$(LANGUAGE_NAME_PL) $(TITLE_SEC_DOCS)" +LangString DESC_SEC_ENV ${LANG_ENGLISH} "Sets KISYSMOD, KISYS3DMOD and KICAD_PTEMPLATES environment variables to default install paths." ;General messages LangString WINGS3D_PROMPT ${LANG_ENGLISH} "To edit or create 3D object models you need to install Wings3D. \ Wings3D and user manual can be download free from the Wings3D web page Check this box to open the Wings3D web page" LangString UNINST_PROMPT ${LANG_ENGLISH} "Are you sure you want to completely remove $(^Name) and all of its components? $\n\ -This will also remove all modified and new files, libraries and modules in the program directory" +This will also remove all modified and new files, libraries and modules in the program directory \ +(including python modules installed by user)!" LangString UNINST_SUCCESS ${LANG_ENGLISH} "$(^Name) was successfully removed from your computer." LangString INSTALLER_RUNNING ${LANG_ENGLISH} "The installer is already running." LangString UNINSTALLER_RUNNING ${LANG_ENGLISH} "The uninstaller is already running." -LangString ALREADY_INSTALLED ${LANG_ENGLISH} "${PRODUCT_NAME} is already installed. Install this package will overwrite existing files. Do you want to continue?" +LangString ALREADY_INSTALLED ${LANG_ENGLISH} "${PRODUCT_NAME} is already installed. Installing this package will overwrite existing files. Do you want to continue?" diff --git a/NSIS/install.nsi b/NSIS/install.nsi index 5e93e99..eebf812 100644 --- a/NSIS/install.nsi +++ b/NSIS/install.nsi @@ -1,57 +1,98 @@ ; Installation script for KiCad generated by Alastair Hoyle ; -; This installation script requires NSIS (Nullsoft Scriptable Install System) version 2.18 http://nsis.sourceforge.net/Main_Page -; This script was created with HM NIS Edit version 2.0.3 http://hmne.sourceforge.net/ +; This installation script requires NSIS (Nullsoft Scriptable Install System) +; version 3.x http://nsis.sourceforge.net/Main_Page +; +; This script is provided as is with no warranties. ; -; This script is provided as is with no warranties and has only been tested on Windows XP. ; Copyright (C) 2006 Alastair Hoyle -; This program is free software; you can redistribute it and/or modify it under the terms of the -; GNU General Public License as published by the Free Software Foundation. This program is distributed -; in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +; Copyright (C) 2015 Nick Østergaard +; Copyright (C) 2015 Brian Sidebotham +; Copyright (C) 2016 Bevan Weiss +; +; This program is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the Free +; Software Foundation. This program is distributed in the hope that it will be +; useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +; Public License for more details. ; -; This script should be in a subdirectory of the full build directory (Kicad/NSIS by default) -; When the build is updated the product and installer versions should be updated before recompiling the installation file +; This script should be in a subdirectory of the full build directory +; (Kicad/NSIS by default). When the build is updated the product and installer +; versions should be updated before recompiling the installation file ; -; This script expects the install.ico, uninstall.ico, language and license files to be in the same directory as this script +; This script expects the install.ico, uninstall.ico, language and license +; files to be in the same directory as this script + +!include "winmessages.nsh" ; General Product Description Definitions !define PRODUCT_NAME "KiCad" -!define PRODUCT_VERSION "2014.03.05" -!define ALT_DOWNLOAD_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" -!define LIBRARIES_WEB_SITE "https://github.com/KiCad/" +!define LIBRARIES_WEB_SITE "https://kicad.github.io/" !define KICAD_MAIN_SITE "www.kicad-pcb.org/" -!define COMPANY_NAME "" +!define COMPANY_NAME "KiCad" !define TRADE_MARKS "" !define COPYRIGHT "Kicad Developers Team" !define COMMENTS "" -!define HELP_WEB_SITE "http://groups.yahoo.com/group/kicad-users/" +!define KICAD_USER_FORUM "https://forum.kicad.info/" !define DEVEL_WEB_SITE "https://launchpad.net/kicad/" !define WINGS3D_WEB_SITE "http://www.wings3d.com" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define UNINST_ROOT "HKLM" +!define ENV_HKLM 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + +!define gflag ;Needed to use ifdef and such +;Define on command line //DPRODUCT_VERSION=42 +!ifndef PRODUCT_VERSION + !define PRODUCT_VERSION "4.0.7" +!endif + +!ifndef OPTION_STRING + !define OPTION_STRING "i686" +!endif + +;Properly display all languages (Installer will not work on Windows 95, 98 or ME!) +Unicode true ;Comment out the following SetCompressor command while testing this script ;SetCompressor /final /solid lzma CRCCheck force -XPStyle on +;XPStyle on Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" -OutFile "${PRODUCT_NAME}_stable-${PRODUCT_VERSION}-BZR4xxx_Win_full_version.exe" -;InstallDir "$PROGRAMFILES\KiCad" -InstallDir "C:\KiCad" -ShowInstDetails hide -ShowUnInstDetails hide -; MUI 1.67 compatible ------ -!include "MUI.nsh" +!ifndef OUTFILE + !define OUTFILE "kicad-${PRODUCT_VERSION}-${OPTION_STRING}.exe" +!endif +OutFile ${OUTFILE} + +; Request that we are executed as admin rights so we can install into +; PROGRAMFILES without ending up in the virtual store +RequestExecutionLevel admin + +!if ${ARCH} == 'x86_64' + InstallDir "$PROGRAMFILES64\KiCad" +!else + InstallDir "$PROGRAMFILES\KiCad" +!endif + +ShowInstDetails show +ShowUnInstDetails show +BrandingText "KiCad installer for Windows" + +; MUI 2 compatible ------ +!include "MUI2.nsh" +!include "${NSISDIR}\Examples\System\System.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "install.ico" !define MUI_UNICON "uninstall.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "kicad-header.bmp" ; optional +!define MUI_WELCOMEFINISHPAGE_BITMAP "kicad-welcome.bmp" ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${UNINST_ROOT}" @@ -61,15 +102,17 @@ ShowUnInstDetails hide ; Installer pages !define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit !define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGuiInit +!define MUI_WELCOMEPAGE_TEXT $(WELCOME_PAGE_TEXT) +!define MUI_WELCOMEPAGE_TITLE_3LINES !insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE $(MUILicense) +;!insertmacro MUI_PAGE_LICENSE $(MUILicense) !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_SHOWREADME ${WINGS3D_WEB_SITE} -!define MUI_FINISHPAGE_SHOWREADME_TEXT "text" +!define MUI_FINISHPAGE_SHOWREADME_TEXT $(WINGS3D_PROMPT) !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED -!define MUI_PAGE_CUSTOMFUNCTION_PRE ModifyFinishPage +!define MUI_PAGE_CUSTOMFUNCTION_SHOW ModifyFinishPage !insertmacro MUI_PAGE_FINISH ; Uninstaller pages @@ -79,33 +122,69 @@ ShowUnInstDetails hide ; - To add another language; add an insert macro line here and include a language file as below ; - This must be after all page macros have been inserted !insertmacro MUI_LANGUAGE "English" ;first language is the default language -!insertmacro MUI_LANGUAGE "French" -!insertmacro MUI_LANGUAGE "Italian" -!insertmacro MUI_LANGUAGE "Polish" -!insertmacro MUI_LANGUAGE "Portuguese" -!insertmacro MUI_LANGUAGE "Dutch" -!insertmacro MUI_LANGUAGE "Russian" -!insertmacro MUI_LANGUAGE "Japanese" +;!insertmacro MUI_LANGUAGE "German" +;!insertmacro MUI_LANGUAGE "Italian" +;!insertmacro MUI_LANGUAGE "Spanish" +;!insertmacro MUI_LANGUAGE "Greek" !include "English.nsh" -!include "French.nsh" -!include "Dutch.nsh" -!include "Italian.nsh" -!include "Japanese.nsh" -!include "Polish.nsh" -!include "Portuguese.nsh" -!include "Russian.nsh" +;!include "German.nsh" +;!include "Italian.nsh" +;!include "Spanish.nsh" +;!include "Greek.nsh" + +VIProductVersion "0.0.0.0" ; Dummy version, because this can only be X.X.X.X +VIAddVersionKey "ProductName" "${COMPANY_NAME}" +VIAddVersionKey "CompanyName" "${COMPANY_NAME}" +VIAddVersionKey "LegalCopyright" "${COMPANY_NAME}" +VIAddVersionKey "FileDescription" "Installer for the KiCad EDA Suite" +VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}" +VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}" + +;-------------------------------- +;Reserve Files + + ;If you are using solid compression, files that are required before + ;the actual installation should be stored first in the data block, + ;because this will make your installer start faster. + + !insertmacro MUI_RESERVEFILE_LANGDLL ; MUI end ------ Function .onInit - ReserveFile "install.ico" - ReserveFile "uninstall.ico" - ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll" - ReserveFile "${NSISDIR}\Plugins\LangDLL.dll" - ReserveFile "${NSISDIR}\Plugins\System.dll" - ReserveFile "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini" - !insertmacro MUI_LANGDLL_DISPLAY + ; Request that we get elevated rights to install so that we don't end up in + ; the virtual store + ClearErrors + UserInfo::GetName + IfErrors Win9x + Pop $0 + UserInfo::GetAccountType + Pop $1 + UserInfo::GetOriginalAccountType + Pop $2 + StrCmp $1 "Admin" 0 AdminQuit + Goto LangDisplay + + AdminQuit: + MessageBox MB_OK $(ERROR_ADMIN_REQ) + Quit + + LangDisplay: + ReserveFile "install.ico" + ReserveFile "uninstall.ico" + ReserveFile "${NSISDIR}\Plugins\x86-unicode\LangDLL.dll" + ReserveFile "${NSISDIR}\Plugins\x86-unicode\System.dll" + ;!insertmacro MUI_LANGDLL_DISPLAY + Goto done + + Win9x: + MessageBox MB_OK $(ERROR_WIN9X) + Quit + + done: + Call EnableLiteMode + FunctionEnd Function myGuiInit @@ -114,12 +193,24 @@ Function myGuiInit FunctionEnd Function ModifyFinishPage - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" $(WINGS3D_PROMPT) - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" 168 ;make more space for prompt - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0" ;hide cancel button - already installed!! + ; resize the Text control, otherwise we get clipping on the top and bottom + ; Create RECT struct + System::Call "*${stRECT} .r1" + ; Find Window info for the window we're displaying + System::Call "User32::GetWindowRect(i, i) i ($mui.FinishPage.ShowReadme, r1) .r2" + ; Get left/top/right/bottom + System::Call "*$1${stRECT} (.r2, .r3, .r4, .r5)" + System::Free $1 + ; calculate the width, we'll keep this the same + IntOp $6 $4 - $2 + ; then calculate the height, and we'll make this 4 times as high + IntOp $7 $5 - $3 + IntOp $7 6 * $7 + ; then we finally update the control size.. we don't want to move it, or change its z-order however + System::Call "User32::SetWindowPos(i $mui.FinishPage.ShowReadme, i 0, i 0, i 0, i $6, i $7, i ${SWP_NOMOVE} | ${SWP_NOZORDER})" FunctionEnd -Section $(TITLE_SEC01) SEC01 +Section $(TITLE_SEC_MAIN) SEC01 SectionIn RO SetOverwrite try SetOutPath "$INSTDIR" @@ -130,50 +221,118 @@ Section $(TITLE_SEC01) SEC01 File /nonfatal /r "..\share\kicad\template\*" SetOutPath "$INSTDIR\bin" File /r "..\bin\*" + SetOutPath "$INSTDIR\lib" + File /r "..\lib\*" SetOutPath "$INSTDIR\share\kicad\internat" - File /r "..\share\kicad\internat\*" + File /nonfatal /r "..\share\kicad\internat\*" + SetOutPath "$INSTDIR\ssl\certs" + File "..\ssl\certs\ca-bundle.crt" SectionEnd -Section $(TITLE_SEC02) SEC02 +Section $(TITLE_SEC_SCHLIB) SEC02 SetOverwrite try - SetOutPath "$INSTDIR\share\library" - File /nonfatal /r "..\share\library\*" - SetOutPath "$INSTDIR\share\modules" - File /nonfatal /r "..\share\modules\*" + SetOutPath "$INSTDIR\share\kicad\library" + File /nonfatal /r "..\share\kicad\library\*" SectionEnd -Section $(TITLE_SEC03) SEC03 +Section $(TITLE_SEC_FPLIB) SEC03 SetOverwrite try - SetOutPath "$INSTDIR\share\kicad\demos" - File /nonfatal /r "..\share\kicad\demos\*" - SetOutPath "$INSTDIR\share\doc\kicad\tutorials" - File /nonfatal /r "..\share\doc\kicad\tutorials\*" + SetOutPath "$INSTDIR\share\kicad\modules" + File /nonfatal /r "..\share\kicad\modules\*" SectionEnd -Section $(TITLE_SEC04) SEC04 +Section $(TITLE_SEC_FPWIZ) SEC04 SetOverwrite try - SetOutPath "$INSTDIR\share\doc\kicad\help" - File /nonfatal /r "..\share\doc\kicad\help\*" + SetOutPath "$INSTDIR\share\kicad\scripting\kicad_pyshell" + File /nonfatal /r "..\share\kicad\scripting\kicad_pyshell\*" + SetOutPath "$INSTDIR\share\kicad\scripting\plugins" + File /nonfatal /r "..\share\kicad\scripting\plugins\*" +SectionEnd + +;Section $(TITLE_SEC_DEMOS) SEC05 +; SetOverwrite try +; SetOutPath "$INSTDIR\share\kicad\demos" +; File /nonfatal /r "..\share\kicad\demos\*" +; SetOutPath "$INSTDIR\share\doc\kicad\tutorials" +; File /nonfatal /r "..\share\doc\kicad\tutorials\*" +;SectionEnd + +;SectionGroup $(TITLE_SEC_DOCS) SEC06 + Section $(LANGUAGE_NAME_EN) SEC06_EN + SetOverwrite try + SetOutPath "$INSTDIR\share\doc\kicad\help\en" + File /nonfatal /r "..\share\doc\kicad\help\en\*" + SectionEnd +; Section $(LANGUAGE_NAME_DE) SEC06_DE +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\de" +; File /nonfatal /r "..\share\doc\kicad\help\de\*" +; SectionEnd +; Section $(LANGUAGE_NAME_ES) SEC06_ES +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\es" +; File /nonfatal /r "..\share\doc\kicad\help\es\*" +; SectionEnd +; Section $(LANGUAGE_NAME_FR) SEC06_FR +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\fr" +; File /nonfatal /r "..\share\doc\kicad\help\fr\*" +; SectionEnd +; Section $(LANGUAGE_NAME_IT) SEC06_IT +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\it" +; File /nonfatal /r "..\share\doc\kicad\help\it\*" +; SectionEnd +; Section $(LANGUAGE_NAME_JA) SEC06_JA +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\ja" +; File /nonfatal /r "..\share\doc\kicad\help\ja\*" +; SectionEnd +; Section $(LANGUAGE_NAME_NL) SEC06_NL +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\nl" +; File /nonfatal /r "..\share\doc\kicad\help\nl\*" +; SectionEnd +; Section $(LANGUAGE_NAME_PL) SEC06_PL +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\pl" +; File /nonfatal /r "..\share\doc\kicad\help\pl\*" +; SectionEnd +;SectionGroupEnd + +Section $(TITLE_SEC_ENV) SEC07 + WriteRegExpandStr ${ENV_HKLM} KICAD_PTEMPLATES "$INSTDIR\share\kicad\template" + WriteRegExpandStr ${ENV_HKLM} KISYS3DMOD "$INSTDIR\share\kicad\modules\packages3d" + WriteRegExpandStr ${ENV_HKLM} KISYSMOD "$INSTDIR\share\kicad\modules" + WriteRegExpandStr ${ENV_HKLM} KICAD_SYMBOL_DIR "$INSTDIR\share\kicad\library" + + WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "EnvInstalled" "1" + + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 SectionEnd Section -CreateShortcuts SetOutPath $INSTDIR WriteIniStr "$INSTDIR\HomePage.url" "InternetShortcut" "URL" "${KICAD_MAIN_SITE}" - WriteIniStr "$INSTDIR\AltDownloadSite.url" "InternetShortcut" "URL" "${ALT_DOWNLOAD_WEB_SITE}" - WriteIniStr "$INSTDIR\UserGroup.url" "InternetShortcut" "URL" "${HELP_WEB_SITE}" + WriteIniStr "$INSTDIR\UserForum.url" "InternetShortcut" "URL" "${KICAD_USER_FORUM}" WriteIniStr "$INSTDIR\DevelGroup.url" "InternetShortcut" "URL" "${DEVEL_WEB_SITE}" WriteIniStr "$INSTDIR\LibrariesGroup.url" "InternetShortcut" "URL" "${LIBRARIES_WEB_SITE}" WriteIniStr "$INSTDIR\Wings3D.url" "InternetShortcut" "URL" "${WINGS3D_WEB_SITE}" SetShellVarContext all CreateDirectory "$SMPROGRAMS\KiCad" CreateShortCut "$SMPROGRAMS\KiCad\Home Page.lnk" "$INSTDIR\HomePage.url" - CreateShortCut "$SMPROGRAMS\KiCad\Kicad Alternate Download.lnk" "$INSTDIR\AltDownloadSite.url" - CreateShortCut "$SMPROGRAMS\KiCad\Kicad Libraries.lnk" "$INSTDIR\LibrariesGroup.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad Libraries.lnk" "$INSTDIR\LibrariesGroup.url" CreateShortCut "$SMPROGRAMS\KiCad\Wings3D.lnk" "$INSTDIR\Wings3D.url" - CreateShortCut "$SMPROGRAMS\KiCad\User Group.lnk" "$INSTDIR\UserGroup.url" - CreateShortCut "$SMPROGRAMS\KiCad\Devel Group.lnk" "$INSTDIR\DevelGroup.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad User Forum.lnk" "$INSTDIR\UserForum.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad Devel Group.lnk" "$INSTDIR\DevelGroup.url" CreateShortCut "$SMPROGRAMS\KiCad\Uninstall.lnk" "$INSTDIR\uninstaller.exe" CreateShortCut "$SMPROGRAMS\KiCad\KiCad.lnk" "$INSTDIR\bin\kicad.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Eeschema.lnk" "$INSTDIR\bin\eeschema.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Pcbnew.lnk" "$INSTDIR\bin\pcbnew.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Gerbview.lnk" "$INSTDIR\bin\gerbview.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Bitmap2component.lnk" "$INSTDIR\bin\bitmap2component.exe" + CreateShortCut "$SMPROGRAMS\KiCad\PCB calculator.lnk" "$INSTDIR\bin\pcb_calculator.exe" + CreateShortCut "$SMPROGRAMS\KiCad\Pagelayout editor.lnk" "$INSTDIR\bin\pl_editor.exe" CreateShortCut "$DESKTOP\KiCad.lnk" "$INSTDIR\bin\kicad.exe" SectionEnd @@ -187,7 +346,7 @@ Section -CreateAddRemoveEntry WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "NoModify" "1" WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "NoRepair" "1" WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "Comments" "${COMMENTS}" - WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "HelpLink" "${HELP_WEB_SITE}" + WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "HelpLink" "${KICAD_USER_FORUM}" WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${KICAD_MAIN_SITE}" WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR" @@ -195,10 +354,21 @@ Section -CreateAddRemoveEntry SectionEnd !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC01) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC02) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC03) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC04) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC_MAIN) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC_SCHLIB) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC_FPLIB) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC_FPWIZ) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC_DEMOS) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $(DESC_SEC_DOCS) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC06_EN} $(DESC_SEC_DOCS_EN) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_DE} $(DESC_SEC_DOCS_DE) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_ES} $(DESC_SEC_DOCS_ES) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_FR} $(DESC_SEC_DOCS_FR) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_IT} $(DESC_SEC_DOCS_IT) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_JA} $(DESC_SEC_DOCS_JA) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_NL} $(DESC_SEC_DOCS_NL) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_PL} $(DESC_SEC_DOCS_PL) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $(DESC_SEC_ENV) !insertmacro MUI_FUNCTION_DESCRIPTION_END Function un.onInit @@ -223,17 +393,23 @@ Section Uninstall ;remove start menu shortcuts and web page links SetShellVarContext all Delete "$SMPROGRAMS\KiCad\Home Page.lnk" - Delete "$SMPROGRAMS\KiCad\Kicad Libraries.lnk" - Delete "$SMPROGRAMS\KiCad\Kicad Alternate Download.lnk" - Delete "$SMPROGRAMS\KiCad\Devel Group.lnk" - Delete "$SMPROGRAMS\KiCad\User Group.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad Libraries.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad Alternate Download.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad Devel Group.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad User Group.lnk" Delete "$SMPROGRAMS\KiCad\Uninstall.lnk" Delete "$SMPROGRAMS\KiCad\KiCad.lnk" Delete "$SMPROGRAMS\KiCad\Wings3D.lnk" + Delete "$SMPROGRAMS\KiCad\Eeschema.lnk" + Delete "$SMPROGRAMS\KiCad\Pcbnew.lnk" + Delete "$SMPROGRAMS\KiCad\Gerbview.lnk" + Delete "$SMPROGRAMS\KiCad\Bitmap2component.lnk" + Delete "$SMPROGRAMS\KiCad\PCB calculator.lnk" + Delete "$SMPROGRAMS\KiCad\Pagelayout editor.lnk" Delete "$DESKTOP\KiCad.lnk" Delete "$INSTDIR\Wings3D.url" Delete "$INSTDIR\HomePage.url" - Delete "$INSTDIR\UserGroup.url" + Delete "$INSTDIR\UserForum.url" Delete "$INSTDIR\AltDownloadSite.url" Delete "$INSTDIR\DevelGroup.url" Delete "$INSTDIR\LibrariesGroup.url" @@ -241,6 +417,7 @@ Section Uninstall ;remove all program files now RMDir /r "$INSTDIR\bin" + RMDir /r "$INSTDIR\lib" RMDir /r "$INSTDIR\library" RMDir /r "$INSTDIR\modules" RMDir /r "$INSTDIR\template" @@ -252,15 +429,34 @@ Section Uninstall RMDir /r "$INSTDIR\share\modules" RMDir /r "$INSTDIR\share\kicad\template" RMDir /r "$INSTDIR\share\kicad\internat" - RMDir /r "$INSTDIR\share\kicad\demos" - RMDir /r "$INSTDIR\share\doc\kicad\tutorials" + ;RMDir /r "$INSTDIR\share\kicad\demos" + ;RMDir /r "$INSTDIR\share\doc\kicad\tutorials" RMDir /r "$INSTDIR\share\doc\kicad\help" RMDir /r "$INSTDIR\wings3d" + RMDir /r "$INSTDIR\share\doc\kicad" + RMDir /r "$INSTDIR\share\doc" + RMDir /r "$INSTDIR\share" + RMDir /r "$INSTDIR\ssl\certs" + RMDir /r "$INSTDIR\ssl" ;don't remove $INSTDIR recursively just in case the user has installed it in c:\ or ;c:\program files as this would attempt to delete a lot more than just this package Delete "$INSTDIR\*.txt" RMDir "$INSTDIR" + ;remove environment only if it was "installed" last + ClearErrors + ReadRegDWORD $0 ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "EnvInstalled" + IfErrors FinishUninstall 0 + + IntCmp $0 1 0 FinishUninstall FinishUninstall + + DeleteRegValue ${ENV_HKLM} KICAD_PTEMPLATES + DeleteRegValue ${ENV_HKLM} KISYS3DMOD + DeleteRegValue ${ENV_HKLM} KISYSMOD + DeleteRegValue ${ENV_HKLM} KICAD_SYMBOL_DIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + FinishUninstall: ;Note - application registry keys are stored in the users individual registry hive (HKCU\Software\kicad". ;It might be possible to remove these keys as well but it would require a lot of testing of permissions ;and access to other people's registry entries. So for now we will leave the application registry keys. @@ -270,16 +466,6 @@ Section Uninstall SetAutoClose true SectionEnd -;Setup.exe file version information - VIProductVersion "${PRODUCT_VERSION}.01" ;must be in x.x.x.x format - product version plus last digit for installer version number - VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_NAME}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "${COMMENTS}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${COMPANY_NAME}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "${TRADE_MARKS}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© ${COPYRIGHT}" - VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${PRODUCT_NAME} Installer" - VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${PRODUCT_VERSION}" - Function PreventMultiInstances System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e' Pop $R0 @@ -302,3 +488,53 @@ Function CheckAlreadyInstalled MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(ALREADY_INSTALLED) /SD IDOK IDOK +2 Abort FunctionEnd + +!macro CompileTimeIfFileExist path define + !tempfile tmpinc + !system 'IF EXIST "${path}" echo !define ${define} > "${tmpinc}"' + !include "${tmpinc}" + !delfile "${tmpinc}" + !undef tmpinc +!macroend + +Function EnableLiteMode + ; TODO: Add override string for lite mode + !insertmacro CompileTimeIfFileExist "..\share\kicad\library" ADD_LIBS + !ifndef ADD_LIBS + !insertmacro SetSectionFlag ${SEC02} ${SF_RO} + !insertmacro UnselectSection ${SEC02} + !endif + + !insertmacro CompileTimeIfFileExist "..\share\kicad\modules" ADD_MODULES + !ifndef ADD_MODULES + !insertmacro SetSectionFlag ${SEC03} ${SF_RO} + !insertmacro UnselectSection ${SEC03} + !endif + + !insertmacro CompileTimeIfFileExist "..\share\doc\kicad\help" ADD_HELP + !ifndef ADD_HELP + ;!insertmacro SetSectionFlag ${SEC06} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06} + + !insertmacro SetSectionFlag ${SEC06_EN} ${SF_RO} + !insertmacro UnselectSection ${SEC06_EN} + + ;!insertmacro SetSectionFlag ${SEC06_DE} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_DE} + ;!insertmacro SetSectionFlag ${SEC06_ES} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_ES} + ;!insertmacro SetSectionFlag ${SEC06_FR} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_FR} + ;!insertmacro SetSectionFlag ${SEC06_IT} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_IT} + ;!insertmacro SetSectionFlag ${SEC06_JA} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_JA} + ;!insertmacro SetSectionFlag ${SEC06_NL} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_NL} + ;!insertmacro SetSectionFlag ${SEC06_PL} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_PL} + !endif + + ; Make the envvar install not be default + !insertmacro UnselectSection ${SEC07} +FunctionEnd diff --git a/NSIS/kicad-header.bmp b/NSIS/kicad-header.bmp new file mode 100644 index 0000000..d602b4c Binary files /dev/null and b/NSIS/kicad-header.bmp differ diff --git a/NSIS/kicad-welcome.bmp b/NSIS/kicad-welcome.bmp new file mode 100644 index 0000000..ec1d333 Binary files /dev/null and b/NSIS/kicad-welcome.bmp differ -- cgit From 1b40809db8f7d71f8837226371ec4199147c0e37 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Wed, 6 Jan 2021 14:26:33 +0530 Subject: updated installer script and readme --- NSIS/install.nsi | 280 ++++++++++++++++++++++++++++++++++++++++----------- README.md | 46 ++++++--- kicad-4.0.7-i686.exe | Bin 0 -> 88090794 bytes 3 files changed, 258 insertions(+), 68 deletions(-) create mode 100644 kicad-4.0.7-i686.exe diff --git a/NSIS/install.nsi b/NSIS/install.nsi index b004a89..1d3e2e5 100644 --- a/NSIS/install.nsi +++ b/NSIS/install.nsi @@ -6,8 +6,9 @@ ; This script is provided as is with no warranties. ; ; Copyright (C) 2006 Alastair Hoyle -; Copyright (C) 2015 Nick Østergaard +; Copyright (C) 2015 Nick Østergaard ; Copyright (C) 2015 Brian Sidebotham +; Copyright (C) 2016 Bevan Weiss ; ; This program is free software; you can redistribute it and/or modify it ; under the terms of the GNU General Public License as published by the Free @@ -23,22 +24,25 @@ ; This script expects the install.ico, uninstall.ico, language and license ; files to be in the same directory as this script +!include "winmessages.nsh" + ; General Product Description Definitions !define PRODUCT_NAME "KiCad" -!define ALT_DOWNLOAD_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" -!define LIBRARIES_WEB_SITE "https://github.com/KiCad/" +!define LIBRARIES_WEB_SITE "https://kicad.github.io/" !define KICAD_MAIN_SITE "www.kicad-pcb.org/" -!define COMPANY_NAME "" +!define COMPANY_NAME "KiCad" !define TRADE_MARKS "" !define COPYRIGHT "Kicad Developers Team" !define COMMENTS "" -!define HELP_WEB_SITE "http://groups.yahoo.com/group/kicad-users/" +!define KICAD_USER_FORUM "https://forum.kicad.info/" !define DEVEL_WEB_SITE "https://launchpad.net/kicad/" !define WINGS3D_WEB_SITE "http://www.wings3d.com" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define UNINST_ROOT "HKLM" +!define ENV_HKLM 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + !define gflag ;Needed to use ifdef and such ;Define on command line //DPRODUCT_VERSION=42 !ifndef PRODUCT_VERSION @@ -49,6 +53,9 @@ !define OPTION_STRING "i686" !endif +;Properly display all languages (Installer will not work on Windows 95, 98 or ME!) +Unicode true + ;Comment out the following SetCompressor command while testing this script ;SetCompressor /final /solid lzma @@ -73,10 +80,11 @@ RequestExecutionLevel admin ShowInstDetails show ShowUnInstDetails show -BrandingText "KiCad installer for windows" +BrandingText "KiCad installer for Windows" -; MUI 1.67 compatible ------ -!include "MUI.nsh" +; MUI 2 compatible ------ +!include "MUI2.nsh" +!include "${NSISDIR}\Examples\System\System.nsh" ; MUI Settings !define MUI_ABORTWARNING @@ -95,16 +103,16 @@ BrandingText "KiCad installer for windows" !define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit !define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGuiInit !define MUI_WELCOMEPAGE_TEXT $(WELCOME_PAGE_TEXT) -;!define MUI_WELCOMEPAGE_TEXT "test" +!define MUI_WELCOMEPAGE_TITLE_3LINES !insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE $(MUILicense) +;!insertmacro MUI_PAGE_LICENSE $(MUILicense) !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_SHOWREADME ${WINGS3D_WEB_SITE} -!define MUI_FINISHPAGE_SHOWREADME_TEXT "text" +!define MUI_FINISHPAGE_SHOWREADME_TEXT $(WINGS3D_PROMPT) !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED -!define MUI_PAGE_CUSTOMFUNCTION_PRE ModifyFinishPage +!define MUI_PAGE_CUSTOMFUNCTION_SHOW ModifyFinishPage !insertmacro MUI_PAGE_FINISH ; Uninstaller pages @@ -114,22 +122,33 @@ BrandingText "KiCad installer for windows" ; - To add another language; add an insert macro line here and include a language file as below ; - This must be after all page macros have been inserted !insertmacro MUI_LANGUAGE "English" ;first language is the default language -;!insertmacro MUI_LANGUAGE "French" +;!insertmacro MUI_LANGUAGE "German" ;!insertmacro MUI_LANGUAGE "Italian" -;!insertmacro MUI_LANGUAGE "Polish" -;!insertmacro MUI_LANGUAGE "Portuguese" -;!insertmacro MUI_LANGUAGE "Dutch" -;!insertmacro MUI_LANGUAGE "Russian" -;!insertmacro MUI_LANGUAGE "Japanese" +;!insertmacro MUI_LANGUAGE "Spanish" +;!insertmacro MUI_LANGUAGE "Greek" !include "English.nsh" -;!include "French.nsh" -;!include "Dutch.nsh" +;!include "German.nsh" ;!include "Italian.nsh" -;!include "Japanese.nsh" -;!include "Polish.nsh" -;!include "Portuguese.nsh" -;!include "Russian.nsh" +;!include "Spanish.nsh" +;!include "Greek.nsh" + +VIProductVersion "0.0.0.0" ; Dummy version, because this can only be X.X.X.X +VIAddVersionKey "ProductName" "${COMPANY_NAME}" +VIAddVersionKey "CompanyName" "${COMPANY_NAME}" +VIAddVersionKey "LegalCopyright" "${COMPANY_NAME}" +VIAddVersionKey "FileDescription" "Installer for the KiCad EDA Suite" +VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}" +VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}" + +;-------------------------------- +;Reserve Files + + ;If you are using solid compression, files that are required before + ;the actual installation should be stored first in the data block, + ;because this will make your installer start faster. + + !insertmacro MUI_RESERVEFILE_LANGDLL ; MUI end ------ @@ -148,24 +167,24 @@ Function .onInit Goto LangDisplay AdminQuit: - MessageBox MB_OK "Admin rights are required to install KiCad!" + MessageBox MB_OK $(ERROR_ADMIN_REQ) Quit LangDisplay: ReserveFile "install.ico" ReserveFile "uninstall.ico" - ReserveFile "${NSISDIR}\Plugins\x86-unicode\InstallOptions.dll" ReserveFile "${NSISDIR}\Plugins\x86-unicode\LangDLL.dll" ReserveFile "${NSISDIR}\Plugins\x86-unicode\System.dll" - ReserveFile "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini" - !insertmacro MUI_LANGDLL_DISPLAY + ;!insertmacro MUI_LANGDLL_DISPLAY Goto done Win9x: - MessageBox MB_OK "Error! This can't run under Windows 9x!" + MessageBox MB_OK $(ERROR_WIN9X) Quit done: + Call EnableLiteMode + FunctionEnd Function myGuiInit @@ -174,9 +193,21 @@ Function myGuiInit FunctionEnd Function ModifyFinishPage - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" $(WINGS3D_PROMPT) - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" 168 ;make more space for prompt - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0" ;hide cancel button - already installed!! + ; resize the Text control, otherwise we get clipping on the top and bottom + ; Create RECT struct + System::Call "*${stRECT} .r1" + ; Find Window info for the window we're displaying + System::Call "User32::GetWindowRect(i, i) i ($mui.FinishPage.ShowReadme, r1) .r2" + ; Get left/top/right/bottom + System::Call "*$1${stRECT} (.r2, .r3, .r4, .r5)" + System::Free $1 + ; calculate the width, we'll keep this the same + IntOp $6 $4 - $2 + ; then calculate the height, and we'll make this 4 times as high + IntOp $7 $5 - $3 + IntOp $7 6 * $7 + ; then we finally update the control size.. we don't want to move it, or change its z-order however + System::Call "User32::SetWindowPos(i $mui.FinishPage.ShowReadme, i 0, i 0, i 0, i $6, i $7, i ${SWP_NOMOVE} | ${SWP_NOZORDER})" FunctionEnd Section $(TITLE_SEC_MAIN) SEC01 @@ -200,6 +231,8 @@ Section $(TITLE_SEC_MAIN) SEC01 ;File /r "..\lib\*" SetOutPath "$INSTDIR\share\kicad\internat" ;File /nonfatal /r "..\share\kicad\internat\*" + ;SetOutPath "$INSTDIR\ssl\certs" + ;File "..\ssl\certs\ca-bundle.crt" SectionEnd Section $(TITLE_SEC_SCHLIB) SEC02 @@ -214,34 +247,89 @@ Section $(TITLE_SEC_FPLIB) SEC03 ;File /nonfatal /r "..\share\kicad\modules\*" SectionEnd -Section $(TITLE_SEC_DEMOS) SEC04 +Section $(TITLE_SEC_FPWIZ) SEC04 SetOverwrite try - SetOutPath "$INSTDIR\share\kicad\demos" - ;File /nonfatal /r "..\share\kicad\demos\*" - SetOutPath "$INSTDIR\share\doc\kicad\tutorials" - ;File /nonfatal /r "..\share\doc\kicad\tutorials\*" + SetOutPath "$INSTDIR\share\kicad\scripting\kicad_pyshell" + ;File /nonfatal /r "..\share\kicad\scripting\kicad_pyshell\*" + SetOutPath "$INSTDIR\share\kicad\scripting\plugins" + ;File /nonfatal /r "..\share\kicad\scripting\plugins\*" SectionEnd -Section $(TITLE_SEC_DOCS) SEC05 - SetOverwrite try - SetOutPath "$INSTDIR\share\doc\kicad\help" - ;File /nonfatal /r "..\share\doc\kicad\help\*" +;Section $(TITLE_SEC_DEMOS) SEC05 +; SetOverwrite try +; SetOutPath "$INSTDIR\share\kicad\demos" +; File /nonfatal /r "..\share\kicad\demos\*" +; SetOutPath "$INSTDIR\share\doc\kicad\tutorials" +; File /nonfatal /r "..\share\doc\kicad\tutorials\*" +;SectionEnd + +;SectionGroup $(TITLE_SEC_DOCS) SEC06 + Section $(LANGUAGE_NAME_EN) SEC06_EN + SetOverwrite try + SetOutPath "$INSTDIR\share\doc\kicad\help\en" + ;File /nonfatal /r "..\share\doc\kicad\help\en\*" + SectionEnd +; Section $(LANGUAGE_NAME_DE) SEC06_DE +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\de" +; File /nonfatal /r "..\share\doc\kicad\help\de\*" +; SectionEnd +; Section $(LANGUAGE_NAME_ES) SEC06_ES +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\es" +; File /nonfatal /r "..\share\doc\kicad\help\es\*" +; SectionEnd +; Section $(LANGUAGE_NAME_FR) SEC06_FR +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\fr" +; File /nonfatal /r "..\share\doc\kicad\help\fr\*" +; SectionEnd +; Section $(LANGUAGE_NAME_IT) SEC06_IT +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\it" +; File /nonfatal /r "..\share\doc\kicad\help\it\*" +; SectionEnd +; Section $(LANGUAGE_NAME_JA) SEC06_JA +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\ja" +; File /nonfatal /r "..\share\doc\kicad\help\ja\*" +; SectionEnd +; Section $(LANGUAGE_NAME_NL) SEC06_NL +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\nl" +; File /nonfatal /r "..\share\doc\kicad\help\nl\*" +; SectionEnd +; Section $(LANGUAGE_NAME_PL) SEC06_PL +; SetOverwrite try +; SetOutPath "$INSTDIR\share\doc\kicad\help\pl" +; File /nonfatal /r "..\share\doc\kicad\help\pl\*" +; SectionEnd +;SectionGroupEnd + +Section $(TITLE_SEC_ENV) SEC07 + WriteRegExpandStr ${ENV_HKLM} KICAD_PTEMPLATES "$INSTDIR\share\kicad\template" + ;WriteRegExpandStr ${ENV_HKLM} KISYS3DMOD "$INSTDIR\share\kicad\modules\packages3d" + WriteRegExpandStr ${ENV_HKLM} KISYSMOD "$INSTDIR\share\kicad\modules" + WriteRegExpandStr ${ENV_HKLM} KICAD_SYMBOL_DIR "$INSTDIR\share\kicad\library" + + WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "EnvInstalled" "1" + + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 SectionEnd Section -CreateShortcuts SetOutPath $INSTDIR WriteIniStr "$INSTDIR\HomePage.url" "InternetShortcut" "URL" "${KICAD_MAIN_SITE}" - WriteIniStr "$INSTDIR\UserGroup.url" "InternetShortcut" "URL" "${HELP_WEB_SITE}" + WriteIniStr "$INSTDIR\UserForum.url" "InternetShortcut" "URL" "${KICAD_USER_FORUM}" WriteIniStr "$INSTDIR\DevelGroup.url" "InternetShortcut" "URL" "${DEVEL_WEB_SITE}" WriteIniStr "$INSTDIR\LibrariesGroup.url" "InternetShortcut" "URL" "${LIBRARIES_WEB_SITE}" WriteIniStr "$INSTDIR\Wings3D.url" "InternetShortcut" "URL" "${WINGS3D_WEB_SITE}" SetShellVarContext all CreateDirectory "$SMPROGRAMS\KiCad" CreateShortCut "$SMPROGRAMS\KiCad\Home Page.lnk" "$INSTDIR\HomePage.url" - CreateShortCut "$SMPROGRAMS\KiCad\KiCad Alternate Download.lnk" "$INSTDIR\AltDownloadSite.url" CreateShortCut "$SMPROGRAMS\KiCad\KiCad Libraries.lnk" "$INSTDIR\LibrariesGroup.url" CreateShortCut "$SMPROGRAMS\KiCad\Wings3D.lnk" "$INSTDIR\Wings3D.url" - CreateShortCut "$SMPROGRAMS\KiCad\KiCad User Group.lnk" "$INSTDIR\UserGroup.url" + CreateShortCut "$SMPROGRAMS\KiCad\KiCad User Forum.lnk" "$INSTDIR\UserForum.url" CreateShortCut "$SMPROGRAMS\KiCad\KiCad Devel Group.lnk" "$INSTDIR\DevelGroup.url" CreateShortCut "$SMPROGRAMS\KiCad\Uninstall.lnk" "$INSTDIR\uninstaller.exe" CreateShortCut "$SMPROGRAMS\KiCad\KiCad.lnk" "$INSTDIR\bin\kicad.exe" @@ -264,7 +352,7 @@ Section -CreateAddRemoveEntry WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "NoModify" "1" WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "NoRepair" "1" WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "Comments" "${COMMENTS}" - WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "HelpLink" "${HELP_WEB_SITE}" + WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "HelpLink" "${KICAD_USER_FORUM}" WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${KICAD_MAIN_SITE}" WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR" @@ -275,8 +363,18 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC_MAIN) !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC_SCHLIB) !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC_FPLIB) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC_DEMOS) - !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC_DOCS) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC_FPWIZ) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC_DEMOS) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $(DESC_SEC_DOCS) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC06_EN} $(DESC_SEC_DOCS_EN) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_DE} $(DESC_SEC_DOCS_DE) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_ES} $(DESC_SEC_DOCS_ES) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_FR} $(DESC_SEC_DOCS_FR) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_IT} $(DESC_SEC_DOCS_IT) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_JA} $(DESC_SEC_DOCS_JA) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_NL} $(DESC_SEC_DOCS_NL) + ;!insertmacro MUI_DESCRIPTION_TEXT ${SEC06_PL} $(DESC_SEC_DOCS_PL) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $(DESC_SEC_ENV) !insertmacro MUI_FUNCTION_DESCRIPTION_END Function un.onInit @@ -301,17 +399,23 @@ Section Uninstall ;remove start menu shortcuts and web page links SetShellVarContext all Delete "$SMPROGRAMS\KiCad\Home Page.lnk" - Delete "$SMPROGRAMS\KiCad\Kicad Libraries.lnk" - Delete "$SMPROGRAMS\KiCad\Kicad Alternate Download.lnk" - Delete "$SMPROGRAMS\KiCad\Devel Group.lnk" - Delete "$SMPROGRAMS\KiCad\User Group.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad Libraries.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad Alternate Download.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad Devel Group.lnk" + Delete "$SMPROGRAMS\KiCad\KiCad User Group.lnk" Delete "$SMPROGRAMS\KiCad\Uninstall.lnk" Delete "$SMPROGRAMS\KiCad\KiCad.lnk" Delete "$SMPROGRAMS\KiCad\Wings3D.lnk" + Delete "$SMPROGRAMS\KiCad\Eeschema.lnk" + Delete "$SMPROGRAMS\KiCad\Pcbnew.lnk" + Delete "$SMPROGRAMS\KiCad\Gerbview.lnk" + Delete "$SMPROGRAMS\KiCad\Bitmap2component.lnk" + Delete "$SMPROGRAMS\KiCad\PCB calculator.lnk" + Delete "$SMPROGRAMS\KiCad\Pagelayout editor.lnk" Delete "$DESKTOP\KiCad.lnk" Delete "$INSTDIR\Wings3D.url" Delete "$INSTDIR\HomePage.url" - Delete "$INSTDIR\UserGroup.url" + Delete "$INSTDIR\UserForum.url" Delete "$INSTDIR\AltDownloadSite.url" Delete "$INSTDIR\DevelGroup.url" Delete "$INSTDIR\LibrariesGroup.url" @@ -331,20 +435,34 @@ Section Uninstall RMDir /r "$INSTDIR\share\modules" RMDir /r "$INSTDIR\share\kicad\template" RMDir /r "$INSTDIR\share\kicad\internat" - RMDir /r "$INSTDIR\share\kicad\demos" - RMDir /r "$INSTDIR\share\doc\kicad\tutorials" + ;RMDir /r "$INSTDIR\share\kicad\demos" + ;RMDir /r "$INSTDIR\share\doc\kicad\tutorials" RMDir /r "$INSTDIR\share\doc\kicad\help" + RMDir /r "$INSTDIR\wings3d" RMDir /r "$INSTDIR\share\doc\kicad" RMDir /r "$INSTDIR\share\doc" RMDir /r "$INSTDIR\share" - RMDir /r "$INSTDIR\wings3d" - + RMDir /r "$INSTDIR\ssl\certs" RMDir /r "$INSTDIR\ssl" ;don't remove $INSTDIR recursively just in case the user has installed it in c:\ or ;c:\program files as this would attempt to delete a lot more than just this package Delete "$INSTDIR\*.txt" RMDir "$INSTDIR" + ;remove environment only if it was "installed" last + ClearErrors + ReadRegDWORD $0 ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "EnvInstalled" + IfErrors FinishUninstall 0 + + IntCmp $0 1 0 FinishUninstall FinishUninstall + + DeleteRegValue ${ENV_HKLM} KICAD_PTEMPLATES + ;DeleteRegValue ${ENV_HKLM} KISYS3DMOD + DeleteRegValue ${ENV_HKLM} KISYSMOD + DeleteRegValue ${ENV_HKLM} KICAD_SYMBOL_DIR + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + FinishUninstall: ;Note - application registry keys are stored in the users individual registry hive (HKCU\Software\kicad". ;It might be possible to remove these keys as well but it would require a lot of testing of permissions ;and access to other people's registry entries. So for now we will leave the application registry keys. @@ -376,3 +494,53 @@ Function CheckAlreadyInstalled MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(ALREADY_INSTALLED) /SD IDOK IDOK +2 Abort FunctionEnd + +!macro CompileTimeIfFileExist path define + !tempfile tmpinc + !system 'IF EXIST "${path}" echo !define ${define} > "${tmpinc}"' + !include "${tmpinc}" + !delfile "${tmpinc}" + !undef tmpinc +!macroend + +Function EnableLiteMode + ; TODO: Add override string for lite mode + !insertmacro CompileTimeIfFileExist "..\share\kicad\library" ADD_LIBS + !ifndef ADD_LIBS + !insertmacro SetSectionFlag ${SEC02} ${SF_RO} + !insertmacro UnselectSection ${SEC02} + !endif + + !insertmacro CompileTimeIfFileExist "..\share\kicad\modules" ADD_MODULES + !ifndef ADD_MODULES + !insertmacro SetSectionFlag ${SEC03} ${SF_RO} + !insertmacro UnselectSection ${SEC03} + !endif + + !insertmacro CompileTimeIfFileExist "..\share\doc\kicad\help" ADD_HELP + !ifndef ADD_HELP + ;!insertmacro SetSectionFlag ${SEC06} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06} + + !insertmacro SetSectionFlag ${SEC06_EN} ${SF_RO} + !insertmacro UnselectSection ${SEC06_EN} + + ;!insertmacro SetSectionFlag ${SEC06_DE} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_DE} + ;!insertmacro SetSectionFlag ${SEC06_ES} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_ES} + ;!insertmacro SetSectionFlag ${SEC06_FR} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_FR} + ;!insertmacro SetSectionFlag ${SEC06_IT} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_IT} + ;!insertmacro SetSectionFlag ${SEC06_JA} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_JA} + ;!insertmacro SetSectionFlag ${SEC06_NL} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_NL} + ;!insertmacro SetSectionFlag ${SEC06_PL} ${SF_RO} + ;!insertmacro UnselectSection ${SEC06_PL} + !endif + + ; Make the envvar install not be default + ; !insertmacro UnselectSection ${SEC07} +FunctionEnd diff --git a/README.md b/README.md index 91e723f..8b49a64 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,44 @@ -# KiCad-eSim -This repository is maintained by FOSSEE team for KiCad v4.0.7 +[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +[![GitHub issues](https://img.shields.io/github/issues/fossee/KiCad-eSim)](https://github.com/fossee/KiCad-eSim/issues) +[![GitHub forks](https://img.shields.io/github/forks/fossee/KiCad-eSim)](https://github.com/fossee/KiCad-eSim/network) +[![GitHub stars](https://img.shields.io/github/stars/fossee/KiCad-eSim)](https://github.com/fossee/KiCad-eSim/stargazers) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://github.com/fossee/KiCad-eSim) +![GitHub contributors](https://img.shields.io/github/contributors/fossee/kicad-esim) + +KiCad Installer for eSim +==== + +This repository is maintained by FOSSEE team for KiCad v4.0.7. It contains all the documentation for making KiCad executable for Windows 7 and above and has been customized for the needs of eSim. + +> Note: Most of the contents of `master` branch of this repository has been made available by extracting the KiCad installer from - https://kicad-downloads.s3.cern.ch/windows/stable/kicad-4.0.7-i686.exe. +> The difference with the original KiCad installer is the removal of 3D packages, help doc in all languages (except English) and addition of eSim compatible KiCad libraries. + ## Building KiCad installer for eSim -1. Download the KiCad installer from - https://kicad-downloads.s3.cern.ch/windows/stable/kicad-4.0.7-i686.exe +1. Take the `master` branch of of this repository. Rename the folder to `kicad`. -2. Install KiCad from the executable [kicad-4.0.7-i686.exe] downloaded in step 1 at preferred location. Henceforth this location is to be referred to as `installdirectory`. +2. Remove following files/directories from the `kicad` folder: + - `.git` folder + - kicad-4.0.7.tar.xz + - README.md + - share/doc/kicad/help/de + - share/doc/kicad/help/es + - share/doc/kicad/help/fr + - share/doc/kicad/help/it + - share/doc/kicad/help/ja + - share/doc/kicad/help/nl + - share/doc/kicad/help/pl + - previous kicad installer (if any) -3. Clone the folder `NSIS` present in this repository and place it at the KiCad install location, i.e. installdirectory/. +3. Compress the folders `bin`, `lib`, `share` and `ssl` into file named **KiCad.7z**. -4. Delete the folder `packages3d` present at the location installdirectory/share/kicad/modules/. + > Note: 7z compresssion tool can be obtained at - https://www.7-zip.org/download.html -5. Compress the folders `bin`, `lib`, `share` and `ssl` into file named **KiCad.7z**. This file should be placed at `installdirectory/`.\ -(7z compresssion tool can be obtained at - https://www.7-zip.org/download.html ) +3. Goto the `NSIS` folder and compile the script `install.nsi`. -6. Goto the `NSIS` folder and compile the script `install.nsi`.\ -(NSIS compiler can be obtained at - https://prdownloads.sourceforge.net/nsis/nsis-3.05-setup.exe?download) + > Note: NSIS compiler can be obtained at - https://prdownloads.sourceforge.net/nsis/nsis-3.05-setup.exe?download -7. Use the generated `kicad-4.0.7-i686.exe` in the `NSIS` folder as the default installer for KiCad when building installer for eSim. +4. Use the generated `kicad-4.0.7-i686.exe` in the `NSIS` folder as the default installer for KiCad when building installer for eSim. -8. Uninstall the KiCad used to build this installer. + > Note: This new generated installer should be pushed to the repository for any future requirements diff --git a/kicad-4.0.7-i686.exe b/kicad-4.0.7-i686.exe new file mode 100644 index 0000000..9feafe2 Binary files /dev/null and b/kicad-4.0.7-i686.exe differ -- cgit From 105c6d3dd694186dbcc5eae4931f98830344eb1b Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Thu, 7 Jan 2021 20:29:19 +0530 Subject: updated readme --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8b49a64..1d9b92b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ -[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -[![GitHub issues](https://img.shields.io/github/issues/fossee/KiCad-eSim)](https://github.com/fossee/KiCad-eSim/issues) +![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/fossee/KiCad-eSim?color=blueviolet) +![GitHub](https://img.shields.io/github/license/fossee/esim?color=blue) [![GitHub forks](https://img.shields.io/github/forks/fossee/KiCad-eSim)](https://github.com/fossee/KiCad-eSim/network) -[![GitHub stars](https://img.shields.io/github/stars/fossee/KiCad-eSim)](https://github.com/fossee/KiCad-eSim/stargazers) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://github.com/fossee/KiCad-eSim) -![GitHub contributors](https://img.shields.io/github/contributors/fossee/kicad-esim) +![GitHub contributors](https://img.shields.io/github/contributors/fossee/KiCad-eSim) KiCad Installer for eSim ==== -- cgit