nsis: Fix indentation and alignment issues in gvim.nsi

related: #18440

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
RestorerZ
2025-09-29 19:46:23 +00:00
committed by Christian Brabandt
parent 05e44e978f
commit f9feda2d6d

View File

@ -1,6 +1,7 @@
# 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: 2025 Feb 24 # Last Change: 2025-08-30
#
Unicode true Unicode true
@ -253,8 +254,10 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The Vim Project" VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The Vim Project"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Vi Improved - A Text Editor" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" \
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0" "Vi Improved - A Text Editor"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" \
"${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0" VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
# Global variables # Global variables
@ -269,7 +272,6 @@ Var vim_mouse_stat
Var lng_usr Var lng_usr
!endif !endif
# Reserve files # Reserve files
ReserveFile ${VIMSRC}\installw32.exe ReserveFile ${VIMSRC}\installw32.exe
@ -561,8 +563,7 @@ Section "$(str_section_edit_with)" id_section_editwith
!define LIBRARY_SHELL_EXTENSION !define LIBRARY_SHELL_EXTENSION
!define LIBRARY_X64 !define LIBRARY_X64
!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
"${VIMSRC}\GvimExt\gvimext64.dll" \ "${VIMSRC}\GvimExt\gvimext64.dll" "$0\GvimExt64\gvimext.dll" "$0"
"$0\GvimExt64\gvimext.dll" "$0"
!undef LIBRARY_X64 !undef LIBRARY_X64
!undef LIBRARY_SHELL_EXTENSION !undef LIBRARY_SHELL_EXTENSION
${EndIf} ${EndIf}
@ -572,8 +573,7 @@ Section "$(str_section_edit_with)" id_section_editwith
ClearErrors ClearErrors
!define LIBRARY_SHELL_EXTENSION !define LIBRARY_SHELL_EXTENSION
!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
"${VIMSRC}\GvimExt\gvimext.dll" \ "${VIMSRC}\GvimExt\gvimext.dll" "$0\GvimExt32\gvimext.dll" "$0"
"$0\GvimExt32\gvimext.dll" "$0"
!undef LIBRARY_SHELL_EXTENSION !undef LIBRARY_SHELL_EXTENSION
# We don't have a separate entry for the "Open With..." menu, assume # We don't have a separate entry for the "Open With..." menu, assume
@ -620,21 +620,18 @@ Section "$(str_section_vim_rc)" id_section_vimrc
${Else} ${Else}
StrCpy $1 "$1 -vimrc-behave unix" StrCpy $1 "$1 -vimrc-behave unix"
${EndIf} ${EndIf}
SectionEnd SectionEnd
########################################################## ##########################################################
SectionGroup $(str_group_plugin) id_group_plugin SectionGroup $(str_group_plugin) id_group_plugin
Section "$(str_section_plugin_home)" id_section_pluginhome Section "$(str_section_plugin_home)" id_section_pluginhome
SectionIn 1 3 SectionIn 1 3
# use ShellExecAsUser below instead # use ShellExecAsUser below instead
# StrCpy $1 "$1 -create-directories home" # StrCpy $1 "$1 -create-directories home"
SectionEnd SectionEnd
Section "$(str_section_plugin_vim)" id_section_pluginvim Section "$(str_section_plugin_vim)" id_section_pluginvim
SectionIn 3 SectionIn 3
StrCpy $1 "$1 -create-directories vim" StrCpy $1 "$1 -create-directories vim"
SectionEnd SectionEnd
SectionGroupEnd SectionGroupEnd
@ -665,11 +662,9 @@ Section "$(str_section_nls)" id_section_nls
File /r /x Makefile ${VIMRT}\lang\*.* File /r /x Makefile ${VIMRT}\lang\*.*
SetOutPath $0 SetOutPath $0
!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
"${GETTEXT}\gettext${BIT}\libintl-8.dll" \ "${GETTEXT}\gettext${BIT}\libintl-8.dll" "$0\libintl-8.dll" "$0"
"$0\libintl-8.dll" "$0"
!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
"${GETTEXT}\gettext${BIT}\libiconv-2.dll" \ "${GETTEXT}\gettext${BIT}\libiconv-2.dll" "$0\libiconv-2.dll" "$0"
"$0\libiconv-2.dll" "$0"
!if ${INCLUDE_LIBGCC} !if ${INCLUDE_LIBGCC}
!if /FileExists "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" !if /FileExists "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll"
# Install libgcc_s_sjlj-1.dll only if it is needed. # Install libgcc_s_sjlj-1.dll only if it is needed.
@ -726,7 +721,9 @@ Section -call_install_exe
ReadEnvStr $3 "COMSPEC" ReadEnvStr $3 "COMSPEC"
Call GetHomeDir Call GetHomeDir
Pop $4 Pop $4
ShellExecAsUser::ShellExecAsUser "" "$3" '/c "cd /d "$4" & mkdir vimfiles & cd vimfiles & mkdir colors compiler doc ftdetect ftplugin indent keymap plugin syntax"' SW_HIDE ShellExecAsUser::ShellExecAsUser "" "$3" '/c "cd /d "$4" & mkdir vimfiles \
& cd vimfiles & mkdir colors compiler doc ftdetect ftplugin indent \
keymap plugin syntax"' SW_HIDE
${EndIf} ${EndIf}
SectionEnd SectionEnd
@ -740,7 +737,6 @@ SectionEnd
!macroend !macroend
Section -post Section -post
# Get estimated install size # Get estimated install size
SectionGetSize ${id_section_exe} $3 SectionGetSize ${id_section_exe} $3
${If} ${SectionIsSelected} ${id_section_console} ${If} ${SectionIsSelected} ${id_section_console}
@ -779,7 +775,8 @@ Section -post
!insertmacro SaveSectionSelection ${id_section_startmenu} "select_startmenu" !insertmacro SaveSectionSelection ${id_section_startmenu} "select_startmenu"
!insertmacro SaveSectionSelection ${id_section_editwith} "select_editwith" !insertmacro SaveSectionSelection ${id_section_editwith} "select_editwith"
!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"
!if ${HAVE_NLS} !if ${HAVE_NLS}
!insertmacro SaveSectionSelection ${id_section_nls} "select_nls" !insertmacro SaveSectionSelection ${id_section_nls} "select_nls"
@ -821,7 +818,8 @@ Function .onInit
!if ${HAVE_NLS} !if ${HAVE_NLS}
ClearErrors ClearErrors
System::Call 'kernel32::GetUserDefaultLocaleName(t.r19, *i${NSIS_MAX_STRLEN})' System::Call \
'kernel32::GetUserDefaultLocaleName(t.r19, *i${NSIS_MAX_STRLEN})'
StrCmp $R9 "zh-cn" coincide 0 StrCmp $R9 "zh-cn" coincide 0
StrCmp $R9 "zh-tw" coincide 0 StrCmp $R9 "zh-tw" coincide 0
StrCmp $R9 "pt-br" 0 part StrCmp $R9 "pt-br" 0 part
@ -865,7 +863,8 @@ Function .onInit
!insertmacro LoadSectionSelection ${id_section_startmenu} "select_startmenu" !insertmacro LoadSectionSelection ${id_section_startmenu} "select_startmenu"
!insertmacro LoadSectionSelection ${id_section_editwith} "select_editwith" !insertmacro LoadSectionSelection ${id_section_editwith} "select_editwith"
!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"
!if ${HAVE_NLS} !if ${HAVE_NLS}
!insertmacro LoadSectionSelection ${id_section_nls} "select_nls" !insertmacro LoadSectionSelection ${id_section_nls} "select_nls"
@ -923,7 +922,6 @@ Function SetCustom
GetFunctionAddress $3 ValidateCustom GetFunctionAddress $3 ValidateCustom
nsDialogs::OnBack $3 nsDialogs::OnBack $3
# 1st group - Compatibility # 1st group - Compatibility
${NSD_CreateGroupBox} 0u 0u 296u 44u $(str_msg_compat_title) ${NSD_CreateGroupBox} 0u 0u 296u 44u $(str_msg_compat_title)
Pop $3 Pop $3
@ -948,7 +946,6 @@ Function SetCustom
${EndIf} ${EndIf}
${NSD_CB_SetSelectionIndex} $vim_nsd_compat $4 ${NSD_CB_SetSelectionIndex} $vim_nsd_compat $4
# 2nd group - Key remapping # 2nd group - Key remapping
${NSD_CreateGroupBox} 0u 48u 296u 44u $(str_msg_keymap_title) ${NSD_CreateGroupBox} 0u 48u 296u 44u $(str_msg_keymap_title)
Pop $3 Pop $3
@ -967,7 +964,6 @@ Function SetCustom
${EndIf} ${EndIf}
${NSD_CB_SetSelectionIndex} $vim_nsd_keymap $4 ${NSD_CB_SetSelectionIndex} $vim_nsd_keymap $4
# 3rd group - Mouse behavior # 3rd group - Mouse behavior
${NSD_CreateGroupBox} 0u 95u 296u 44u $(str_msg_mouse_title) ${NSD_CreateGroupBox} 0u 95u 296u 44u $(str_msg_mouse_title)
Pop $3 Pop $3
@ -1035,12 +1031,16 @@ FunctionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_batch} $(str_desc_batch) !insertmacro MUI_DESCRIPTION_TEXT ${id_section_batch} $(str_desc_batch)
!insertmacro MUI_DESCRIPTION_TEXT ${id_group_icons} $(str_desc_icons) !insertmacro MUI_DESCRIPTION_TEXT ${id_group_icons} $(str_desc_icons)
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_desktop} $(str_desc_desktop) !insertmacro MUI_DESCRIPTION_TEXT ${id_section_desktop} $(str_desc_desktop)
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_startmenu} $(str_desc_start_menu) !insertmacro MUI_DESCRIPTION_TEXT ${id_section_startmenu} \
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_editwith} $(str_desc_edit_with) $(str_desc_start_menu)
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_editwith} \
$(str_desc_edit_with)
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_vimrc} $(str_desc_vim_rc) !insertmacro MUI_DESCRIPTION_TEXT ${id_section_vimrc} $(str_desc_vim_rc)
!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} \
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim} $(str_desc_plugin_vim) $(str_desc_plugin_home)
!insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim} \
$(str_desc_plugin_vim)
!if ${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
@ -1077,7 +1077,6 @@ Section "un.$(str_unsection_register)" id_unsection_register
SectionEnd SectionEnd
Section "un.$(str_unsection_exe)" id_unsection_exe Section "un.$(str_unsection_exe)" id_unsection_exe
StrCpy $0 "$INSTDIR" StrCpy $0 "$INSTDIR"
# Delete gettext and iconv DLLs # Delete gettext and iconv DLLs
@ -1233,10 +1232,16 @@ SectionEnd
# Description for Uninstaller Sections # Description for Uninstaller Sections
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_register} $(str_desc_unregister) !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_register} \
$(str_desc_unregister)
!insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_exe} $(str_desc_rm_exe) !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_exe} $(str_desc_rm_exe)
!insertmacro MUI_DESCRIPTION_TEXT ${id_ungroup_plugin} $(str_desc_rm_plugin) !insertmacro MUI_DESCRIPTION_TEXT ${id_ungroup_plugin} $(str_desc_rm_plugin)
!insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_home} $(str_desc_rm_plugin_home) !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_home} \
!insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_vim} $(str_desc_rm_plugin_vim) $(str_desc_rm_plugin_home)
!insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_rootdir} $(str_desc_rm_rootdir) !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_vim} \
$(str_desc_rm_plugin_vim)
!insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_rootdir} \
$(str_desc_rm_rootdir)
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
# vi:set ts=8 sw=2 sts=2 tw=79 wm=0 ft=nsis: