Commit 084458bc authored by Alexandre Julliard's avatar Alexandre Julliard

uninstaller: Fail more gracefully when the registry key is missing.

parent 8cec3cf1
...@@ -76,8 +76,7 @@ static void ListUninstallPrograms(void) ...@@ -76,8 +76,7 @@ static void ListUninstallPrograms(void)
char *descr; char *descr;
char *key; char *key;
if (! FetchUninstallInformation()) FetchUninstallInformation();
return;
for (i=0; i < numentries; i++) for (i=0; i < numentries; i++)
{ {
...@@ -100,8 +99,7 @@ static void RemoveSpecificProgram(WCHAR *nameW) ...@@ -100,8 +99,7 @@ static void RemoveSpecificProgram(WCHAR *nameW)
int lenName; int lenName;
char *name; char *name;
if (! FetchUninstallInformation()) FetchUninstallInformation();
return;
for (i=0; i < numentries; i++) for (i=0; i < numentries; i++)
{ {
...@@ -196,10 +194,7 @@ static int FetchUninstallInformation(void) ...@@ -196,10 +194,7 @@ static int FetchUninstallInformation(void)
numentries = 0; numentries = 0;
oldsel = -1; oldsel = -1;
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, PathUninstallW, 0, KEY_READ, &hkeyUninst) != ERROR_SUCCESS) if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, PathUninstallW, 0, KEY_READ, &hkeyUninst) != ERROR_SUCCESS)
{
MessageBoxW(0, sRegistryKeyNotAvailable, sAppName, MB_OK);
return 0; return 0;
}
if (!entries) if (!entries)
entries = HeapAlloc(GetProcessHeap(), 0, sizeof(uninst_entry)); entries = HeapAlloc(GetProcessHeap(), 0, sizeof(uninst_entry));
...@@ -363,6 +358,7 @@ static void UpdateList(HWND hList) ...@@ -363,6 +358,7 @@ static void UpdateList(HWND hList)
prevsel = SendMessageW(hList, LB_GETCURSEL, 0, 0); prevsel = SendMessageW(hList, LB_GETCURSEL, 0, 0);
if (!(FetchUninstallInformation())) if (!(FetchUninstallInformation()))
{ {
MessageBoxW(0, sRegistryKeyNotAvailable, sAppName, MB_OK);
PostQuitMessage(0); PostQuitMessage(0);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment