2021-01-23 03:23:47 +00:00
|
|
|
; This file is part of Notepad++ project
|
|
|
|
; Copyright (C)2021 Don HO <don.h@free.fr>
|
2016-09-21 18:55:10 +00:00
|
|
|
;
|
2021-01-23 03:23:47 +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 3 of the License, or
|
|
|
|
; at your option any later version.
|
2016-09-21 18:55:10 +00:00
|
|
|
;
|
|
|
|
; This program is distributed in the hope that it will be useful,
|
|
|
|
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2021-01-23 03:23:47 +00:00
|
|
|
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2016-09-21 18:55:10 +00:00
|
|
|
; GNU General Public License for more details.
|
2021-01-23 03:23:47 +00:00
|
|
|
;
|
2016-09-21 18:55:10 +00:00
|
|
|
; You should have received a copy of the GNU General Public License
|
2021-01-23 03:23:47 +00:00
|
|
|
; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2016-09-21 18:55:10 +00:00
|
|
|
|
2016-10-02 12:38:17 +00:00
|
|
|
Var UPDATE_PATH
|
2018-11-04 21:21:04 +00:00
|
|
|
Var PLUGIN_INST_PATH
|
2018-12-06 01:31:39 +00:00
|
|
|
Var USER_PLUGIN_CONF_PATH
|
|
|
|
Var ALLUSERS_PLUGIN_CONF_PATH
|
2016-09-09 21:26:15 +00:00
|
|
|
Function setPathAndOptions
|
2018-02-25 10:07:54 +00:00
|
|
|
${If} $UPDATE_PATH == ""
|
2018-12-06 01:31:39 +00:00
|
|
|
${OrIf} $PLUGIN_INST_PATH == ""
|
|
|
|
${OrIf} $USER_PLUGIN_CONF_PATH == ""
|
|
|
|
${OrIf} $ALLUSERS_PLUGIN_CONF_PATH == ""
|
2018-02-25 10:07:54 +00:00
|
|
|
Goto initUpdatePath
|
|
|
|
${ELSE}
|
|
|
|
Goto alreadyDone
|
|
|
|
${EndIf}
|
2018-12-06 01:31:39 +00:00
|
|
|
|
2018-02-25 10:07:54 +00:00
|
|
|
initUpdatePath:
|
|
|
|
|
2016-09-09 21:26:15 +00:00
|
|
|
; Set Section properties
|
|
|
|
SetOverwrite on
|
|
|
|
StrCpy $UPDATE_PATH $INSTDIR
|
|
|
|
|
|
|
|
SetOutPath "$INSTDIR\"
|
|
|
|
|
2019-01-25 01:10:11 +00:00
|
|
|
StrCpy $PLUGIN_INST_PATH "$INSTDIR\plugins"
|
|
|
|
StrCpy $ALLUSERS_PLUGIN_CONF_PATH "$PLUGIN_INST_PATH\Config"
|
|
|
|
|
2016-09-09 21:26:15 +00:00
|
|
|
${If} $noUserDataChecked == ${BST_CHECKED}
|
2018-12-06 01:31:39 +00:00
|
|
|
|
2016-09-09 21:26:15 +00:00
|
|
|
File "..\bin\doLocalConf.xml"
|
2019-01-25 01:10:11 +00:00
|
|
|
StrCpy $USER_PLUGIN_CONF_PATH "$ALLUSERS_PLUGIN_CONF_PATH"
|
2018-11-04 21:21:04 +00:00
|
|
|
CreateDirectory $PLUGIN_INST_PATH\config
|
2016-09-09 21:26:15 +00:00
|
|
|
${ELSE}
|
2018-12-06 01:31:39 +00:00
|
|
|
|
2016-09-09 21:26:15 +00:00
|
|
|
IfFileExists $INSTDIR\doLocalConf.xml 0 +2
|
|
|
|
Delete $INSTDIR\doLocalConf.xml
|
2018-12-01 23:58:07 +00:00
|
|
|
|
2018-12-06 01:31:39 +00:00
|
|
|
StrCpy $USER_PLUGIN_CONF_PATH "$APPDATA\${APPNAME}\plugins\Config"
|
2016-10-02 12:38:17 +00:00
|
|
|
StrCpy $UPDATE_PATH "$APPDATA\${APPNAME}"
|
2016-09-09 21:26:15 +00:00
|
|
|
CreateDirectory $UPDATE_PATH\plugins\config
|
|
|
|
${EndIf}
|
2018-12-06 01:31:39 +00:00
|
|
|
|
2019-01-25 01:10:11 +00:00
|
|
|
; WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "UPDATE_PATH" $UPDATE_PATH
|
|
|
|
; WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "PLUGIN_INST_PATH" $PLUGIN_INST_PATH
|
|
|
|
; WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "USER_PLUGIN_CONF_PATH" $USER_PLUGIN_CONF_PATH
|
|
|
|
; WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "ALLUSERS_PLUGIN_CONF_PATH" $ALLUSERS_PLUGIN_CONF_PATH
|
2018-11-24 16:30:19 +00:00
|
|
|
|
2018-02-25 10:07:54 +00:00
|
|
|
alreadyDone:
|
2016-09-09 21:26:15 +00:00
|
|
|
FunctionEnd
|
2018-12-06 01:31:39 +00:00
|
|
|
|
|
|
|
Function un.setPathAndOptions
|
|
|
|
ReadINIStr $UPDATE_PATH "$INSTDIR\uninstall.ini" "Uninstall" "UPDATE_PATH"
|
|
|
|
ReadINIStr $PLUGIN_INST_PATH "$INSTDIR\uninstall.ini" "Uninstall" "PLUGIN_INST_PATH"
|
|
|
|
ReadINIStr $USER_PLUGIN_CONF_PATH "$INSTDIR\uninstall.ini" "Uninstall" "USER_PLUGIN_CONF_PATH"
|
|
|
|
ReadINIStr $ALLUSERS_PLUGIN_CONF_PATH "$INSTDIR\uninstall.ini" "Uninstall" "ALLUSERS_PLUGIN_CONF_PATH"
|
|
|
|
FunctionEnd
|
|
|
|
|
2019-01-25 01:10:11 +00:00
|
|
|
|
2016-09-09 21:26:15 +00:00
|
|
|
Function copyCommonFiles
|
|
|
|
SetOverwrite off
|
|
|
|
SetOutPath "$UPDATE_PATH\"
|
|
|
|
File "..\bin\contextMenu.xml"
|
|
|
|
|
|
|
|
SetOverwrite on
|
|
|
|
SetOutPath "$INSTDIR\"
|
|
|
|
File "..\bin\langs.model.xml"
|
|
|
|
File "..\bin\stylers.model.xml"
|
|
|
|
File "..\bin\contextMenu.xml"
|
|
|
|
|
|
|
|
SetOverwrite off
|
|
|
|
File "..\bin\shortcuts.xml"
|
2019-01-27 01:53:02 +00:00
|
|
|
|
2016-09-09 21:26:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
; Set Section Files and Shortcuts
|
|
|
|
SetOverwrite on
|
|
|
|
File "..\..\LICENSE"
|
|
|
|
File "..\bin\change.log"
|
|
|
|
File "..\bin\readme.txt"
|
|
|
|
|
|
|
|
!ifdef ARCH64
|
|
|
|
File "..\bin64\SciLexer.dll"
|
|
|
|
File "..\bin64\notepad++.exe"
|
|
|
|
!else
|
|
|
|
File "..\bin\SciLexer.dll"
|
|
|
|
File "..\bin\notepad++.exe"
|
|
|
|
!endif
|
2019-03-03 02:12:27 +00:00
|
|
|
|
|
|
|
; Markdown in user defined languages
|
|
|
|
SetOutPath "$UPDATE_PATH\userDefineLangs\"
|
2020-10-24 19:12:19 +00:00
|
|
|
Delete "$UPDATE_PATH\userDefineLangs\userDefinedLang-markdown.default.modern.xml"
|
2020-10-24 16:51:48 +00:00
|
|
|
File "..\bin\userDefineLangs\markdown._preinstalled.udl.xml"
|
2019-03-03 02:12:27 +00:00
|
|
|
|
2016-09-09 21:26:15 +00:00
|
|
|
; Localization
|
|
|
|
; Default language English
|
|
|
|
SetOutPath "$INSTDIR\localization\"
|
|
|
|
File ".\nativeLang\english.xml"
|
|
|
|
|
|
|
|
; Copy all the language files to the temp directory
|
|
|
|
; than make them installed via option
|
2016-10-14 21:55:13 +00:00
|
|
|
SetOutPath "$PLUGINSDIR\nppLocalization\"
|
2016-09-09 21:26:15 +00:00
|
|
|
File ".\nativeLang\"
|
|
|
|
|
|
|
|
IfFileExists "$UPDATE_PATH\nativeLang.xml" 0 +2
|
|
|
|
Delete "$UPDATE_PATH\nativeLang.xml"
|
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\nativeLang.xml" 0 +2
|
|
|
|
Delete "$INSTDIR\nativeLang.xml"
|
|
|
|
|
2021-02-06 23:15:51 +00:00
|
|
|
StrCmp $LANGUAGE ${LANG_ENGLISH} +5 0
|
2016-10-14 21:55:13 +00:00
|
|
|
CopyFiles "$PLUGINSDIR\nppLocalization\$(langFileName)" "$UPDATE_PATH\nativeLang.xml"
|
|
|
|
CopyFiles "$PLUGINSDIR\nppLocalization\$(langFileName)" "$INSTDIR\localization\$(langFileName)"
|
2021-02-06 23:15:51 +00:00
|
|
|
IfFileExists "$PLUGINSDIR\gupLocalization\$(langFileName)" 0 +2
|
|
|
|
CopyFiles "$PLUGINSDIR\gupLocalization\$(langFileName)" "$INSTDIR\updater\nativeLang.xml"
|
2016-09-09 21:26:15 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
|
|
Function removeUnstablePlugins
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function removeOldContextMenu
|
|
|
|
; Context Menu Management : removing old version of Context Menu module
|
|
|
|
IfFileExists "$INSTDIR\nppcm.dll" 0 +3
|
|
|
|
Exec 'regsvr32 /u /s "$INSTDIR\nppcm.dll"'
|
|
|
|
Delete "$INSTDIR\nppcm.dll"
|
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\NppShell.dll" 0 +3
|
|
|
|
Exec 'regsvr32 /u /s "$INSTDIR\NppShell.dll"'
|
|
|
|
Delete "$INSTDIR\NppShell.dll"
|
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\NppShell_01.dll" 0 +3
|
|
|
|
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"'
|
|
|
|
Delete "$INSTDIR\NppShell_01.dll"
|
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\NppShell_02.dll" 0 +3
|
|
|
|
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_02.dll"'
|
|
|
|
Delete "$INSTDIR\NppShell_02.dll"
|
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\NppShell_03.dll" 0 +3
|
|
|
|
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_03.dll"'
|
|
|
|
Delete "$INSTDIR\NppShell_03.dll"
|
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\NppShell_04.dll" 0 +3
|
|
|
|
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_04.dll"'
|
|
|
|
Delete "$INSTDIR\NppShell_04.dll"
|
|
|
|
|
|
|
|
IfFileExists "$INSTDIR\NppShell_05.dll" 0 +3
|
|
|
|
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_05.dll"'
|
|
|
|
Delete "$INSTDIR\NppShell_05.dll"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function shortcutLinkManagement
|
|
|
|
; remove all the npp shortcuts from current user
|
|
|
|
Delete "$DESKTOP\Notepad++.lnk"
|
2018-03-26 08:34:43 +00:00
|
|
|
Delete "$SMPROGRAMS\Notepad++.lnk"
|
2016-10-02 12:38:17 +00:00
|
|
|
Delete "$SMPROGRAMS\${APPNAME}\Notepad++.lnk"
|
|
|
|
Delete "$SMPROGRAMS\${APPNAME}\readme.lnk"
|
|
|
|
Delete "$SMPROGRAMS\${APPNAME}\Uninstall.lnk"
|
|
|
|
RMDir "$SMPROGRAMS\${APPNAME}"
|
2016-09-09 21:26:15 +00:00
|
|
|
|
|
|
|
; detect the right of
|
|
|
|
UserInfo::GetAccountType
|
|
|
|
Pop $1
|
|
|
|
StrCmp $1 "Admin" 0 +2
|
|
|
|
SetShellVarContext all
|
|
|
|
|
|
|
|
; set the shortcuts working directory
|
|
|
|
; http://nsis.sourceforge.net/Docs/Chapter4.html#createshortcut
|
|
|
|
SetOutPath "$INSTDIR\"
|
|
|
|
|
|
|
|
; add all the npp shortcuts for all user or current user
|
2018-03-26 08:34:43 +00:00
|
|
|
CreateShortCut "$SMPROGRAMS\Notepad++.lnk" "$INSTDIR\notepad++.exe"
|
2016-09-09 21:26:15 +00:00
|
|
|
${If} $createShortcutChecked == ${BST_CHECKED}
|
|
|
|
CreateShortCut "$DESKTOP\Notepad++.lnk" "$INSTDIR\notepad++.exe"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
SetShellVarContext current
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|