VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Setup.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-06-11 23:59:52 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-06-12 00:01:12 +0200
commit44234a0ccccffdd11765516328f5eb324fc34cba (patch)
tree23d45e057c45222a1a89e5cb1dd34eaa8704646f /src/Setup/Setup.c
parent6be12f488956e6995830386b64ca3c0dcd77389a (diff)
downloadVeraCrypt-44234a0ccccffdd11765516328f5eb324fc34cba.tar.gz
VeraCrypt-44234a0ccccffdd11765516328f5eb324fc34cba.zip
Windows installer: solve Windows XP 32-bit incompatibility issue introduced previously.
Diffstat (limited to 'src/Setup/Setup.c')
-rw-r--r--src/Setup/Setup.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index 5f1c9300..baf4faf7 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -1070,6 +1070,13 @@ BOOL DoApplicationDataUninstall (HWND hwndDlg)
BOOL DoRegUninstall (HWND hwndDlg, BOOL bRemoveDeprecated)
{
char regk [64];
+ typedef LSTATUS (WINAPI *RegDeleteKeyExAFn) (HKEY hKey,LPCSTR lpSubKey,REGSAM samDesired,WORD Reserved);
+ RegDeleteKeyExAFn RegDeleteKeyExAPtr = NULL;
+ HMODULE hAdvapiDll = LoadLibrary ("Advapi32.dll");
+ if (hAdvapiDll)
+ {
+ RegDeleteKeyExAPtr = (RegDeleteKeyExAFn) GetProcAddress(hAdvapiDll, "RegDeleteKeyExA");
+ }
// Unregister COM servers
if (!bRemoveDeprecated && IsOSAtLeast (WIN_VISTA))
@@ -1081,14 +1088,22 @@ BOOL DoRegUninstall (HWND hwndDlg, BOOL bRemoveDeprecated)
if (!bRemoveDeprecated)
StatusMessage (hwndDlg, "REMOVING_REG");
- RegDeleteKeyEx (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\VeraCrypt", KEY_WOW64_32KEY, 0);
+ if (RegDeleteKeyExAPtr)
+ {
+ RegDeleteKeyExAPtr (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\VeraCrypt", KEY_WOW64_32KEY, 0);
+ RegDeleteKeyExAPtr (HKEY_CURRENT_USER, "Software\\VeraCrypt", KEY_WOW64_32KEY, 0);
+ }
+ else
+ {
+ RegDeleteKey (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\VeraCrypt");
+ RegDeleteKey (HKEY_LOCAL_MACHINE, "Software\\VeraCrypt");
+ }
RegDeleteKey (HKEY_LOCAL_MACHINE, "Software\\Classes\\VeraCryptVolume\\Shell\\open\\command");
RegDeleteKey (HKEY_LOCAL_MACHINE, "Software\\Classes\\VeraCryptVolume\\Shell\\open");
RegDeleteKey (HKEY_LOCAL_MACHINE, "Software\\Classes\\VeraCryptVolume\\Shell");
RegDeleteKey (HKEY_LOCAL_MACHINE, "Software\\Classes\\VeraCryptVolume\\DefaultIcon");
RegDeleteKey (HKEY_LOCAL_MACHINE, "Software\\Classes\\VeraCryptVolume");
- RegDeleteKeyEx (HKEY_CURRENT_USER, "Software\\VeraCrypt", KEY_WOW64_32KEY, 0);
-
+
if (!bRemoveDeprecated)
{
HKEY hKey;
@@ -1120,6 +1135,9 @@ BOOL DoRegUninstall (HWND hwndDlg, BOOL bRemoveDeprecated)
SHChangeNotify (SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
}
+
+ if (hAdvapiDll)
+ FreeLibrary (hAdvapiDll);
return TRUE;
}