forked from aniani/vim
		
	NSIS: Update nsis installer and nsis docs (#14256)
Signed-off-by: RestorerZ <restorer@mail2k.ru> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| This builds a one-click install for Vim for Win32 using the Nullsoft | This builds a one-click install for Vim for MS Windows using the Nullsoft | ||||||
| Installation System (NSIS), available at http://nsis.sourceforge.net/ | Installation System (NSIS), available at http://nsis.sourceforge.net/ | ||||||
|  |  | ||||||
| To build the installable .exe: | To build the installable .exe file: | ||||||
|  |  | ||||||
| 1.  Unpack three archives: | 1.  Unpack three archives: | ||||||
| 	PC sources | 	PC sources | ||||||
| @@ -16,10 +16,9 @@ To build the installable .exe: | |||||||
| 	install.exe, | 	install.exe, | ||||||
| 	uninstall.exe, | 	uninstall.exe, | ||||||
| 	tee/tee.exe, | 	tee/tee.exe, | ||||||
| 	xxd/xxd.exe, | 	xxd/xxd.exe | ||||||
|  |  | ||||||
|     Then execute tools/rename.bat to rename the executables. (mv command is |     Then execute tools/rename.bat to rename the executables. | ||||||
|     required.) |  | ||||||
|  |  | ||||||
| 3.  Go to the GvimExt directory and build gvimext.dll (or get it from a binary | 3.  Go to the GvimExt directory and build gvimext.dll (or get it from a binary | ||||||
|     archive).  Both 64- and 32-bit versions are needed and should be placed |     archive).  Both 64- and 32-bit versions are needed and should be placed | ||||||
| @@ -28,14 +27,22 @@ To build the installable .exe: | |||||||
| 	32-bit: src/GvimExt/gvimext.dll | 	32-bit: src/GvimExt/gvimext.dll | ||||||
|  |  | ||||||
| 4.  Get a "diff.exe" program.  If you skip this the built-in diff will always | 4.  Get a "diff.exe" program.  If you skip this the built-in diff will always | ||||||
|     be used (which is fine for most users).  If you do have your own |     be used (which is fine for most users). | ||||||
|     "diff.exe" put it in the "../.." directory (above the "vim91" directory, |  | ||||||
|     it's the same for all Vim versions). |  | ||||||
|     You can find one in previous Vim versions or in this archive: |     You can find one in previous Vim versions or in this archive: | ||||||
| 	http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz | 	https://www.mediafire.com/file/9edk4g3xvfgzby0/diff4Vim.zip/file | ||||||
|  |     When will you have "diff.exe" put it in the "../.." directory (above the | ||||||
|  |     "vim91" directory, it's the same for all Vim versions).  However, you can | ||||||
|  |     specify another directory by passing /DVIMTOOLS=<dir> option to the | ||||||
|  |     "makensis.exe" program via the command line. | ||||||
|  |  | ||||||
| 5.  Also put "winpty32.dll" and "winpty-agent.exe" in "../.." (above the "vim91" | 5.  For the terminal window to work in Vim, the library winpty is required. | ||||||
|     directory).  This is required for the terminal window. |     You can get it at the following url: | ||||||
|  | 	https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip | ||||||
|  |     For the 32-bit version, rename "winpty.dll" from ia32/bin to "winpty32.dll", | ||||||
|  |     and for the 64-bit version — "winpty.dll" from x64/bin to "winpty64.dll". | ||||||
|  |     Put the renamed file and "winpty-agent.exe" in "../.." (above the "vim91" | ||||||
|  |     directory).  However, you can specify another directory by passing | ||||||
|  |     /DVIMTOOLS=<dir> option to the "makensis.exe" program via the command line. | ||||||
|  |  | ||||||
| 6.  To use stronger encryption, add the Sodium library.  You can get it here: | 6.  To use stronger encryption, add the Sodium library.  You can get it here: | ||||||
| 	https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19-msvc.zip | 	https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19-msvc.zip | ||||||
| @@ -43,10 +50,12 @@ To build the installable .exe: | |||||||
|     path/to/libsodium/Win32/Release/v143/dynamic for the 32‐bit version or |     path/to/libsodium/Win32/Release/v143/dynamic for the 32‐bit version or | ||||||
|     path/to/libsodium/X64/Release/v143/dynamic for the 64‐bit version in the |     path/to/libsodium/X64/Release/v143/dynamic for the 64‐bit version in the | ||||||
|     "../.." directory (above the "vim91" directory, where "diff.exe" and |     "../.." directory (above the "vim91" directory, where "diff.exe" and | ||||||
|     "winpty32.dll"). |     "winpty{32|64}.dll"). | ||||||
|  |  | ||||||
| 7.  Do "make uganda.nsis.txt" in runtime/doc.  This requires sed, you may have | 7.  On MS Windows do "nmake.exe -f Make_mvc.mak uganda.nsis.txt" in runtime/doc. | ||||||
|     to do this on Unix.  Make sure the file is in DOS file format! |     On Unix-like system do "make runtime/doc/uganda.nsis.txt" in top directory | ||||||
|  |     or "make uganda.nsis.txt" in runtime/doc, and be sure to convert the file | ||||||
|  |     "uganda.nsis.txt" to DOS file format. | ||||||
|  |  | ||||||
| 8.  Get gettext and iconv DLLs from the following site: | 8.  Get gettext and iconv DLLs from the following site: | ||||||
| 	https://github.com/mlocati/gettext-iconv-windows/releases | 	https://github.com/mlocati/gettext-iconv-windows/releases | ||||||
| @@ -61,25 +70,39 @@ To build the installable .exe: | |||||||
| 	    |	libiconv-2.dll | 	    |	libiconv-2.dll | ||||||
| 	    |	libgcc_s_sjlj-1.dll | 	    |	libgcc_s_sjlj-1.dll | ||||||
| 	    | | 	    | | ||||||
| 	    ` gettext64/ | 	    + gettext64/ | ||||||
| 		libintl-8.dll | 		libintl-8.dll | ||||||
| 		libiconv-2.dll | 		libiconv-2.dll | ||||||
|  |  | ||||||
|     The default <GETTEXT directory> is "..", however, you can change it by |     The default <GETTEXT directory> is "..", however, you can specify another | ||||||
|     passing /DGETTEXT=... option to the makensis command. |     directory by passing /DGETTEXT=<dir> option to "makensis.exe" program via | ||||||
|  |     the command line. | ||||||
|  |  | ||||||
|  |  | ||||||
| Install NSIS if you didn't do that already. | Install NSIS if you didn't do that already. | ||||||
| Also install UPX, if you want a compressed file. | Download Unicode version the ShellExecAsUser plug-in for NSIS from: | ||||||
| Download and include the ShellExecAsUser.dll Unicode version which can be | 	https://nsis.sourceforge.io/ShellExecAsUser_plug-in | ||||||
| sourced from: https://nsis.sourceforge.io/ShellExecAsUser_plug-in | and put ShellExecAsUser.dll to path\to\NSIS\Plugins\x86-unicode | ||||||
|  |  | ||||||
|  |  | ||||||
| Unpack the images: | Unpack the images: | ||||||
| 	cd nsis | 	cd nsis | ||||||
| 	unzip icons.zip | 	unzip icons.zip or 7z x icons.zip (on Unix-like or MS Windows) | ||||||
|  | 	WinRar.exe x icons.zip (on MS Windows) | ||||||
|  |  | ||||||
| Then build gvim.exe: | Then build gvim.exe: | ||||||
|  |  | ||||||
| 	cd nsis | 	cd nsis | ||||||
| 	makensis gvim.nsi | 	makensis.exe [options] gvim.nsi | ||||||
|  |  | ||||||
|  | Options (not mandatory): | ||||||
|  |     /DVIMSRC=<dir>	— directory where location of gvim_ole.exe, vimw32.exe, | ||||||
|  | 			    GvimExt/*, etc. | ||||||
|  |     /DVIMRT=<dir>	— directory where location of runtime files | ||||||
|  |     /DVIMTOOLS=<dir>    — directory where location of extra tools: diff.exe, | ||||||
|  | 			    winpty{32|64}.dll, winpty-agent.exe, libsodium.dll | ||||||
|  |     /DGETTEXT=<dir>     — directory where location of gettext libraries | ||||||
|  |     /DHAVE_UPX=1	— additional compression of the installer.  UPX program | ||||||
|  | 			    must be installed. | ||||||
|  |     /DHAVE_NLS=0	— do not add native language support | ||||||
|  |     /DHAVE_MULTI_LANG=0 — to create an English-only the installer | ||||||
|  |     /DWIN64=1		— to create a 64-bit the installer | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| # NSIS file to create a self-installing exe for Vim. | # NSIS file to create a self-installing exe for Vim. | ||||||
| # It requires NSIS version 3.0 or later. | # It requires NSIS version 3.0 or later. | ||||||
| # Last Change:	2024 Mar 17 | # Last Change:	2024 Mar 18 | ||||||
|  |  | ||||||
| Unicode true | Unicode true | ||||||
|  |  | ||||||
| @@ -17,7 +17,7 @@ Unicode true | |||||||
|   !define VIMRT ".." |   !define VIMRT ".." | ||||||
| !endif | !endif | ||||||
|  |  | ||||||
| # Location of extra tools: diff.exe | # Location of extra tools: diff.exe, winpty{32|64}.dll, winpty-agent.exe, etc. | ||||||
| !ifndef VIMTOOLS | !ifndef VIMTOOLS | ||||||
|   !define VIMTOOLS ..\.. |   !define VIMTOOLS ..\.. | ||||||
| !endif | !endif | ||||||
| @@ -29,29 +29,40 @@ Unicode true | |||||||
|   !define GETTEXT ${VIMRT} |   !define GETTEXT ${VIMRT} | ||||||
| !endif | !endif | ||||||
|  |  | ||||||
| # Comment the next line if you don't have UPX. | # If you have UPX, use the switch /DHAVE_UPX=1 on the command line makensis.exe. | ||||||
| # Get it at https://upx.github.io/ | # This property will be set to 1. Get it at https://upx.github.io/ | ||||||
| !define HAVE_UPX | !ifndef HAVE_UPX | ||||||
|  |   !define HAVE_UPX 0 | ||||||
|  | !endif | ||||||
|  |  | ||||||
| # Comment the next line if you do not want to add Native Language Support | # If you do not want to add Native Language Support, use the switch /DHAVE_NLS=0 | ||||||
| !define HAVE_NLS | # in the command line makensis.exe. This property will be set to 0. | ||||||
|  | !ifndef HAVE_NLS | ||||||
|  |   !define HAVE_NLS 1 | ||||||
|  | !endif | ||||||
|  |  | ||||||
| # Comment the following line to create an English-only installer: | # To create an English-only the installer, use the switch /DHAVE_MULTI_LANG=0 on | ||||||
| !define HAVE_MULTI_LANG | # the command line makensis.exe. This property will be set to 0. | ||||||
|  | !ifndef HAVE_MULTI_LANG | ||||||
|  |   !define HAVE_MULTI_LANG 1 | ||||||
|  | !endif | ||||||
|  |  | ||||||
| # Uncomment the next line if you want to create a 64-bit installer. | # if you want to create a 64-bit the installer, use the switch /DWIN64=1 on | ||||||
| #!define WIN64 | # the command line makensis.exe. This property will be set to 1. | ||||||
|  | !ifndef WIN64 | ||||||
|  |   !define WIN64 0 | ||||||
|  | !endif | ||||||
|  |  | ||||||
| !include gvim_version.nsh	# for version number | !include gvim_version.nsh	# for version number | ||||||
|  |  | ||||||
| # Definition of Patch for Vim | # Definition of Patch for Vim. | ||||||
| !ifndef PATCHLEVEL | !ifndef PATCHLEVEL | ||||||
|   !define PATCHLEVEL 0 |   !define PATCHLEVEL 0 | ||||||
| !endif | !endif | ||||||
|  |  | ||||||
| # ----------- No configurable settings below this line ----------- | # ----------- No configurable settings below this line ----------- | ||||||
|  |  | ||||||
| !include "Library.nsh"		# For DLL install | !include "Library.nsh"		# for DLL install | ||||||
| !include "LogicLib.nsh" | !include "LogicLib.nsh" | ||||||
| !include "MUI2.nsh" | !include "MUI2.nsh" | ||||||
| !include "nsDialogs.nsh" | !include "nsDialogs.nsh" | ||||||
| @@ -93,7 +104,7 @@ Unicode true | |||||||
| !define UNINST_REG_KEY	"Software\Microsoft\Windows\CurrentVersion\Uninstall" | !define UNINST_REG_KEY	"Software\Microsoft\Windows\CurrentVersion\Uninstall" | ||||||
| !define UNINST_REG_KEY_VIM  "${UNINST_REG_KEY}\${PRODUCT}" | !define UNINST_REG_KEY_VIM  "${UNINST_REG_KEY}\${PRODUCT}" | ||||||
|  |  | ||||||
| !ifdef WIN64 | !if ${WIN64} | ||||||
| Name "${PRODUCT} (x64)" | Name "${PRODUCT} (x64)" | ||||||
| !else | !else | ||||||
| Name "${PRODUCT}" | Name "${PRODUCT}" | ||||||
| @@ -106,11 +117,11 @@ ManifestDPIAware true | |||||||
| SetDatablockOptimize on | SetDatablockOptimize on | ||||||
| RequestExecutionLevel highest | RequestExecutionLevel highest | ||||||
|  |  | ||||||
| !ifdef HAVE_UPX | !if ${HAVE_UPX} | ||||||
|   !packhdr temp.dat "upx --best --compress-icons=1 temp.dat" |   !packhdr temp.dat "upx --best --compress-icons=1 temp.dat" | ||||||
| !endif | !endif | ||||||
|  |  | ||||||
| !ifdef WIN64 | !if ${WIN64} | ||||||
| !define BIT	64 | !define BIT	64 | ||||||
| !else | !else | ||||||
| !define BIT	32 | !define BIT	32 | ||||||
| @@ -150,7 +161,7 @@ RequestExecutionLevel highest | |||||||
|  |  | ||||||
| # This adds '\Vim' to the user choice automagically.  The actual value is | # This adds '\Vim' to the user choice automagically.  The actual value is | ||||||
| # obtained below with CheckOldVim. | # obtained below with CheckOldVim. | ||||||
| !ifdef WIN64 | !if ${WIN64} | ||||||
|   !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim" |   !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim" | ||||||
| !else | !else | ||||||
|   !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim" |   !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim" | ||||||
| @@ -194,7 +205,7 @@ Page custom SetCustom ValidateCustom | |||||||
| !include "lang\english.nsi" | !include "lang\english.nsi" | ||||||
|  |  | ||||||
| # Include support for other languages: | # Include support for other languages: | ||||||
| !ifdef HAVE_MULTI_LANG | !if ${HAVE_MULTI_LANG} | ||||||
|     !include "lang\danish.nsi" |     !include "lang\danish.nsi" | ||||||
|     !include "lang\dutch.nsi" |     !include "lang\dutch.nsi" | ||||||
|     !include "lang\german.nsi" |     !include "lang\german.nsi" | ||||||
| @@ -598,7 +609,7 @@ SectionGroup $(str_group_plugin) id_group_plugin | |||||||
| SectionGroupEnd | SectionGroupEnd | ||||||
|  |  | ||||||
| ########################################################## | ########################################################## | ||||||
| !ifdef HAVE_NLS | !if ${HAVE_NLS} | ||||||
| Section "$(str_section_nls)" id_section_nls | Section "$(str_section_nls)" id_section_nls | ||||||
| 	SectionIn 1 3 | 	SectionIn 1 3 | ||||||
|  |  | ||||||
| @@ -688,7 +699,7 @@ Section -post | |||||||
| 	  SectionGetSize ${id_section_editwith} $4 | 	  SectionGetSize ${id_section_editwith} $4 | ||||||
| 	  IntOp $3 $3 + $4 | 	  IntOp $3 $3 + $4 | ||||||
| 	${EndIf} | 	${EndIf} | ||||||
| !ifdef HAVE_NLS | !if ${HAVE_NLS} | ||||||
| 	${If} ${SectionIsSelected} ${id_section_nls} | 	${If} ${SectionIsSelected} ${id_section_nls} | ||||||
| 	  SectionGetSize ${id_section_nls} $4 | 	  SectionGetSize ${id_section_nls} $4 | ||||||
| 	  IntOp $3 $3 + $4 | 	  IntOp $3 $3 + $4 | ||||||
| @@ -718,7 +729,7 @@ Section -post | |||||||
| 	!insertmacro SaveSectionSelection ${id_section_vimrc}      "select_vimrc" | 	!insertmacro SaveSectionSelection ${id_section_vimrc}      "select_vimrc" | ||||||
| 	!insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome" | 	!insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome" | ||||||
| 	!insertmacro SaveSectionSelection ${id_section_pluginvim}  "select_pluginvim" | 	!insertmacro SaveSectionSelection ${id_section_pluginvim}  "select_pluginvim" | ||||||
| !ifdef HAVE_NLS | !if ${HAVE_NLS} | ||||||
| 	!insertmacro SaveSectionSelection ${id_section_nls}        "select_nls" | 	!insertmacro SaveSectionSelection ${id_section_nls}        "select_nls" | ||||||
| !endif | !endif | ||||||
| 	${If} ${RunningX64} | 	${If} ${RunningX64} | ||||||
| @@ -751,7 +762,7 @@ SectionEnd | |||||||
| !macroend | !macroend | ||||||
|  |  | ||||||
| Function .onInit | Function .onInit | ||||||
| !ifdef HAVE_MULTI_LANG | !if ${HAVE_MULTI_LANG} | ||||||
|   # Select a language (or read from the registry). |   # Select a language (or read from the registry). | ||||||
|   !insertmacro MUI_LANGDLL_DISPLAY |   !insertmacro MUI_LANGDLL_DISPLAY | ||||||
| !endif | !endif | ||||||
| @@ -789,7 +800,7 @@ Function .onInit | |||||||
|   !insertmacro LoadSectionSelection ${id_section_vimrc}      "select_vimrc" |   !insertmacro LoadSectionSelection ${id_section_vimrc}      "select_vimrc" | ||||||
|   !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome" |   !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome" | ||||||
|   !insertmacro LoadSectionSelection ${id_section_pluginvim}  "select_pluginvim" |   !insertmacro LoadSectionSelection ${id_section_pluginvim}  "select_pluginvim" | ||||||
| !ifdef HAVE_NLS | !if ${HAVE_NLS} | ||||||
|   !insertmacro LoadSectionSelection ${id_section_nls}        "select_nls" |   !insertmacro LoadSectionSelection ${id_section_nls}        "select_nls" | ||||||
| !endif | !endif | ||||||
|   # Load the default _vimrc settings from the registry (if any). |   # Load the default _vimrc settings from the registry (if any). | ||||||
| @@ -963,7 +974,7 @@ FunctionEnd | |||||||
|     !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin}        $(str_desc_plugin) |     !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin}        $(str_desc_plugin) | ||||||
|     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome}  $(str_desc_plugin_home) |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome}  $(str_desc_plugin_home) | ||||||
|     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim}   $(str_desc_plugin_vim) |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim}   $(str_desc_plugin_vim) | ||||||
| !ifdef HAVE_NLS | !if ${HAVE_NLS} | ||||||
|     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls}         $(str_desc_nls) |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls}         $(str_desc_nls) | ||||||
| !endif | !endif | ||||||
| !insertmacro MUI_FUNCTION_DESCRIPTION_END | !insertmacro MUI_FUNCTION_DESCRIPTION_END | ||||||
| @@ -973,7 +984,7 @@ FunctionEnd | |||||||
| # Uninstaller Functions and Sections | # Uninstaller Functions and Sections | ||||||
|  |  | ||||||
| Function un.onInit | Function un.onInit | ||||||
| !ifdef HAVE_MULTI_LANG | !if ${HAVE_MULTI_LANG} | ||||||
|   # Get the language from the registry. |   # Get the language from the registry. | ||||||
|   !insertmacro MUI_UNGETLANGUAGE |   !insertmacro MUI_UNGETLANGUAGE | ||||||
| !endif | !endif | ||||||
|   | |||||||
							
								
								
									
										0
									
								
								tools/rename.bat
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								tools/rename.bat
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
		Reference in New Issue
	
	Block a user