Mercurial > vim
comparison src/dosinst.c @ 2449:943280505f72 vim73
Fix that uninstaller isn't found on 64-bit Windows.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 31 Jul 2010 22:03:44 +0200 |
parents | 628147a4b3b2 |
children | 481f808ab5e1 |
comparison
equal
deleted
inserted
replaced
2448:628147a4b3b2 | 2449:943280505f72 |
---|---|
460 DWORD value_type; | 460 DWORD value_type; |
461 DWORD orig_num_keys; | 461 DWORD orig_num_keys; |
462 DWORD new_num_keys; | 462 DWORD new_num_keys; |
463 int foundone = 0; | 463 int foundone = 0; |
464 | 464 |
465 code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, uninstall_key, 0, KEY_READ, | 465 code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, uninstall_key, 0, |
466 &key_handle); | 466 KEY_WOW64_64KEY | KEY_READ, &key_handle); |
467 CHECK_REG_ERROR(code); | 467 CHECK_REG_ERROR(code); |
468 | 468 |
469 for (key_index = 0; | 469 for (key_index = 0; |
470 RegEnumKeyEx(key_handle, key_index, subkey_name_buff, &local_bufsize, | 470 RegEnumKeyEx(key_handle, key_index, subkey_name_buff, &local_bufsize, |
471 NULL, NULL, NULL, &temp_pfiletime) != ERROR_NO_MORE_ITEMS; | 471 NULL, NULL, NULL, &temp_pfiletime) != ERROR_NO_MORE_ITEMS; |
473 { | 473 { |
474 local_bufsize = BUFSIZE; | 474 local_bufsize = BUFSIZE; |
475 if (strncmp("Vim", subkey_name_buff, 3) == 0) | 475 if (strncmp("Vim", subkey_name_buff, 3) == 0) |
476 { | 476 { |
477 /* Open the key named Vim* */ | 477 /* Open the key named Vim* */ |
478 code = RegOpenKeyEx(key_handle, subkey_name_buff, 0, KEY_READ, | 478 code = RegOpenKeyEx(key_handle, subkey_name_buff, 0, |
479 &uninstall_key_handle); | 479 KEY_WOW64_64KEY | KEY_READ, &uninstall_key_handle); |
480 CHECK_REG_ERROR(code); | 480 CHECK_REG_ERROR(code); |
481 | 481 |
482 /* get the DisplayName out of it to show the user */ | 482 /* get the DisplayName out of it to show the user */ |
483 code = RegQueryValueEx(uninstall_key_handle, "displayname", 0, | 483 code = RegQueryValueEx(uninstall_key_handle, "displayname", 0, |
484 &value_type, (LPBYTE)temp_string_buffer, | 484 &value_type, (LPBYTE)temp_string_buffer, |
1350 choices[choice_count].active = (*oldvimrc == NUL); | 1350 choices[choice_count].active = (*oldvimrc == NUL); |
1351 ++choice_count; | 1351 ++choice_count; |
1352 } | 1352 } |
1353 | 1353 |
1354 #if defined(WIN3264) | 1354 #if defined(WIN3264) |
1355 /* | |
1356 * Modern way of creating registry entries, also works on 64 bit windows when | |
1357 * compiled as a 32 bit program. | |
1358 */ | |
1359 # ifndef KEY_WOW64_64KEY | |
1360 # define KEY_WOW64_64KEY 0x0100 | |
1361 # endif | |
1362 | |
1363 static LONG | 1355 static LONG |
1364 reg_create_key( | 1356 reg_create_key( |
1365 HKEY root, | 1357 HKEY root, |
1366 const char *subkey, | 1358 const char *subkey, |
1367 PHKEY phKey) | 1359 PHKEY phKey) |