comparison nsis/gvim.nsi @ 34630:250793f9b574

NSIS: Update nsis installer and nsis docs (#14256) Commit: https://github.com/vim/vim/commit/51c94b650632f17f23efba1de928442d3e859b7d Author: Restorer <69863286+RestorerZ@users.noreply.github.com> Date: Sun Mar 24 09:41:18 2024 +0000 NSIS: Update nsis installer and nsis docs (https://github.com/vim/vim/issues/14256) Signed-off-by: RestorerZ <restorer@mail2k.ru> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 24 Mar 2024 10:45:03 +0100
parents d91ac228d7df
children 857eb73fb6a7
comparison
equal deleted inserted replaced
34629:80a9b43d299b 34630:250793f9b574
1 # NSIS file to create a self-installing exe for Vim. 1 # NSIS file to create a self-installing exe for Vim.
2 # It requires NSIS version 3.0 or later. 2 # It requires NSIS version 3.0 or later.
3 # Last Change: 2024 Mar 17 3 # Last Change: 2024 Mar 18
4 4
5 Unicode true 5 Unicode true
6 6
7 # WARNING: if you make changes to this script, look out for $0 to be valid, 7 # WARNING: if you make changes to this script, look out for $0 to be valid,
8 # because uninstall deletes most files in $0. 8 # because uninstall deletes most files in $0.
15 # Location of runtime files 15 # Location of runtime files
16 !ifndef VIMRT 16 !ifndef VIMRT
17 !define VIMRT ".." 17 !define VIMRT ".."
18 !endif 18 !endif
19 19
20 # Location of extra tools: diff.exe 20 # Location of extra tools: diff.exe, winpty{32|64}.dll, winpty-agent.exe, etc.
21 !ifndef VIMTOOLS 21 !ifndef VIMTOOLS
22 !define VIMTOOLS ..\.. 22 !define VIMTOOLS ..\..
23 !endif 23 !endif
24 24
25 # Location of gettext. 25 # Location of gettext.
27 # See README.txt for detail. 27 # See README.txt for detail.
28 !ifndef GETTEXT 28 !ifndef GETTEXT
29 !define GETTEXT ${VIMRT} 29 !define GETTEXT ${VIMRT}
30 !endif 30 !endif
31 31
32 # Comment the next line if you don't have UPX. 32 # If you have UPX, use the switch /DHAVE_UPX=1 on the command line makensis.exe.
33 # Get it at https://upx.github.io/ 33 # This property will be set to 1. Get it at https://upx.github.io/
34 !define HAVE_UPX 34 !ifndef HAVE_UPX
35 35 !define HAVE_UPX 0
36 # Comment the next line if you do not want to add Native Language Support 36 !endif
37 !define HAVE_NLS 37
38 38 # If you do not want to add Native Language Support, use the switch /DHAVE_NLS=0
39 # Comment the following line to create an English-only installer: 39 # in the command line makensis.exe. This property will be set to 0.
40 !define HAVE_MULTI_LANG 40 !ifndef HAVE_NLS
41 41 !define HAVE_NLS 1
42 # Uncomment the next line if you want to create a 64-bit installer. 42 !endif
43 #!define WIN64 43
44 # To create an English-only the installer, use the switch /DHAVE_MULTI_LANG=0 on
45 # the command line makensis.exe. This property will be set to 0.
46 !ifndef HAVE_MULTI_LANG
47 !define HAVE_MULTI_LANG 1
48 !endif
49
50 # if you want to create a 64-bit the installer, use the switch /DWIN64=1 on
51 # the command line makensis.exe. This property will be set to 1.
52 !ifndef WIN64
53 !define WIN64 0
54 !endif
44 55
45 !include gvim_version.nsh # for version number 56 !include gvim_version.nsh # for version number
46 57
47 # Definition of Patch for Vim 58 # Definition of Patch for Vim.
48 !ifndef PATCHLEVEL 59 !ifndef PATCHLEVEL
49 !define PATCHLEVEL 0 60 !define PATCHLEVEL 0
50 !endif 61 !endif
51 62
52 # ----------- No configurable settings below this line ----------- 63 # ----------- No configurable settings below this line -----------
53 64
54 !include "Library.nsh" # For DLL install 65 !include "Library.nsh" # for DLL install
55 !include "LogicLib.nsh" 66 !include "LogicLib.nsh"
56 !include "MUI2.nsh" 67 !include "MUI2.nsh"
57 !include "nsDialogs.nsh" 68 !include "nsDialogs.nsh"
58 !include "Sections.nsh" 69 !include "Sections.nsh"
59 !include "x64.nsh" 70 !include "x64.nsh"
91 102
92 !define PRODUCT "Vim ${VER_MAJOR}.${VER_MINOR}" 103 !define PRODUCT "Vim ${VER_MAJOR}.${VER_MINOR}"
93 !define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall" 104 !define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall"
94 !define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}" 105 !define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}"
95 106
96 !ifdef WIN64 107 !if ${WIN64}
97 Name "${PRODUCT} (x64)" 108 Name "${PRODUCT} (x64)"
98 !else 109 !else
99 Name "${PRODUCT}" 110 Name "${PRODUCT}"
100 !endif 111 !endif
101 OutFile gvim${VER_MAJOR}${VER_MINOR}.exe 112 OutFile gvim${VER_MAJOR}${VER_MINOR}.exe
104 SetCompressorDictSize 64 115 SetCompressorDictSize 64
105 ManifestDPIAware true 116 ManifestDPIAware true
106 SetDatablockOptimize on 117 SetDatablockOptimize on
107 RequestExecutionLevel highest 118 RequestExecutionLevel highest
108 119
109 !ifdef HAVE_UPX 120 !if ${HAVE_UPX}
110 !packhdr temp.dat "upx --best --compress-icons=1 temp.dat" 121 !packhdr temp.dat "upx --best --compress-icons=1 temp.dat"
111 !endif 122 !endif
112 123
113 !ifdef WIN64 124 !if ${WIN64}
114 !define BIT 64 125 !define BIT 64
115 !else 126 !else
116 !define BIT 32 127 !define BIT 32
117 !endif 128 !endif
118 129
148 !define MUI_FINISHPAGE_RUN_FUNCTION LaunchApplication 159 !define MUI_FINISHPAGE_RUN_FUNCTION LaunchApplication
149 !define MUI_FINISHPAGE_RUN_TEXT $(str_show_readme) 160 !define MUI_FINISHPAGE_RUN_TEXT $(str_show_readme)
150 161
151 # This adds '\Vim' to the user choice automagically. The actual value is 162 # This adds '\Vim' to the user choice automagically. The actual value is
152 # obtained below with CheckOldVim. 163 # obtained below with CheckOldVim.
153 !ifdef WIN64 164 !if ${WIN64}
154 !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim" 165 !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
155 !else 166 !else
156 !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim" 167 !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
157 !endif 168 !endif
158 InstallDir ${DEFAULT_INSTDIR} 169 InstallDir ${DEFAULT_INSTDIR}
192 203
193 !insertmacro MUI_RESERVEFILE_LANGDLL 204 !insertmacro MUI_RESERVEFILE_LANGDLL
194 !include "lang\english.nsi" 205 !include "lang\english.nsi"
195 206
196 # Include support for other languages: 207 # Include support for other languages:
197 !ifdef HAVE_MULTI_LANG 208 !if ${HAVE_MULTI_LANG}
198 !include "lang\danish.nsi" 209 !include "lang\danish.nsi"
199 !include "lang\dutch.nsi" 210 !include "lang\dutch.nsi"
200 !include "lang\german.nsi" 211 !include "lang\german.nsi"
201 !include "lang\greek.nsi" 212 !include "lang\greek.nsi"
202 !include "lang\italian.nsi" 213 !include "lang\italian.nsi"
596 StrCpy $1 "$1 -create-directories vim" 607 StrCpy $1 "$1 -create-directories vim"
597 SectionEnd 608 SectionEnd
598 SectionGroupEnd 609 SectionGroupEnd
599 610
600 ########################################################## 611 ##########################################################
601 !ifdef HAVE_NLS 612 !if ${HAVE_NLS}
602 Section "$(str_section_nls)" id_section_nls 613 Section "$(str_section_nls)" id_section_nls
603 SectionIn 1 3 614 SectionIn 1 3
604 615
605 SetOutPath $0\lang 616 SetOutPath $0\lang
606 File /r /x Makefile ${VIMRT}\lang\*.* 617 File /r /x Makefile ${VIMRT}\lang\*.*
686 ${EndIf} 697 ${EndIf}
687 ${If} ${SectionIsSelected} ${id_section_editwith} 698 ${If} ${SectionIsSelected} ${id_section_editwith}
688 SectionGetSize ${id_section_editwith} $4 699 SectionGetSize ${id_section_editwith} $4
689 IntOp $3 $3 + $4 700 IntOp $3 $3 + $4
690 ${EndIf} 701 ${EndIf}
691 !ifdef HAVE_NLS 702 !if ${HAVE_NLS}
692 ${If} ${SectionIsSelected} ${id_section_nls} 703 ${If} ${SectionIsSelected} ${id_section_nls}
693 SectionGetSize ${id_section_nls} $4 704 SectionGetSize ${id_section_nls} $4
694 IntOp $3 $3 + $4 705 IntOp $3 $3 + $4
695 ${EndIf} 706 ${EndIf}
696 !endif 707 !endif
716 !insertmacro SaveSectionSelection ${id_section_startmenu} "select_startmenu" 727 !insertmacro SaveSectionSelection ${id_section_startmenu} "select_startmenu"
717 !insertmacro SaveSectionSelection ${id_section_editwith} "select_editwith" 728 !insertmacro SaveSectionSelection ${id_section_editwith} "select_editwith"
718 !insertmacro SaveSectionSelection ${id_section_vimrc} "select_vimrc" 729 !insertmacro SaveSectionSelection ${id_section_vimrc} "select_vimrc"
719 !insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome" 730 !insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome"
720 !insertmacro SaveSectionSelection ${id_section_pluginvim} "select_pluginvim" 731 !insertmacro SaveSectionSelection ${id_section_pluginvim} "select_pluginvim"
721 !ifdef HAVE_NLS 732 !if ${HAVE_NLS}
722 !insertmacro SaveSectionSelection ${id_section_nls} "select_nls" 733 !insertmacro SaveSectionSelection ${id_section_nls} "select_nls"
723 !endif 734 !endif
724 ${If} ${RunningX64} 735 ${If} ${RunningX64}
725 SetRegView lastused 736 SetRegView lastused
726 ${EndIf} 737 ${EndIf}
749 StrCpy ${out_var} ${default_value} 760 StrCpy ${out_var} ${default_value}
750 ${EndIf} 761 ${EndIf}
751 !macroend 762 !macroend
752 763
753 Function .onInit 764 Function .onInit
754 !ifdef HAVE_MULTI_LANG 765 !if ${HAVE_MULTI_LANG}
755 # Select a language (or read from the registry). 766 # Select a language (or read from the registry).
756 !insertmacro MUI_LANGDLL_DISPLAY 767 !insertmacro MUI_LANGDLL_DISPLAY
757 !endif 768 !endif
758 769
759 ${If} $INSTDIR == ${DEFAULT_INSTDIR} 770 ${If} $INSTDIR == ${DEFAULT_INSTDIR}
787 !insertmacro LoadSectionSelection ${id_section_startmenu} "select_startmenu" 798 !insertmacro LoadSectionSelection ${id_section_startmenu} "select_startmenu"
788 !insertmacro LoadSectionSelection ${id_section_editwith} "select_editwith" 799 !insertmacro LoadSectionSelection ${id_section_editwith} "select_editwith"
789 !insertmacro LoadSectionSelection ${id_section_vimrc} "select_vimrc" 800 !insertmacro LoadSectionSelection ${id_section_vimrc} "select_vimrc"
790 !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome" 801 !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome"
791 !insertmacro LoadSectionSelection ${id_section_pluginvim} "select_pluginvim" 802 !insertmacro LoadSectionSelection ${id_section_pluginvim} "select_pluginvim"
792 !ifdef HAVE_NLS 803 !if ${HAVE_NLS}
793 !insertmacro LoadSectionSelection ${id_section_nls} "select_nls" 804 !insertmacro LoadSectionSelection ${id_section_nls} "select_nls"
794 !endif 805 !endif
795 # Load the default _vimrc settings from the registry (if any). 806 # Load the default _vimrc settings from the registry (if any).
796 !insertmacro LoadDefaultVimrc $vim_compat_stat "vim_compat" "all" 807 !insertmacro LoadDefaultVimrc $vim_compat_stat "vim_compat" "all"
797 !insertmacro LoadDefaultVimrc $vim_keymap_stat "vim_keyremap" "default" 808 !insertmacro LoadDefaultVimrc $vim_keymap_stat "vim_keyremap" "default"
961 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_editwith} $(str_desc_edit_with) 972 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_editwith} $(str_desc_edit_with)
962 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_vimrc} $(str_desc_vim_rc) 973 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_vimrc} $(str_desc_vim_rc)
963 !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin} $(str_desc_plugin) 974 !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin} $(str_desc_plugin)
964 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome} $(str_desc_plugin_home) 975 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome} $(str_desc_plugin_home)
965 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim} $(str_desc_plugin_vim) 976 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim} $(str_desc_plugin_vim)
966 !ifdef HAVE_NLS 977 !if ${HAVE_NLS}
967 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls} $(str_desc_nls) 978 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls} $(str_desc_nls)
968 !endif 979 !endif
969 !insertmacro MUI_FUNCTION_DESCRIPTION_END 980 !insertmacro MUI_FUNCTION_DESCRIPTION_END
970 981
971 982
972 ########################################################## 983 ##########################################################
973 # Uninstaller Functions and Sections 984 # Uninstaller Functions and Sections
974 985
975 Function un.onInit 986 Function un.onInit
976 !ifdef HAVE_MULTI_LANG 987 !if ${HAVE_MULTI_LANG}
977 # Get the language from the registry. 988 # Get the language from the registry.
978 !insertmacro MUI_UNGETLANGUAGE 989 !insertmacro MUI_UNGETLANGUAGE
979 !endif 990 !endif
980 FunctionEnd 991 FunctionEnd
981 992