diff options
Diffstat (limited to 'NSIS/install.nsi')
-rw-r--r-- | NSIS/install.nsi | 216 |
1 files changed, 145 insertions, 71 deletions
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 <ahoyle@hoylesolutions.co.uk> -; 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 <brian.sidebotham@gmail.com> +; +; 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 |