2012-04-17 23:35:01 +00:00
; this file is part of installer for Notepad++
2016-09-09 21:26:15 +00:00
; Copyright (C)2016 Don HO <don.h@free.fr>
2009-04-24 23:34:47 +00:00
;
2012-04-17 23:35:01 +00:00
; 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; either
; version 2 of the License, or (at your option) any later version.
2009-04-24 23:34:47 +00:00
;
2012-04-17 23:35:01 +00:00
; Note that the GPL places important restrictions on "derived works", yet
; it does not provide a detailed definition of that term. To avoid
; misunderstandings, we consider an application to constitute a
; "derivative work" for the purpose of this license if it does any of the
; following:
; 1. Integrates source code from Notepad++.
; 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
; installer, such as those produced by InstallShield.
; 3. Links to a library or executes a program that does any of the above.
2009-04-24 23:34:47 +00:00
;
2012-04-17 23:35:01 +00:00
; 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.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2009-04-24 23:34:47 +00:00
2015-02-12 00:46:14 +00:00
; NSIS includes
!include "x64.nsh" ; a few simple macros to handle installations on x64 machines
!include "MUI.nsh" ; Modern UI
!include "nsDialogs.nsh" ; allows creation of custom pages in the installer
!include "Memento.nsh" ; remember user selections in the installer across runs
2016-08-15 09:10:18 +00:00
SetCompressor /SOLID lzma ; This reduces installer size by approx 30~35%
2016-09-09 21:26:15 +00:00
;SetCompressor /FINAL lzma ; This reduces installer size by approx 15~18%
2015-02-12 00:46:14 +00:00
2009-11-25 01:51:04 +00:00
2016-09-09 21:26:15 +00:00
!include "nsisInclude\winVer.nsh"
!include "nsisInclude\tools.nsh"
2009-11-25 01:51:04 +00:00
2016-09-09 21:26:15 +00:00
!include "nsisInclude\gobalDef.nsh"
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
!ifdef ARCH64
OutFile ".\build\npp.${APPVERSION}.Installer.x64.exe"
!else
OutFile ".\build\npp.${APPVERSION}.Installer.x32.exe"
2015-11-20 05:25:58 +00:00
!endif
2016-05-22 14:12:22 +00:00
; Insert CheckIfRunning function as an installer and uninstaller function.
!insertmacro CheckIfRunning ""
!insertmacro CheckIfRunning "un."
2009-04-24 23:34:47 +00:00
; Modern interface settings
!define MUI_ICON ".\images\npp_inst.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP ".\images\wizard.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ".\images\headerLeft.bmp" ; optional
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
2015-05-08 17:39:51 +00:00
!insertmacro MUI_PAGE_LICENSE "..\..\LICENSE"
2009-04-24 23:34:47 +00:00
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
2011-05-31 00:04:49 +00:00
page Custom ExtraOptions
2016-05-22 14:12:22 +00:00
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "CheckIfRunning"
2009-04-24 23:34:47 +00:00
!insertmacro MUI_PAGE_INSTFILES
2010-11-23 01:01:06 +00:00
2009-04-24 23:34:47 +00:00
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchNpp"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
2016-05-22 14:12:22 +00:00
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "un.CheckIfRunning"
2009-04-24 23:34:47 +00:00
!insertmacro MUI_UNPAGE_INSTFILES
2014-12-14 22:12:18 +00:00
; TODO for optional arg
;!insertmacro GetParameters
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
!include "nsisInclude\langs.nsh"
2013-03-17 23:31:02 +00:00
2009-04-24 23:34:47 +00:00
Function .onInit
2016-09-09 21:26:15 +00:00
Call preventInstallInWin9x
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
!insertmacro MUI_LANGDLL_DISPLAY
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
!ifdef ARCH64
${If} ${RunningX64}
; disable registry redirection (enable access to 64-bit portion of registry)
SetRegView 64
; change install dir
StrCpy $INSTDIR "$PROGRAMFILES64\${APPNAME}"
${Else}
MessageBox MB_OK "You cannot install Notepad++ 64-bit version on your 32-bit system.$\nPlease download and intall Notepad++ 32-bit version instead."
Abort
${EndIf}
!endif
2009-04-24 23:34:47 +00:00
2015-02-12 00:46:14 +00:00
${MementoSectionRestore}
FunctionEnd
Function .onInstSuccess
${MementoSectionSave}
2009-04-24 23:34:47 +00:00
FunctionEnd
2011-05-29 09:00:16 +00:00
2009-04-24 23:34:47 +00:00
Var UPDATE_PATH
2016-09-09 21:26:15 +00:00
!include "nsisInclude\mainSectionFuncs.nsh"
2015-08-13 00:22:47 +00:00
2016-09-09 21:26:15 +00:00
Section -"Notepad++" mainSection
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
Call setPathAndOptions
2009-09-11 21:48:38 +00:00
2016-09-09 21:26:15 +00:00
Call copyCommonFiles
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
Call removeUnstablePlugins
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
Call removeOldContextMenu
2009-04-24 23:34:47 +00:00
2016-09-09 21:26:15 +00:00
Call shortcutLinkManagement
2009-11-30 01:31:55 +00:00
2016-09-09 21:26:15 +00:00
Call changeIconOption
2011-05-31 00:04:49 +00:00
2009-04-24 23:34:47 +00:00
SectionEnd
2016-09-09 21:26:15 +00:00
!include "nsisInclude\autoCompletion.nsh"
!include "nsisInclude\themes.nsh"
!include "nsisInclude\binariesComponents.nsh"
2009-04-27 23:17:51 +00:00
2011-01-31 01:46:36 +00:00
InstType "Minimalist"
2009-04-24 23:34:47 +00:00
2015-02-12 00:46:14 +00:00
${MementoSectionDone}
2009-04-24 23:34:47 +00:00
;--------------------------------
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${explorerContextMenu} 'Explorer context menu entry for Notepad++ : Open whatever you want in Notepad++ from Windows Explorer.'
!insertmacro MUI_DESCRIPTION_TEXT ${autoCompletionComponent} 'Install the API files you need for the auto-completion feature (Ctrl+Space).'
2016-09-09 21:26:15 +00:00
!insertmacro MUI_DESCRIPTION_TEXT ${Plugins} 'You may need those plugins to extend the capacity of Notepad++.'
2009-05-26 23:34:45 +00:00
!insertmacro MUI_DESCRIPTION_TEXT ${Themes} 'The eye-candy to change visual effects. Use Theme selector to switch among them.'
2016-09-09 21:26:15 +00:00
!insertmacro MUI_DESCRIPTION_TEXT ${AutoUpdater} 'Keep your Notepad++ update: Check this option to install an update module which searches Notepad++ update on Internet and install it for you.'
2009-04-24 23:34:47 +00:00
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
Section -FinishSection
2016-09-09 21:26:15 +00:00
Call writeInstallInfoInRegistry
2012-05-27 13:46:46 +00:00
SectionEnd
2016-09-09 21:26:15 +00:00
!include "nsisInclude\uninstall.nsh"
2009-04-24 23:34:47 +00:00
BrandingText "Don HO"
; eof