comparison src/if_ole.cpp @ 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 499bff609a86
children 7e9da593951d
comparison
equal deleted inserted replaced
2448:628147a4b3b2 2449:943280505f72
48 #ifdef __MINGW32__ 48 #ifdef __MINGW32__
49 WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID, WORD wVerMajor, 49 WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID, WORD wVerMajor,
50 WORD wVerMinor, LCID lcid, SYSKIND syskind); 50 WORD wVerMinor, LCID lcid, SYSKIND syskind);
51 #endif 51 #endif
52 52
53 /*
54 * Modern way of creating registry entries, also works on 64 bit windows when
55 * compiled as a 32 bit program.
56 */
57 # ifndef KEY_WOW64_64KEY
58 # define KEY_WOW64_64KEY 0x0100
59 # endif
60
61 /***************************************************************************** 53 /*****************************************************************************
62 1. Internal definitions for this file 54 1. Internal definitions for this file
63 *****************************************************************************/ 55 *****************************************************************************/
64 56
65 class CVim; 57 class CVim;
164 156
165 // Check we can write to the registry. 157 // Check we can write to the registry.
166 // RegCreateKeyEx succeeds even if key exists. W.Briscoe W2K 20021011 158 // RegCreateKeyEx succeeds even if key exists. W.Briscoe W2K 20021011
167 if (RegCreateKeyEx(HKEY_CLASSES_ROOT, MYVIPROGID, 0, NULL, 159 if (RegCreateKeyEx(HKEY_CLASSES_ROOT, MYVIPROGID, 0, NULL,
168 REG_OPTION_NON_VOLATILE, 160 REG_OPTION_NON_VOLATILE,
169 KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL, &hKey, NULL)) 161 KEY_ALL_ACCESS, NULL, &hKey, NULL))
170 { 162 {
171 delete me; 163 delete me;
172 return NULL; // Unable to write to registry. Quietly fail. 164 return NULL; // Unable to write to registry. Quietly fail.
173 } 165 }
174 RegCloseKey(hKey); 166 RegCloseKey(hKey);
656 // Delete a key and all of its descendents 648 // Delete a key and all of its descendents
657 static void RecursiveDeleteKey(HKEY hKeyParent, const char *child) 649 static void RecursiveDeleteKey(HKEY hKeyParent, const char *child)
658 { 650 {
659 // Open the child 651 // Open the child
660 HKEY hKeyChild; 652 HKEY hKeyChild;
661 LONG result = RegOpenKeyEx(hKeyParent, child, 0, KEY_ALL_ACCESS, &hKeyChild); 653 LONG result = RegOpenKeyEx(hKeyParent, child, 0,
654 KEY_ALL_ACCESS, &hKeyChild);
662 if (result != ERROR_SUCCESS) 655 if (result != ERROR_SUCCESS)
663 return; 656 return;
664 657
665 // Enumerate all of the decendents of this child 658 // Enumerate all of the decendents of this child
666 FILETIME time; 659 FILETIME time;
699 692
700 // Create and open key and subkey. 693 // Create and open key and subkey.
701 long result = RegCreateKeyEx(HKEY_CLASSES_ROOT, 694 long result = RegCreateKeyEx(HKEY_CLASSES_ROOT,
702 buffer, 695 buffer,
703 0, NULL, REG_OPTION_NON_VOLATILE, 696 0, NULL, REG_OPTION_NON_VOLATILE,
704 KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL, 697 KEY_ALL_ACCESS, NULL,
705 &hKey, NULL); 698 &hKey, NULL);
706 if (result != ERROR_SUCCESS) 699 if (result != ERROR_SUCCESS)
707 return; 700 return;
708 701
709 // Set the value 702 // Set the value