nsis: Reorder code blocks

Commit: 
https://github.com/vim/vim/commit/bd6d5c8f0df324b5e1241abb1b3d2be7e6d6f4fb
Author: RestorerZ <[email protected]>
Date:   Mon Sep 29 19:50:45 2025 +0000

    nsis: Reorder code blocks
    
    related: https://github.com/vim/vim/issues/18440
    
    Signed-off-by: RestorerZ <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi
index fe85798c2..6ef6a8209 100644
--- a/nsis/gvim.nsi
+++ b/nsis/gvim.nsi
@@ -1,6 +1,6 @@
 # NSIS file to create a self-installing exe for Vim.
 # It requires NSIS version 3.0 or later.
-# Last Change: 2025-09-03
+# Last Change: 2025-09-04
 #
 
 Unicode true
@@ -81,14 +81,21 @@ Unicode true
 
 # ----------- No configurable settings below this line -----------
 
-!include "Library.nsh"         # for DLL install
-!include "LogicLib.nsh"
-!include "MUI2.nsh"
-!include "nsDialogs.nsh"
-!include "Sections.nsh"
-!include "x64.nsh"
+##########################################################
+# Installer Attributes, Including headers, Plugins and etc. 
 
-!include . uxiliary.nsh        # helper file
+CRCCheck force
+
+SetCompressor /SOLID lzma
+SetCompressorDictSize 64
+SetDatablockOptimize on
+
+!if ${HAVE_UPX}
+  !packhdr temp.dat "upx --best --compress-icons=1 temp.dat"
+!endif
+
+RequestExecutionLevel highest
+ManifestDPIAware true
 
 !define PRODUCT                "Vim ${VER_MAJOR}.${VER_MINOR}"
 !define UNINST_REG_KEY  "Software\Microsoft\Windows\CurrentVersion\Uninstall"
@@ -103,17 +110,49 @@ Unicode true
 !else
   Name "${PRODUCT}"
 !endif
+
 OutFile gvim${VER_MAJOR}${VER_MINOR}.exe
-CRCCheck force
-SetCompressor /SOLID lzma
-SetCompressorDictSize 64
-ManifestDPIAware true
-SetDatablockOptimize on
-RequestExecutionLevel highest
 
-!if ${HAVE_UPX}
-  !packhdr temp.dat "upx --best --compress-icons=1 temp.dat"
+# This adds '\Vim' to the user choice automagically.  The actual value is
+# obtained below with CheckOldVim.
+!if ${WIN64}
+  !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
+!else
+  !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
 !endif
+InstallDir ${DEFAULT_INSTDIR}
+
+# Types of installs we can perform:
+InstType $(str_type_typical)
+InstType $(str_type_minimal)
+InstType $(str_type_full)
+
+SilentInstall normal
+
+##########################################################
+# Version resources
+
+VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The Vim Project"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" \
+    "Vi Improved - A Text Editor"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" \
+    "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
+
+##########################################################
+# including headers
+
+!include "Library.nsh"         # for DLL install
+!include "LogicLib.nsh"
+!include "MUI2.nsh"
+!include "nsDialogs.nsh"
+!include "Sections.nsh"
+!include "x64.nsh"
+
+!include . uxiliary.nsh        # helper file
 
 !if ${WIN64}
   !define BIT 64
@@ -155,22 +194,6 @@ RequestExecutionLevel highest
 !define MUI_FINISHPAGE_SHOWREADME_TEXT         $(str_show_readme)
 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION     LaunchApplication
 
-# This adds '\Vim' to the user choice automagically.  The actual value is
-# obtained below with CheckOldVim.
-!if ${WIN64}
-  !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
-!else
-  !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
-!endif
-InstallDir ${DEFAULT_INSTDIR}
-
-# Types of installs we can perform:
-InstType $(str_type_typical)
-InstType $(str_type_minimal)
-InstType $(str_type_full)
-
-SilentInstall normal
-
 # General custom functions for MUI2:
 #!define MUI_CUSTOMFUNCTION_ABORT   VimOnUserAbort
 #!define MUI_CUSTOMFUNCTION_UNABORT un.VimOnUserAbort
@@ -217,18 +240,6 @@ Page custom SetCustom ValidateCustom
 !endif
 
 ##########################################################
-# Version resources
-
-VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The Vim Project"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" \
-    "Vi Improved - A Text Editor"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" \
-    "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
-VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
-
 # Global variables
 Var vim_dialog
 Var vim_nsd_compat
@@ -238,6 +249,7 @@ Var vim_compat_stat
 Var vim_keymap_stat
 Var vim_mouse_stat
 
+##########################################################
 # Reserve files
 ReserveFile ${VIMSRC}\installw32.exe
 
@@ -317,6 +329,8 @@ Function LaunchApplication
 FunctionEnd
 
 ##########################################################
+# Installer Functions and Sections
+
 Section "$(str_section_old_ver)" id_section_old_ver
   SectionIn 1 2 3 RO
 

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1v3K2X-001nEc-AO%40256bit.org.

Raspunde prin e-mail lui