--- programs/uninstaller/main.c.old	2007-04-16 16:39:10.000000000 -0500
+++ programs/uninstaller/main.c	2007-04-16 16:36:56.000000000 -0500
@@ -227,6 +227,34 @@
         RegCloseKey(hkeyApp);
         sizeOfSubKeyName = 255;
     }
+
+    if (RegOpenKeyExW(HKEY_CURRENT_USER, PathUninstallW, 0, KEY_READ, &hkeyUninst) != ERROR_SUCCESS)
+	return 0;
+
+    for (i=0; RegEnumKeyExW( hkeyUninst, i, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, NULL ) != ERROR_NO_MORE_ITEMS; ++i)
+    {
+        lstrcpyW(p, subKeyName);
+        RegOpenKeyExW(HKEY_CURRENT_USER, key_app, 0, KEY_READ, &hkeyApp);
+        if ((RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, NULL, &displen) == ERROR_SUCCESS)
+         && (RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, NULL, &uninstlen) == ERROR_SUCCESS))
+        {
+            numentries++;
+            entries = HeapReAlloc(GetProcessHeap(), 0, entries, numentries*sizeof(uninst_entry));
+            entries[numentries-1].key = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(subKeyName)+1)*sizeof(WCHAR));
+            lstrcpyW(entries[numentries-1].key, subKeyName);
+            entries[numentries-1].descr = HeapAlloc(GetProcessHeap(), 0, displen);
+            RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, (LPBYTE)entries[numentries-1].descr, &displen);
+            entries[numentries-1].command = HeapAlloc(GetProcessHeap(), 0, uninstlen);
+            entries[numentries-1].active = 0;
+            RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)entries[numentries-1].command, &uninstlen);
+            WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
+            numentries, wine_dbgstr_w(entries[numentries-1].key), wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
+            if(sFilter != NULL && StrStrIW(entries[numentries-1].descr,sFilter)==NULL)
+                numentries--;
+        }
+        RegCloseKey(hkeyApp);
+        sizeOfSubKeyName = 255;
+    }
     qsort(entries, numentries, sizeof(uninst_entry), cmp_by_name);
     RegCloseKey(hkeyUninst);
     return 1;
--- programs/uninstaller/main.c.old	2007-04-13 10:47:52.000000000 -0500
+++ programs/uninstaller/main.c	2007-04-18 11:51:14.000000000 -0500
@@ -49,7 +49,7 @@
 static WCHAR sUninstallFailed[MAX_STRING_LEN];
 
 static int FetchUninstallInformation(void);
-static void UninstallProgram(void);
+static void UninstallProgram(HKEY rootkey);
 static void UpdateList(HWND hList);
 static int cmp_by_name(const void *a, const void *b);
 static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
@@ -69,7 +69,7 @@
 /**
  * Used to output program list when used with --list
  */
-static void ListUninstallPrograms(void)
+static void ListUninstallPrograms()
 {
     unsigned int i;
     int lenDescr, lenKey;
@@ -93,9 +93,9 @@
 }
 
 
-static void RemoveSpecificProgram(WCHAR *nameW)
+static void RemoveSpecificProgram(WCHAR *nameW, HKEY rootkey)
 {
-    unsigned int i;
+    unsigned int i, x;
     int lenName;
     char *name;
 
@@ -111,7 +111,8 @@
     }
 
     if (i < numentries)
-        UninstallProgram();
+        for (x=0; x<2; x++)
+            UninstallProgram(rootkey);
     else
     {
         lenName = WideCharToMultiByte(CP_UNIXCP, 0, nameW, -1, NULL, 0, NULL, NULL); 
@@ -129,33 +130,38 @@
     HINSTANCE hInst = GetModuleHandleW(0);
     static const WCHAR listW[] = { '-','-','l','i','s','t',0 };
     static const WCHAR removeW[] = { '-','-','r','e','m','o','v','e',0 };
-    int i = 1;
+    int i = 1, x;
+    HKEY keys[2];
+    keys[0] = HKEY_CURRENT_USER;
+    keys[1] = HKEY_LOCAL_MACHINE;
 
     while( i<argc )
     {
         token = argv[i++];
         
-        /* Handle requests just to list the applications */
-        if( !lstrcmpW( token, listW ) )
-        {
-            ListUninstallPrograms();
-            return 0;
-        }
-        else if( !lstrcmpW( token, removeW ) )
+	for (x=0; x<2; x++)
         {
-            if( i >= argc )
+            /* Handle requests just to list the applications */
+            if( !lstrcmpW( token, listW ) )
             {
-                WINE_ERR( "The remove option requires a parameter.\n");
+                ListUninstallPrograms();
+                return 0;
+            }
+            else if( !lstrcmpW( token, removeW ) )
+            {
+                if( i >= argc )
+                {
+                    WINE_ERR( "The remove option requires a parameter.\n");
+                    return 1;
+                }
+                RemoveSpecificProgram( argv[i++], keys[x] );
+                return 0;
+            }
+            else 
+            {
+                WINE_ERR( "unknown option %s\n",wine_dbgstr_w(token));
                 return 1;
             }
-
-            RemoveSpecificProgram( argv[i++] );
-            return 0;
-        }
-        else 
-        {
-            WINE_ERR( "unknown option %s\n",wine_dbgstr_w(token));
-            return 1;
         }
     }
 
@@ -178,55 +184,59 @@
     return lstrcmpiW(((const uninst_entry *)a)->descr, ((const uninst_entry *)b)->descr);
 }
 
-
 /**
  * Fetch information from the uninstall key.
  */
 static int FetchUninstallInformation(void)
 {
-    HKEY hkeyUninst, hkeyApp;
-    int i;
+    HKEY hkeyUninst, hkeyApp, rootkey[2];
+    int i, x;
     DWORD sizeOfSubKeyName, displen, uninstlen;
     WCHAR subKeyName[256];
     WCHAR key_app[1024];
     WCHAR *p;
-  
+    rootkey[0] = HKEY_CURRENT_USER;
+    rootkey[1] = HKEY_LOCAL_MACHINE;
     numentries = 0;
     oldsel = -1;
-    if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, PathUninstallW, 0, KEY_READ, &hkeyUninst) != ERROR_SUCCESS)
-        return 0;
 
-    if (!entries)
-        entries = HeapAlloc(GetProcessHeap(), 0, sizeof(uninst_entry));
+    for (x=0; x<2; x++)
+    {
+        if (RegOpenKeyExW(rootkey[x], PathUninstallW, 0, KEY_READ, &hkeyUninst) != ERROR_SUCCESS)
+            continue;
 
-    lstrcpyW(key_app, PathUninstallW);
-    lstrcatW(key_app, BackSlashW);
-    p = key_app+lstrlenW(PathUninstallW)+1;
+        if (!entries)
+            entries = HeapAlloc(GetProcessHeap(), 0, sizeof(uninst_entry));
 
-    sizeOfSubKeyName = 255;
-    for (i=0; RegEnumKeyExW( hkeyUninst, i, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, NULL ) != ERROR_NO_MORE_ITEMS; ++i)
-    {
-        lstrcpyW(p, subKeyName);
-        RegOpenKeyExW(HKEY_LOCAL_MACHINE, key_app, 0, KEY_READ, &hkeyApp);
-        if ((RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, NULL, &displen) == ERROR_SUCCESS)
-         && (RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, NULL, &uninstlen) == ERROR_SUCCESS))
+        lstrcpyW(key_app, PathUninstallW);
+        lstrcatW(key_app, BackSlashW);
+        p = key_app+lstrlenW(PathUninstallW)+1;
+
+        sizeOfSubKeyName = 255;
+        for (i=0; RegEnumKeyExW( hkeyUninst, i, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, NULL ) != ERROR_NO_MORE_ITEMS; ++i)
         {
-            numentries++;
-            entries = HeapReAlloc(GetProcessHeap(), 0, entries, numentries*sizeof(uninst_entry));
-            entries[numentries-1].key = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(subKeyName)+1)*sizeof(WCHAR));
-            lstrcpyW(entries[numentries-1].key, subKeyName);
-            entries[numentries-1].descr = HeapAlloc(GetProcessHeap(), 0, displen);
-            RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, (LPBYTE)entries[numentries-1].descr, &displen);
-            entries[numentries-1].command = HeapAlloc(GetProcessHeap(), 0, uninstlen);
-            entries[numentries-1].active = 0;
-            RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)entries[numentries-1].command, &uninstlen);
-            WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
-            numentries, wine_dbgstr_w(entries[numentries-1].key), wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
-            if(sFilter != NULL && StrStrIW(entries[numentries-1].descr,sFilter)==NULL)
-                numentries--;
+            lstrcpyW(p, subKeyName);
+            RegOpenKeyExW(rootkey[x], key_app, 0, KEY_READ, &hkeyApp);
+            if ((RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, NULL, &displen) == ERROR_SUCCESS)
+             && (RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, NULL, &uninstlen) == ERROR_SUCCESS))
+            {
+                numentries++;
+                entries = HeapReAlloc(GetProcessHeap(), 0, entries, numentries*sizeof(uninst_entry));
+                entries[numentries-1].key = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(subKeyName)+1)*sizeof(WCHAR));
+                lstrcpyW(entries[numentries-1].key, subKeyName);
+                entries[numentries-1].descr = HeapAlloc(GetProcessHeap(), 0, displen);
+                RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, (LPBYTE)entries[numentries-1].descr, &displen);
+                entries[numentries-1].command = HeapAlloc(GetProcessHeap(), 0, uninstlen);
+                entries[numentries-1].active = 0;
+                RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)entries[numentries-1].command, &uninstlen);
+                WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
+                numentries, wine_dbgstr_w(entries[numentries-1].key), wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
+                if(sFilter != NULL && StrStrIW(entries[numentries-1].descr,sFilter)==NULL)
+                    numentries--;
+            }
+            RegCloseKey(hkeyApp);
+            sizeOfSubKeyName = 255;
         }
-        RegCloseKey(hkeyApp);
-        sizeOfSubKeyName = 255;
     }
     qsort(entries, numentries, sizeof(uninst_entry), cmp_by_name);
     RegCloseKey(hkeyUninst);
@@ -234,7 +244,7 @@
 }
 
 
-static void UninstallProgram(void)
+static void UninstallProgram(HKEY rootkey)
 {
     unsigned int i;
     WCHAR errormsg[1024];
@@ -242,7 +252,7 @@
     STARTUPINFOW si;
     PROCESS_INFORMATION info;
     DWORD exit_code;
-    HKEY hkey;
+    HKEY hkeyUninst;
     for (i=0; i < numentries; i++)
     {
         if (!(entries[i].active)) /* don't uninstall this one */
@@ -264,9 +274,9 @@
             if(MessageBoxW(0, errormsg, sAppName, MB_YESNO | MB_ICONQUESTION)==IDYES)
             {
                 /* delete the application's uninstall entry */
-                RegOpenKeyExW(HKEY_LOCAL_MACHINE, PathUninstallW, 0, KEY_READ, &hkey);
-                RegDeleteKeyW(hkey, entries[i].key);
-                RegCloseKey(hkey);
+                RegOpenKeyExW(rootkey, PathUninstallW, 0, KEY_READ, &hkeyUninst);
+                RegDeleteKeyW(hkeyUninst, entries[i].key);
+                RegCloseKey(hkeyUninst);
             }
         }
     }
@@ -280,6 +290,9 @@
     TEXTMETRICW tm;
     HDC hdc;
     HWND hList = GetDlgItem(hwnd, IDC_LIST);
+    HKEY rootkey[2];
+    rootkey[0] = HKEY_CURRENT_USER;
+    rootkey[1] = HKEY_LOCAL_MACHINE;
     switch(Message)
     {
         case WM_INITDIALOG:
@@ -310,9 +323,9 @@
                 case IDC_UNINSTALL:
                 {
                     int count = SendMessageW(hList, LB_GETSELCOUNT, 0, 0);
-                    if(count != 0)
+                    if (count != 0)
                     {
-                        UninstallProgram();
+                        UninstallProgram(*rootkey);
                         UpdateList(hList);
                     }
                     break;
