]> granicus.if.org Git - vim/commitdiff
patch 8.2.2822: MS-Windows: unnessarily loading libraries when unregistering v8.2.2822
authorBram Moolenaar <Bram@vim.org>
Sat, 1 May 2021 20:41:39 +0000 (22:41 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 1 May 2021 20:41:39 +0000 (22:41 +0200)
Problem:    MS-Windows: unnessarily loading libraries when unregistering OLE.
Solution:   Also skip loading libraries when invoked with "-unregister".  Run
            Vim for README.txt with user privileges.

nsis/README.txt
nsis/gvim.nsi
src/main.c
src/version.c

index c0a184d6a3665afe1896ae8079a712a57f397455..0d01ec86dbf57f3301dd4fa67cc6740482626043 100644 (file)
@@ -66,6 +66,9 @@ To build the installable .exe:
 
 Install NSIS if you didn't do that already.
 Also install UPX, if you want a compressed file.
+Download and include the ShellExecAsUser.dll Unicode version which can be
+sourced from: https://nsis.sourceforge.io/ShellExecAsUser_plug-in
+
 
 Unpack the images:
        cd nsis
index 498d98dc8485fb34860ce80791c80b8ccefb0040..58ed85c5ebbe6f11b823d53ffa563893dc52465f 100644 (file)
@@ -119,9 +119,9 @@ RequestExecutionLevel highest
 
 !define MUI_COMPONENTSPAGE_SMALLDESC
 !define MUI_LICENSEPAGE_CHECKBOX
-!define MUI_FINISHPAGE_RUN                 "$0\gvim.exe"
+!define MUI_FINISHPAGE_RUN
+!define MUI_FINISHPAGE_RUN_FUNCTION        LaunchApplication
 !define MUI_FINISHPAGE_RUN_TEXT            $(str_show_readme)
-!define MUI_FINISHPAGE_RUN_PARAMETERS      "-R $\"$0\README.txt$\""
 
 # This adds '\Vim' to the user choice automagically.  The actual value is
 # obtained below with CheckOldVim.
@@ -300,6 +300,11 @@ Function CheckOldVim
   Exch $0  # put $0 on top of stack, restore $0 to original value
 FunctionEnd
 
+Function LaunchApplication
+   SetOutPath $0
+   ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" "-R $"$0\README.txt$""
+FunctionEnd
+
 ##########################################################
 Section "$(str_section_old_ver)" id_section_old_ver
        SectionIn 1 2 3 RO
index 686fb143247ec546751a8a8d2a11af1be248a57f..277e31790bec2bc79a5ebfffba8a4f6276c12b93 100644 (file)
@@ -162,10 +162,11 @@ main
        }
 #endif
 #ifdef MSWIN
-    // Need to find "-register" before loading any libraries.
+    // Need to find "-register" and "-unregister" before loading any libraries.
     for (i = 1; i < argc; ++i)
-       if (STRICMP(argv[i] + 1, "register") == 0
-                                  && (argv[i][0] == '-' || argv[i][0] == '/'))
+       if ((STRICMP(argv[i] + 1, "register") == 0
+                                   || STRICMP(argv[i] + 1, "unregister") == 0)
+               && (argv[i][0] == '-' || argv[i][0] == '/'))
        {
            found_register_arg = TRUE;
            break;
index 8140e20fa78511b701752149f81f021e3d5959f8..acf0e739384c2a0479b71e1f9d040e9aee174190 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2822,
 /**/
     2821,
 /**/