summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-31 22:03:44 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-31 22:03:44 +0200
commit760d14a55cb2b60bd048246690d17348b4cd0fdf (patch)
tree4c2b8516ccc5631e3ce9ff578269683c4cfbcded /src
parent7805004319691ee026342525e0bf9df146358dc0 (diff)
Fix that uninstaller isn't found on 64-bit Windows.
Diffstat (limited to 'src')
-rw-r--r--src/dosinst.c16
-rw-r--r--src/dosinst.h8
-rw-r--r--src/if_ole.cpp15
-rw-r--r--src/uninstal.c11
4 files changed, 22 insertions, 28 deletions
diff --git a/src/dosinst.c b/src/dosinst.c
index 6dcb5e30db..979d6fe879 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -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,
diff --git a/src/dosinst.h b/src/dosinst.h
index 86e65e9a9d..b33426ad78 100644
--- a/src/dosinst.h
+++ b/src/dosinst.h
@@ -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 */
diff --git a/src/if_ole.cpp b/src/if_ole.cpp
index 1f73705b10..53c12de27f 100644
--- a/src/if_ole.cpp
+++ b/src/if_ole.cpp
@@ -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;
diff --git a/src/uninstal.c b/src/uninstal.c
index b18a3266c1..4b4b6f26f1 100644
--- a/src/uninstal.c
+++ b/src/uninstal.c
@@ -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
{