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"
2022-12-19 02:34:24 +00:00
File "..\src\tabContextMenu_example.xml"
2022-12-27 12:49:35 +00:00
File "..\src\toolbarIcons.xml"
2016-09-09 21:26:15 +00:00
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
2021-12-02 02:55:24 +00:00
; For debug logs
File "..\bin\nppLogNulContentCorruptionIssue.xml"
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\notepad++.exe"
2021-04-21 18:42:01 +00:00
!else ifdef ARCHARM64
File "..\binarm64\notepad++.exe"
2016-09-09 21:26:15 +00:00
!else
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"
2021-08-06 20:59:40 +00:00
File "..\bin\userDefineLangs\markdown._preinstalled_DM.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"
Add new explorer context menu entry "Edit with Notepad++" for W11
Windows 11 has its new interface for its explorer context menu. It makes the old "Edit with Notepad++" command hardly accessible. This commit improves the accessibility and also fix issue of run as an administrator (Properties set in Compatibility) in the new context menu command.
It fixes also the context menu command issue under ARM64 architecture (fixed only under Windows 11).
The localization of "Edit with Notepad++" is also possible in this commit.
Note that if the command place of "Edit with Notepad++" context menu command is taken by other application ("\HKEY_CLASSES_ROOT*\shell\pintohome"), the new context menu "Edit with Notepad++" won't be installed. User should install it him/herself.
Fix #10320, fix #10565, fix #4368, fix #8786, fix #10320, fix #10640, fix #10856, fix #10653, fix #7747, fix #6169, fix #92, close #13170
2023-02-18 16:43:24 +00:00
; Copy all the Notepad++ localization files to the temp directory
2016-09-09 21:26:15 +00:00
; 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"
Add new explorer context menu entry "Edit with Notepad++" for W11
Windows 11 has its new interface for its explorer context menu. It makes the old "Edit with Notepad++" command hardly accessible. This commit improves the accessibility and also fix issue of run as an administrator (Properties set in Compatibility) in the new context menu command.
It fixes also the context menu command issue under ARM64 architecture (fixed only under Windows 11).
The localization of "Edit with Notepad++" is also possible in this commit.
Note that if the command place of "Edit with Notepad++" context menu command is taken by other application ("\HKEY_CLASSES_ROOT*\shell\pintohome"), the new context menu "Edit with Notepad++" won't be installed. User should install it him/herself.
Fix #10320, fix #10565, fix #4368, fix #8786, fix #10320, fix #10640, fix #10856, fix #10653, fix #7747, fix #6169, fix #92, close #13170
2023-02-18 16:43:24 +00:00
2016-09-09 21:26:15 +00:00
FunctionEnd
2021-03-18 00:45:57 +00:00
; Source from: https://nsis.sourceforge.io/VersionCompare
Function VersionCompare
!define VersionCompare `!insertmacro VersionCompareCall`
!macro VersionCompareCall _VER1 _VER2 _RESULT
Push `${_VER1}`
Push `${_VER2}`
Call VersionCompare
Pop ${_RESULT}
!macroend
Exch $1
Exch
Exch $0
Exch
Push $2
Push $3
Push $4
Push $5
Push $6
Push $7
begin:
StrCpy $2 -1
IntOp $2 $2 + 1
StrCpy $3 $0 1 $2
StrCmp $3 '' +2
StrCmp $3 '.' 0 -3
StrCpy $4 $0 $2
IntOp $2 $2 + 1
StrCpy $0 $0 '' $2
StrCpy $2 -1
IntOp $2 $2 + 1
StrCpy $3 $1 1 $2
StrCmp $3 '' +2
StrCmp $3 '.' 0 -3
StrCpy $5 $1 $2
IntOp $2 $2 + 1
StrCpy $1 $1 '' $2
StrCmp $4$5 '' equal
StrCpy $6 -1
IntOp $6 $6 + 1
StrCpy $3 $4 1 $6
StrCmp $3 '0' -2
StrCmp $3 '' 0 +2
StrCpy $4 0
StrCpy $7 -1
IntOp $7 $7 + 1
StrCpy $3 $5 1 $7
StrCmp $3 '0' -2
StrCmp $3 '' 0 +2
StrCpy $5 0
StrCmp $4 0 0 +2
StrCmp $5 0 begin newer2
StrCmp $5 0 newer1
IntCmp $6 $7 0 newer1 newer2
StrCpy $4 '1$4'
StrCpy $5 '1$5'
IntCmp $4 $5 begin newer2 newer1
equal:
StrCpy $0 0
goto end
newer1:
StrCpy $0 1
goto end
newer2:
StrCpy $0 2
end:
Pop $7
Pop $6
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Exch $0
FunctionEnd
2016-09-09 21:26:15 +00:00
2021-03-18 00:45:57 +00:00
Function removeUnstablePlugins
; remove unstable plugins
CreateDirectory "$INSTDIR\plugins\disabled"
2021-03-22 02:27:44 +00:00
; NppSaveAsAdmin makes Notepad++ crash. "1.0.211.0" is its 1st version which contains the fix
IfFileExists "$INSTDIR\plugins\NppSaveAsAdmin\NppSaveAsAdmin.dll" 0 NppSaveAsAdminTestEnd
2021-03-18 00:45:57 +00:00
${GetFileVersion} "$INSTDIR\plugins\NppSaveAsAdmin\NppSaveAsAdmin.dll" $R0
${VersionCompare} $R0 "1.0.211.0" $R1 ; 0: equal to 1.0.211.0 1: $R0 is newer 2: 1.0.211.0 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to NppSaveAsAdmin plugin's incompatibility issue in version $R0, NppSaveAsAdmin.dll will be deleted. Use Plugins Admin to add back (the latest version of) NppSaveAsAdmin." /SD IDOK
Rename "$INSTDIR\plugins\NppSaveAsAdmin\NppSaveAsAdmin.dll" "$INSTDIR\plugins\disabled\NppSaveAsAdmin.dll"
Delete "$INSTDIR\plugins\NppSaveAsAdmin\NppSaveAsAdmin.dll"
2021-12-31 20:03:10 +00:00
NppSaveAsAdminTestEnd:
2022-01-31 04:03:18 +00:00
!ifdef ARCH64 || ARCHARM64 ; x64 or ARM64
2022-02-02 15:51:06 +00:00
; HexEditor makes Notepad++ x64 crash. "0.9.12" is its 1st version which contains the fix
2022-01-31 04:03:18 +00:00
IfFileExists "$INSTDIR\plugins\HexEditor\HexEditor.dll" 0 HexEditorTestEnd64
2022-02-02 15:51:06 +00:00
${GetFileVersion} "$INSTDIR\plugins\HexEditor\HexEditor.dll" $R0
${VersionCompare} $R0 "0.9.12" $R1 ; 0: equal to 0.9.12 1: $R0 is newer 2: 0.9.12 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to HexEditor plugin's incompatibility issue in version $R0, HexEditor.dll will be deleted. Use Plugins Admin to add back (the latest version of) HexEditor." /SD IDOK
2022-01-31 04:03:18 +00:00
Rename "$INSTDIR\plugins\HexEditor\HexEditor.dll" "$INSTDIR\plugins\disabled\HexEditor.dll"
Delete "$INSTDIR\plugins\HexEditor\HexEditor.dll"
HexEditorTestEnd64:
2022-02-03 01:46:29 +00:00
; ComparePlugin makes Notepad++ x64 crash. "2.0.2" is its 1st version which contains the fix
2022-01-31 04:03:18 +00:00
IfFileExists "$INSTDIR\plugins\ComparePlugin\ComparePlugin.dll" 0 CompareTestEnd64
2022-02-03 01:46:29 +00:00
${GetFileVersion} "$INSTDIR\plugins\ComparePlugin\ComparePlugin.dll" $R0
${VersionCompare} $R0 "2.0.2" $R1 ; 0: equal to 2.0.2 1: $R0 is newer 2: 2.0.2 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to ComparePlugin plugin's incompatibility issue in version $R0, ComparePlugin.dll will be deleted. Use Plugins Admin to add back (the latest version of) ComparePlugin." /SD IDOK
2022-01-31 04:03:18 +00:00
Rename "$INSTDIR\plugins\ComparePlugin\ComparePlugin.dll" "$INSTDIR\plugins\disabled\ComparePlugin.dll"
Delete "$INSTDIR\plugins\ComparePlugin\ComparePlugin.dll"
CompareTestEnd64:
2022-02-03 22:35:12 +00:00
; DSpellCheck makes Notepad++ x64 crash. "1.4.23" is its 1st version which contains the fix
2022-01-31 04:03:18 +00:00
IfFileExists "$INSTDIR\plugins\DSpellCheck\DSpellCheck.dll" 0 DSpellCheckTestEnd64
2022-02-03 22:35:12 +00:00
${GetFileVersion} "$INSTDIR\plugins\DSpellCheck\DSpellCheck.dll" $R0
${VersionCompare} $R0 "1.4.23" $R1 ; 0: equal to 1.4.23 1: $R0 is newer 2: 1.4.23 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to DSpellCheck plugin's incompatibility issue in version $R0, DSpellCheck.dll will be deleted. Use Plugins Admin to add back (the latest version of) DSpellCheck." /SD IDOK
2022-01-31 04:03:18 +00:00
Rename "$INSTDIR\plugins\DSpellCheck\DSpellCheck.dll" "$INSTDIR\plugins\disabled\DSpellCheck.dll"
Delete "$INSTDIR\plugins\DSpellCheck\DSpellCheck.dll"
DSpellCheckTestEnd64:
2022-02-15 15:32:03 +00:00
; SpeechPlugin makes Notepad++ x64 crash. "0.4.0.0" is its 1st version which contains the fix
2022-02-02 15:51:06 +00:00
IfFileExists "$INSTDIR\plugins\SpeechPlugin\SpeechPlugin.dll" 0 SpeechPluginTestEnd64
2022-02-15 15:32:03 +00:00
${GetFileVersion} "$INSTDIR\plugins\SpeechPlugin\SpeechPlugin.dll" $R0
${VersionCompare} $R0 "0.4.0.0" $R1 ; 0: equal to 0.4.0.0 1: $R0 is newer 2: 0.4.0.0 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to SpeechPlugin plugin's incompatibility issue in version $R0, SpeechPlugin.dll will be deleted. Use Plugins Admin to add back (the latest version of) SpeechPlugin." /SD IDOK
2022-02-02 15:51:06 +00:00
Rename "$INSTDIR\plugins\SpeechPlugin\SpeechPlugin.dll" "$INSTDIR\plugins\disabled\SpeechPlugin.dll"
Delete "$INSTDIR\plugins\SpeechPlugin\SpeechPlugin.dll"
SpeechPluginTestEnd64:
2022-02-03 22:35:12 +00:00
2022-02-18 10:01:49 +00:00
; XMLTools makes Notepad++ x64 crash. "3.1.1.12" is its 1st version which contains the fix
IfFileExists "$INSTDIR\plugins\XMLTools\XMLTools.dll" 0 XMLToolsTestEnd64
${GetFileVersion} "$INSTDIR\plugins\XMLTools\XMLTools.dll" $R0
${VersionCompare} $R0 "3.1.1.12" $R1 ; 0: equal to 3.1.1.12 1: $R0 is newer 2: 3.1.1.12 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to XMLTools plugin's incompatibility issue in version $R0, XMLTools.dll will be deleted. Use Plugins Admin to add back (the latest version of) XMLTools." /SD IDOK
Rename "$INSTDIR\plugins\XMLTools\XMLTools.dll" "$INSTDIR\plugins\disabled\XMLTools.dll"
Delete "$INSTDIR\plugins\XMLTools\XMLTools.dll"
XMLToolsTestEnd64:
2022-02-19 19:02:06 +00:00
; NppTaskList makes Notepad++ x64 crash. "2.4" is its 1st version which contains the fix
IfFileExists "$INSTDIR\plugins\NppTaskList\NppTaskList.dll" 0 NppTaskListTestEnd64
${GetFileVersion} "$INSTDIR\plugins\NppTaskList\NppTaskList.dll" $R0
${VersionCompare} $R0 "2.4" $R1 ; 0: equal to 2.4 1: $R0 is newer 2: 2.4 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to NppTaskList plugin's incompatibility issue in version $R0, NppTaskList.dll will be deleted. Use Plugins Admin to add back (the latest version of) NppTaskList." /SD IDOK
Rename "$INSTDIR\plugins\NppTaskList\NppTaskList.dll" "$INSTDIR\plugins\disabled\NppTaskList.dll"
Delete "$INSTDIR\plugins\NppTaskList\NppTaskList.dll"
NppTaskListTestEnd64:
2022-06-27 20:23:30 +00:00
; jN makes Notepad++ x64 crash. "2.2.185.7" is its 1st version which contains the fix
IfFileExists "$INSTDIR\plugins\jN\jN.dll" 0 jN64
${GetFileVersion} "$INSTDIR\plugins\jN\jN.dll" $R0
${VersionCompare} $R0 "2.2.185.7" $R1 ; 0: equal to 2.2.185.7 1: $R0 is newer 2: 2.4 is newer
StrCmp $R1 "0" +5 0 ; if equal skip all & go to end, else go to next
StrCmp $R1 "1" +4 0 ; if newer skip all & go to end, else older (2) then go to next
MessageBox MB_OK "Due to jN plugin's incompatibility issue in version $R0, jN.dll will be deleted. Use Plugins Admin to add back (the latest version of) jN." /SD IDOK
Rename "$INSTDIR\plugins\jN\jN.dll" "$INSTDIR\plugins\disabled\jN.dll"
Delete "$INSTDIR\plugins\jN\jN.dll"
jN64:
2022-02-19 19:02:06 +00:00
2022-02-02 15:51:06 +00:00
IfFileExists "$INSTDIR\plugins\NppQCP\NppQCP.dll" 0 NppQCPTestEnd64
MessageBox MB_OK "Due to NppQCP plugin's crash issue on Notepad++ x64 binary, NppQCP.dll will be removed." /SD IDOK
Rename "$INSTDIR\plugins\NppQCP\NppQCP.dll" "$INSTDIR\plugins\disabled\NppQCP.dll"
Delete "$INSTDIR\plugins\NppQCP\NppQCP.dll"
NppQCPTestEnd64:
2022-02-19 16:40:32 +00:00
2022-01-31 04:03:18 +00:00
!else ; 32-bit installer
2021-12-31 20:03:10 +00:00
; https://github.com/chcg/NPP_HexEdit/issues/51
2022-01-31 04:03:18 +00:00
IfFileExists "$INSTDIR\plugins\HexEditor\HexEditor.dll" 0 noDeleteHEPlugin32
2022-01-31 20:28:12 +00:00
MessageBox MB_YESNO "HexEditor plugin is unstable, we suggest you to remove it.$\nRemove HexEditor plugin?" /SD IDYES IDYES doDeleteHEPlugin32 IDNO noDeleteHEPlugin32 ;IDYES remove
2022-01-31 04:03:18 +00:00
doDeleteHEPlugin32:
2021-12-31 20:03:10 +00:00
Rename "$INSTDIR\plugins\HexEditor\HexEditor.dll" "$INSTDIR\plugins\disabled\HexEditor.dll"
Delete "$INSTDIR\plugins\HexEditor\HexEditor.dll"
2022-01-31 04:03:18 +00:00
noDeleteHEPlugin32:
!endif
2016-09-09 21:26:15 +00:00
FunctionEnd
Function removeOldContextMenu
; Context Menu Management : removing old version of Context Menu module
IfFileExists "$INSTDIR\nppcm.dll" 0 +3
2023-04-11 15:59:38 +00:00
ExecWait 'regsvr32 /u /s "$INSTDIR\nppcm.dll"'
2016-09-09 21:26:15 +00:00
Delete "$INSTDIR\nppcm.dll"
IfFileExists "$INSTDIR\NppShell.dll" 0 +3
2023-04-11 15:59:38 +00:00
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell.dll"'
2016-09-09 21:26:15 +00:00
Delete "$INSTDIR\NppShell.dll"
IfFileExists "$INSTDIR\NppShell_01.dll" 0 +3
2023-04-11 15:59:38 +00:00
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"'
2016-09-09 21:26:15 +00:00
Delete "$INSTDIR\NppShell_01.dll"
IfFileExists "$INSTDIR\NppShell_02.dll" 0 +3
2023-04-11 15:59:38 +00:00
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_02.dll"'
2016-09-09 21:26:15 +00:00
Delete "$INSTDIR\NppShell_02.dll"
IfFileExists "$INSTDIR\NppShell_03.dll" 0 +3
2023-04-11 15:59:38 +00:00
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_03.dll"'
2016-09-09 21:26:15 +00:00
Delete "$INSTDIR\NppShell_03.dll"
IfFileExists "$INSTDIR\NppShell_04.dll" 0 +3
2023-04-11 15:59:38 +00:00
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_04.dll"'
2016-09-09 21:26:15 +00:00
Delete "$INSTDIR\NppShell_04.dll"
IfFileExists "$INSTDIR\NppShell_05.dll" 0 +3
2023-04-11 15:59:38 +00:00
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_05.dll"'
2016-09-09 21:26:15 +00:00
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