]> granicus.if.org Git - vim/commitdiff
Fix that uninstaller isn't found on 64-bit Windows.
authorBram Moolenaar <Bram@vim.org>
Sat, 31 Jul 2010 20:03:44 +0000 (22:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 31 Jul 2010 20:03:44 +0000 (22:03 +0200)
nsis/gvim.nsi
runtime/doc/todo.txt
src/dosinst.c
src/dosinst.h
src/if_ole.cpp
src/uninstal.c

index f398f5e240154f55b0a1bad6fee2feb80adb4682..fd2fc1e40b6c4b28fe394eeb9e3b75a27e8c174c 100644 (file)
@@ -450,7 +450,7 @@ Section Uninstall
          AskRemove:
            MessageBox MB_YESNO|MB_ICONQUESTION \
              "Remove all files in your $1\vimfiles directory? \
-             $\nIf you have created something there that you want to keep, click No" IDNO Fin
+             $\nCAREFUL: If you have created something there that you want to keep, click No" IDNO Fin
            RMDir /r $1\vimfiles
          NoRemove:
 
index 6b0c5a72359addbf83a4e24e2866bda8f956a4be..306aad0532722b3446d12740ca56691b0e1b7d17 100644 (file)
@@ -30,10 +30,6 @@ be worked on, but only if you sponsor Vim development.  See |sponsor|.
                                                        *known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Windows 7: installing Vim again doesn't find the previously installed Vim.
-
-Move more common code from if_python.c and if_python3.c to if_py_both.h
-
 Before release 7.3:
 - Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23)
 
index 6dcb5e30dba143c3d996011098f1af9d938ad6ed..979d6fe8795e7ce5557256874122ce8fad687153 100644 (file)
@@ -462,8 +462,8 @@ uninstall_check(int skip_question)
     DWORD      new_num_keys;
     int                foundone = 0;
 
-    code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, uninstall_key, 0, KEY_READ,
-                                                                &key_handle);
+    code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, uninstall_key, 0,
+                                    KEY_WOW64_64KEY | KEY_READ, &key_handle);
     CHECK_REG_ERROR(code);
 
     for (key_index = 0;
@@ -475,8 +475,8 @@ uninstall_check(int skip_question)
        if (strncmp("Vim", subkey_name_buff, 3) == 0)
        {
            /* Open the key named Vim* */
-           code = RegOpenKeyEx(key_handle, subkey_name_buff, 0, KEY_READ,
-                   &uninstall_key_handle);
+           code = RegOpenKeyEx(key_handle, subkey_name_buff, 0,
+                          KEY_WOW64_64KEY | KEY_READ, &uninstall_key_handle);
            CHECK_REG_ERROR(code);
 
            /* get the DisplayName out of it to show the user */
@@ -1352,14 +1352,6 @@ init_vimrc_choices(void)
 }
 
 #if defined(WIN3264)
-/*
- * Modern way of creating registry entries, also works on 64 bit windows when
- * compiled as a 32 bit program.
- */
-# ifndef KEY_WOW64_64KEY
-#  define KEY_WOW64_64KEY 0x0100
-# endif
-
     static LONG
 reg_create_key(
     HKEY root,
index 86e65e9a9d68f28538dafc0b104035ba4cbee376..b33426ad78d7058a13755db070cba8ebed433948 100644 (file)
@@ -83,6 +83,14 @@ char *searchpath(char *name);
 # define TRUE 1
 #endif
 
+/*
+ * Modern way of creating registry entries, also works on 64 bit windows when
+ * compiled as a 32 bit program.
+ */
+# ifndef KEY_WOW64_64KEY
+#  define KEY_WOW64_64KEY 0x0100
+# endif
+
 #define VIM_STARTMENU "Programs\\Vim " VIM_VERSION_SHORT
 
 int    interactive;            /* non-zero when running interactively */
index 1f73705b10f8d9759d12d32dc18fa889d4d7c4fa..53c12de27f46486605ffd4fc0e75153df4668f3a 100644 (file)
@@ -50,14 +50,6 @@ WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID, WORD wVerMajor,
            WORD wVerMinor, LCID lcid, SYSKIND syskind);
 #endif
 
-/*
- * Modern way of creating registry entries, also works on 64 bit windows when
- * compiled as a 32 bit program.
- */
-# ifndef KEY_WOW64_64KEY
-#  define KEY_WOW64_64KEY 0x0100
-# endif
-
 /*****************************************************************************
  1. Internal definitions for this file
 *****************************************************************************/
@@ -166,7 +158,7 @@ CVim *CVim::Create(int *pbDoRestart)
        // RegCreateKeyEx succeeds even if key exists. W.Briscoe W2K 20021011
        if (RegCreateKeyEx(HKEY_CLASSES_ROOT, MYVIPROGID, 0, NULL,
                  REG_OPTION_NON_VOLATILE,
-                 KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL, &hKey, NULL))
+                 KEY_ALL_ACCESS, NULL, &hKey, NULL))
        {
            delete me;
            return NULL; // Unable to write to registry. Quietly fail.
@@ -658,7 +650,8 @@ static void RecursiveDeleteKey(HKEY hKeyParent, const char *child)
 {
     // Open the child
     HKEY hKeyChild;
-    LONG result = RegOpenKeyEx(hKeyParent, child, 0, KEY_ALL_ACCESS, &hKeyChild);
+    LONG result = RegOpenKeyEx(hKeyParent, child, 0,
+                                                 KEY_ALL_ACCESS, &hKeyChild);
     if (result != ERROR_SUCCESS)
        return;
 
@@ -701,7 +694,7 @@ static void SetKeyAndValue(const char *key, const char *subkey, const char *valu
     long result = RegCreateKeyEx(HKEY_CLASSES_ROOT,
                                 buffer,
                                 0, NULL, REG_OPTION_NON_VOLATILE,
-                                KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL,
+                                KEY_ALL_ACCESS, NULL,
                                 &hKey, NULL);
     if (result != ERROR_SUCCESS)
        return;
index b18a3266c14c310de89889238bd452c0f1cea983..4b4b6f26f1d033d6f0d6b9ea5ef7d09dfc286db8 100644 (file)
@@ -46,8 +46,8 @@ popup_gvim_path(char *buf)
     int                r;
 
     /* Open the key where the path to gvim.exe is stored. */
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0, KEY_READ,
-                                               &key_handle) != ERROR_SUCCESS)
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
+                   KEY_WOW64_64KEY | KEY_READ, &key_handle) != ERROR_SUCCESS)
        return 0;
 
     /* get the DisplayName out of it to show the user */
@@ -72,8 +72,8 @@ openwith_gvim_path(char *buf)
 
     /* Open the key where the path to gvim.exe is stored. */
     if (RegOpenKeyEx(HKEY_CLASSES_ROOT,
-               "Applications\\gvim.exe\\shell\\edit\\command", 0, KEY_READ,
-                                               &key_handle) != ERROR_SUCCESS)
+               "Applications\\gvim.exe\\shell\\edit\\command", 0,
+                   KEY_WOW64_64KEY | KEY_READ, &key_handle) != ERROR_SUCCESS)
        return 0;
 
     /* get the DisplayName out of it to show the user */
@@ -95,7 +95,8 @@ remove_popup(void)
        ++fail;
     if (RegDeleteKey(HKEY_CLASSES_ROOT, "*\\shellex\\ContextMenuHandlers\\gvim") != ERROR_SUCCESS)
        ++fail;
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", 0, KEY_ALL_ACCESS, &kh) != ERROR_SUCCESS)
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", 0,
+                     KEY_WOW64_64KEY | KEY_ALL_ACCESS, &kh) != ERROR_SUCCESS)
        ++fail;
     else
     {