Author: dchapyshev
Date: Sat Oct 3 11:34:19 2009
New Revision: 43260
URL:
http://svn.reactos.org/svn/reactos?rev=43260&view=rev
Log:
- Implement delete of the program information from the registry
- Store settings information in HKEY_LOCAL_MACHINE instead HKEY_CURRENT_USER
Modified:
trunk/reactos/base/applications/rapps/installed.c
trunk/reactos/base/applications/rapps/lang/bg-BG.rc
trunk/reactos/base/applications/rapps/lang/de-DE.rc
trunk/reactos/base/applications/rapps/lang/en-US.rc
trunk/reactos/base/applications/rapps/lang/es-ES.rc
trunk/reactos/base/applications/rapps/lang/ja-JP.rc
trunk/reactos/base/applications/rapps/lang/no-NO.rc
trunk/reactos/base/applications/rapps/lang/pl-PL.rc
trunk/reactos/base/applications/rapps/lang/ru-RU.rc
trunk/reactos/base/applications/rapps/lang/sk-SK.rc
trunk/reactos/base/applications/rapps/lang/uk-UA.rc
trunk/reactos/base/applications/rapps/rapps.h
trunk/reactos/base/applications/rapps/resource.h
trunk/reactos/base/applications/rapps/winmain.c
Modified: trunk/reactos/base/applications/rapps/installed.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/in…
==============================================================================
--- trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -136,17 +136,17 @@
ShowInstalledAppInfo(INT Index)
{
WCHAR szText[MAX_PATH], szInfo[MAX_PATH];
- HKEY hKey = (HKEY) ListViewGetlParam(Index);
-
- if (!hKey) return FALSE;
-
- GetApplicationString(hKey, L"DisplayName", szText);
+ PINSTALLED_INFO Info = ListViewGetlParam(Index);
+
+ if (!Info || !Info->hSubKey) return FALSE;
+
+ GetApplicationString(Info->hSubKey, L"DisplayName", szText);
NewRichEditText(szText, CFE_BOLD);
InsertRichEditText(L"\n", 0);
#define GET_INFO(a, b, c, d) \
- if (GetApplicationString(hKey, a, szInfo)) \
+ if (GetApplicationString(Info->hSubKey, a, szInfo)) \
{ \
LoadStringW(hInst, b, szText, sizeof(szText) / sizeof(WCHAR)); \
InsertRichEditText(szText, c); \
@@ -175,32 +175,70 @@
}
+VOID
+RemoveAppFromRegistry(INT Index)
+{
+ PINSTALLED_INFO Info;
+ WCHAR szFullName[MAX_PATH] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\";
+ WCHAR szMsgText[MAX_STR_LEN], szMsgTitle[MAX_STR_LEN];
+ INT ItemIndex = SendMessage(hListView, LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
+
+ if (!IS_INSTALLED_ENUM(SelectedEnumType))
+ return;
+
+ Info = ListViewGetlParam(Index);
+ if (!Info || !Info->hSubKey || (ItemIndex == -1)) return;
+
+ if (!LoadStringW(hInst, IDS_APP_REG_REMOVE, szMsgText, sizeof(szMsgText) /
sizeof(WCHAR)) ||
+ !LoadStringW(hInst, IDS_INFORMATION, szMsgTitle, sizeof(szMsgTitle) /
sizeof(WCHAR)))
+ return;
+
+ if (MessageBoxW(hMainWnd, szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) ==
IDYES)
+ {
+ wcsncat(szFullName, Info->szKeyName, MAX_PATH - wcslen(szFullName));
+
+ if (RegDeleteKeyW(Info->hRootKey, szFullName) == ERROR_SUCCESS)
+ {
+ (VOID) ListView_DeleteItem(hListView, ItemIndex);
+ return;
+ }
+
+ if (!LoadStringW(hInst, IDS_UNABLE_TO_REMOVE, szMsgText, sizeof(szMsgText) /
sizeof(WCHAR)))
+ return;
+
+ MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR);
+ }
+}
+
+
BOOL
EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
{
DWORD dwSize = MAX_PATH, dwType, dwValue;
BOOL bIsSystemComponent, bIsUpdate;
- WCHAR pszName[MAX_PATH];
WCHAR pszParentKeyName[MAX_PATH];
WCHAR pszDisplayName[MAX_PATH];
- HKEY hKey, hSubKey;
+ INSTALLED_INFO Info;
+ HKEY hKey;
LONG ItemIndex = 0;
- if (RegOpenKeyW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
+ Info.hRootKey = IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
+
+ if (RegOpenKeyW(Info.hRootKey,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
&hKey) != ERROR_SUCCESS)
{
return FALSE;
}
- while (RegEnumKeyExW(hKey, ItemIndex, pszName, &dwSize, NULL, NULL, NULL, NULL)
== ERROR_SUCCESS)
- {
- if (RegOpenKeyW(hKey, pszName, &hSubKey) == ERROR_SUCCESS)
+ while (RegEnumKeyExW(hKey, ItemIndex, Info.szKeyName, &dwSize, NULL, NULL, NULL,
NULL) == ERROR_SUCCESS)
+ {
+ if (RegOpenKeyW(hKey, Info.szKeyName, &Info.hSubKey) == ERROR_SUCCESS)
{
dwType = REG_DWORD;
dwSize = sizeof(DWORD);
- if (RegQueryValueExW(hSubKey,
+ if (RegQueryValueExW(Info.hSubKey,
L"SystemComponent",
NULL,
&dwType,
@@ -216,7 +254,7 @@
dwType = REG_SZ;
dwSize = MAX_PATH;
- bIsUpdate = (RegQueryValueExW(hSubKey,
+ bIsUpdate = (RegQueryValueExW(Info.hSubKey,
L"ParentKeyName",
NULL,
&dwType,
@@ -224,7 +262,7 @@
&dwSize) == ERROR_SUCCESS);
dwSize = MAX_PATH;
- if (RegQueryValueExW(hSubKey,
+ if (RegQueryValueExW(Info.hSubKey,
L"DisplayName",
NULL,
&dwType,
@@ -240,7 +278,7 @@
((EnumType == ENUM_APPLICATIONS) && (!bIsUpdate)) || /*
Applications only */
((EnumType == ENUM_UPDATES) && (bIsUpdate))) /* Updates
only */
{
- if (!lpEnumProc(ItemIndex, pszDisplayName, pszName,
(LPARAM)hSubKey))
+ if (!lpEnumProc(ItemIndex, pszDisplayName, Info))
break;
}
}
Modified: trunk/reactos/base/applications/rapps/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -13,6 +13,8 @@
MENUITEM "&Ñëàãàíå", ID_INSTALL
MENUITEM "&Ìàõàíå",ID_UNINSTALL
MENUITEM "&Ïðîìÿíà", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "Î&ïðåñíÿâàíå", ID_REFRESH
END
@@ -39,6 +41,8 @@
MENUITEM "&Ñëàãàíå", ID_INSTALL
MENUITEM "&Ìàõàíå", ID_UNINSTALL
MENUITEM "&Ïðîìÿíà", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "Î&ïðåñíÿâàíå", ID_REFRESH
END
@@ -183,4 +187,7 @@
IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of
programs:"
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS
Applications Manager""!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -13,6 +13,8 @@
MENUITEM "&Installieren", ID_INSTALL
MENUITEM "&Deinstallieren",ID_UNINSTALL
MENUITEM "&Ändern", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Aktualisieren", ID_REFRESH
END
@@ -39,6 +41,8 @@
MENUITEM "&Installieren", ID_INSTALL
MENUITEM "&Deinstallieren", ID_UNINSTALL
MENUITEM "&Ändern", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Aktualisieren", ID_REFRESH
END
@@ -183,4 +187,7 @@
IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of
programs:"
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS
Applications Manager""!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -13,6 +13,8 @@
MENUITEM "&Install", ID_INSTALL
MENUITEM "&Uninstall",ID_UNINSTALL
MENUITEM "&Modify", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Refresh", ID_REFRESH
END
@@ -39,6 +41,8 @@
MENUITEM "&Install", ID_INSTALL
MENUITEM "&Uninstall", ID_UNINSTALL
MENUITEM "&Modify", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Refresh", ID_REFRESH
END
@@ -183,4 +187,7 @@
IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of
programs:"
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS
Applications Manager""!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -13,6 +13,8 @@
MENUITEM "&Instalar", ID_INSTALL
MENUITEM "&Desinstalar",ID_UNINSTALL
MENUITEM "&Modificar", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Refrescar", ID_REFRESH
END
@@ -39,6 +41,8 @@
MENUITEM "&Instalar", ID_INSTALL
MENUITEM "&Desinstalar", ID_UNINSTALL
MENUITEM "&Modificar", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Refrescar", ID_REFRESH
END
@@ -183,4 +187,7 @@
IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of
programs:"
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS
Applications Manager""!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -13,6 +13,8 @@
MENUITEM "CXg[(&I)", ID_INSTALL
MENUITEM "ACXg[(&U)",ID_UNINSTALL
MENUITEM "ÏX(&M)", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "XV(&R)", ID_REFRESH
END
@@ -39,6 +41,8 @@
MENUITEM "CXg[(&I)", ID_INSTALL
MENUITEM "ACXg[(&U)", ID_UNINSTALL
MENUITEM "ÏX(&M)", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "XV(&R)", ID_REFRESH
END
@@ -183,4 +187,7 @@
IDS_CHOOSE_FOLDER_TEXT
"vOÌ_E[hÉgp·étH_ðIðµÄ¾³¢:"
IDS_CHOOSE_FOLDER_ERROR "wè³ê½tH_Ͷݵܹñ!"
IDS_USER_NOT_ADMIN """ReactOS AvP[V
}l[W["" ðN®·éÉÍÇÒ ÀÅ éKvª èÜ·!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -13,6 +13,8 @@
MENUITEM "&Installere", ID_INSTALL
MENUITEM "&Avinstallere",ID_UNINSTALL
MENUITEM "&Endre", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Oppdatere", ID_REFRESH
END
@@ -39,6 +41,8 @@
MENUITEM "&Installere", ID_INSTALL
MENUITEM "&Avinstallere", ID_UNINSTALL
MENUITEM "&Endre", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Oppdater", ID_REFRESH
END
@@ -183,4 +187,7 @@
IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of
programs:"
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS
Applications Manager""!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -15,6 +15,8 @@
MENUITEM "&Instaluj", ID_INSTALL
MENUITEM "&Odinstaluj",ID_UNINSTALL
MENUITEM "&Modyfikuj", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "O&dwie¿", ID_REFRESH
END
@@ -41,6 +43,8 @@
MENUITEM "&Instaluj", ID_INSTALL
MENUITEM "&odinstaluj", ID_UNINSTALL
MENUITEM "&Modyfikuj", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Odwie¿", ID_REFRESH
END
@@ -185,4 +189,7 @@
IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of
programs:"
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS
Applications Manager""!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -10,9 +10,11 @@
END
POPUP "&Ïðîãðàììû"
BEGIN
- MENUITEM "&Óñòàíîâèòü", ID_INSTALL
+ MENUITEM "Ó&ñòàíîâèòü", ID_INSTALL
MENUITEM "&Óäàëèòü", ID_UNINSTALL
MENUITEM "&Èçìåíèòü", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "Ó&äàëèòü èç ðååñòðà", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Îáíîâèòü", ID_REFRESH
END
@@ -39,6 +41,8 @@
MENUITEM "&Óñòàíîâèòü", ID_INSTALL
MENUITEM "&Óäàëèòü", ID_UNINSTALL
MENUITEM "&Èçìåíèòü", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "Ó&äàëèòü èç ðååñòðà", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Îáíîâèòü", ID_REFRESH
END
@@ -183,4 +187,7 @@
IDS_CHOOSE_FOLDER_TEXT "Âûáåðèòå ïàïêó, êîòîðàÿ áóäåò èñïîëüçîâàòüñÿ äëÿ çàãðóçêè
ïðîãðàìì:"
IDS_CHOOSE_FOLDER_ERROR "Âû óêàçàëè íåñóùåñòâóþùóþ ïàïêó!"
IDS_USER_NOT_ADMIN "Âû äîëæíû áûòü àäìèíèñòðàòîðîì äëÿ çàïóñêà
""Ìåíåäæåðà ïðèëîæåíèé ReactOS""!"
+ IDS_APP_REG_REMOVE "Âû äåéñòâèòåëüíî õîòèòå óäàëèòü äàííûå îá óñòàíîâëåííîé
ïðîãðàììå èç ðååñòðà?"
+ IDS_INFORMATION "Èíôîðìàöèÿ"
+ IDS_UNABLE_TO_REMOVE "Íå óäàëîñü óäàëèòü äàííûå î ïðîãðàììå èç ðååñòðà!"
END
Modified: trunk/reactos/base/applications/rapps/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -18,6 +18,8 @@
MENUITEM "&Intalova", ID_INSTALL
MENUITEM "O&dintalova", ID_UNINSTALL
MENUITEM "&Zmeni", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Obnovi", ID_REFRESH
END
@@ -44,6 +46,8 @@
MENUITEM "&Intalova", ID_INSTALL
MENUITEM "O&dintalova", ID_UNINSTALL
MENUITEM "&Zmeni", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Obnovi", ID_REFRESH
END
@@ -188,4 +192,7 @@
IDS_CHOOSE_FOLDER_TEXT "Vyberte prieèinok, ktorý sa pouije pre sahovanie
programov:"
IDS_CHOOSE_FOLDER_ERROR "Zvolili ste si neexistujúci prieèinok!"
IDS_USER_NOT_ADMIN "Mali by ste by administrátor pre spustenie
""Manaéra aplikácií systému ReactOS""!"
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -22,6 +22,8 @@
MENUITEM "&Âèäàëèòè",ID_UNINSTALL
MENUITEM "&Çì³íèòè", ID_MODIFY
MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
+ MENUITEM SEPARATOR
MENUITEM "&Îíîâèòè", ID_REFRESH
END
POPUP "Äîâ³äêà"
@@ -47,6 +49,8 @@
MENUITEM "&Âñòàíîâèòè", ID_INSTALL
MENUITEM "&Âèäàëèòè", ID_UNINSTALL
MENUITEM "&Çì³íèòè", ID_MODIFY
+ MENUITEM SEPARATOR
+ MENUITEM "&Remove from Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Îíîâèòè", ID_REFRESH
END
@@ -191,4 +195,7 @@
IDS_CHOOSE_FOLDER_TEXT "Choose a folder which will be used for downloading of
programs:"
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_USER_NOT_ADMIN "You should be administrator for start ""ReactOS
Applications Manager""!"
-END
+ IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
+ IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
+END
Modified: trunk/reactos/base/applications/rapps/rapps.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
==============================================================================
--- trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] Sat Oct 3 11:34:19 2009
@@ -71,6 +71,14 @@
typedef struct
{
+ HKEY hRootKey;
+ HKEY hSubKey;
+ WCHAR szKeyName[MAX_PATH];
+
+} INSTALLED_INFO, *PINSTALLED_INFO;
+
+typedef struct
+{
BOOL bSaveWndPos;
BOOL bUpdateAtStart;
BOOL bLogEnabled;
@@ -95,12 +103,13 @@
BOOL InstallApplication(INT Index);
/* installed.c */
-typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, LPWSTR lpKeyName,
LPARAM lParam);
+typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info);
BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc);
BOOL GetApplicationString(HKEY hKey, LPWSTR lpKeyName, LPWSTR lpString);
BOOL ShowInstalledAppInfo(INT Index);
BOOL UninstallApplication(INT Index, BOOL bModify);
BOOL IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey);
+VOID RemoveAppFromRegistry(INT Index);
/* winmain.c */
extern HWND hMainWnd;
Modified: trunk/reactos/base/applications/rapps/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/re…
==============================================================================
--- trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] Sat Oct 3 11:34:19
2009
@@ -69,6 +69,7 @@
#define ID_COPY_LINK 557
#define ID_SETTINGS 558
#define ID_REFRESH 559
+#define ID_REGREMOVE 560
/* Strings */
#define IDS_APPTITLE 100
@@ -87,6 +88,9 @@
#define IDS_CHOOSE_FOLDER_TEXT 113
#define IDS_CHOOSE_FOLDER_ERROR 114
#define IDS_USER_NOT_ADMIN 115
+#define IDS_APP_REG_REMOVE 116
+#define IDS_INFORMATION 117
+#define IDS_UNABLE_TO_REMOVE 118
/* Tooltips */
#define IDS_TOOLTIP_INSTALL 200
Modified: trunk/reactos/base/applications/rapps/winmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
==============================================================================
--- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Oct 3 11:34:19 2009
@@ -15,6 +15,7 @@
INT SelectedEnumType = ENUM_ALL_COMPONENTS;
SETTINGS_INFO SettingsInfo;
+
VOID
FillDafaultSettings(PSETTINGS_INFO pSettingsInfo)
{
@@ -37,7 +38,7 @@
HKEY hKey;
DWORD dwSize;
- if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", 0,
KEY_READ, &hKey) == ERROR_SUCCESS)
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\rapps", 0,
KEY_READ, &hKey) == ERROR_SUCCESS)
{
dwSize = sizeof(SETTINGS_INFO);
if (RegQueryValueExW(hKey, L"Settings", NULL, NULL,
(LPBYTE)&SettingsInfo, &dwSize) == ERROR_SUCCESS)
@@ -70,7 +71,7 @@
SettingsInfo.Maximized = (IsZoomed(hwnd) || (wp.flags &
WPF_RESTORETOMAXIMIZED));
}
- if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", 0,
NULL,
+ if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\rapps", 0,
NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS)
{
RegSetValueEx(hKey, L"Settings", 0, REG_BINARY,
(LPBYTE)&SettingsInfo, sizeof(SETTINGS_INFO));
@@ -82,31 +83,40 @@
FreeInstalledAppList(VOID)
{
INT Count = ListView_GetItemCount(hListView) - 1;
- HKEY hKey;
+ PINSTALLED_INFO Info;
while (Count >= 0)
{
- hKey = ListViewGetlParam(Count);
- if (hKey)
- RegCloseKey(hKey);
+ Info = ListViewGetlParam(Count);
+ if (Info)
+ {
+ RegCloseKey(Info->hSubKey);
+ HeapFree(GetProcessHeap(), 0, Info);
+ }
Count--;
}
}
BOOL
CALLBACK
-EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, LPWSTR lpKeyName, LPARAM lParam)
-{
+EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info)
+{
+ PINSTALLED_INFO ItemInfo;
WCHAR szText[MAX_PATH];
INT Index;
- Index = ListViewAddItem(ItemIndex, 0, lpName, lParam);
+ ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO));
+ if (!ItemInfo) return FALSE;
+
+ *ItemInfo = Info;
+
+ Index = ListViewAddItem(ItemIndex, 0, lpName, (LPARAM)ItemInfo);
/* Get version info */
- GetApplicationString((HKEY)lParam, L"DisplayVersion", szText);
+ GetApplicationString((HKEY)ItemInfo->hSubKey, L"DisplayVersion",
szText);
ListView_SetItemText(hListView, Index, 1, szText);
/* Get comments */
- GetApplicationString((HKEY)lParam, L"Comments", szText);
+ GetApplicationString((HKEY)ItemInfo->hSubKey, L"Comments", szText);
ListView_SetItemText(hListView, Index, 2, szText);
return TRUE;
@@ -399,6 +409,10 @@
UpdateApplicationsList(-1);
break;
+ case ID_REGREMOVE:
+ RemoveAppFromRegistry(-1);
+ break;
+
case ID_REFRESH:
UpdateApplicationsList(-1);
break;