[efi] check for 7-zip path in HKLM

* Closes #121
* Also update registry handling
* Issues reported by Ronny Kalusniok
This commit is contained in:
Pete Batard 2013-02-02 16:57:46 +00:00
parent c51bf5ce45
commit d2e7e003c3
6 changed files with 70 additions and 72 deletions

View file

@ -422,7 +422,7 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
BOOL is_x64 = FALSE, (__stdcall *pIsWow64Process)(HANDLE, PBOOL) = NULL;
update_check_in_progress = TRUE;
verbose = ReadRegistryKey32(REGKEY_VERBOSE_UPDATES);
verbose = ReadRegistryKey32(REGKEY_HKCU, REGKEY_VERBOSE_UPDATES);
// Unless the update was forced, wait a while before performing the update check
if (!force_update_check) {
// TODO: Also check on inactivity
@ -433,14 +433,14 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
Sleep(500);
} while ((!force_update_check) && ((iso_op_in_progress || format_op_in_progress || (dialog_showing>0))));
if (!force_update_check) {
if ((ReadRegistryKey32(REGKEY_UPDATE_INTERVAL) == -1)) {
if ((ReadRegistryKey32(REGKEY_HKCU, REGKEY_UPDATE_INTERVAL) == -1)) {
vuprintf("Check for updates disabled, as per registry settings.\n");
goto out;
}
reg_time = ReadRegistryKey64(REGKEY_LAST_UPDATE);
update_interval = (int64_t)ReadRegistryKey32(REGKEY_UPDATE_INTERVAL);
reg_time = ReadRegistryKey64(REGKEY_HKCU, REGKEY_LAST_UPDATE);
update_interval = (int64_t)ReadRegistryKey32(REGKEY_HKCU, REGKEY_UPDATE_INTERVAL);
if (update_interval == 0) {
WriteRegistryKey32(REGKEY_UPDATE_INTERVAL, DEFAULT_UPDATE_INTERVAL);
WriteRegistryKey32(REGKEY_HKCU, REGKEY_UPDATE_INTERVAL, DEFAULT_UPDATE_INTERVAL);
update_interval = DEFAULT_UPDATE_INTERVAL;
}
GetSystemTime(&LocalTime);
@ -488,7 +488,7 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
goto out;
status++; // 2
releases_only = !GetRegistryKeyBool(REGKEY_INCLUDE_BETAS);
releases_only = !GetRegistryKeyBool(REGKEY_HKCU, REGKEY_INCLUDE_BETAS);
for (k=0; (k<(releases_only?1:(int)ARRAYSIZE(channel))) && (!found_new_version); k++) {
uprintf("Checking %s channel...\n", channel[k]);
@ -554,7 +554,7 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
server_time = ((((int64_t)FileTime.dwHighDateTime)<<32) + FileTime.dwLowDateTime) / 10000000;
vvuprintf("Server time: %" PRId64 "\n", server_time);
// Always store the server response time - the only clock we trust!
WriteRegistryKey64(REGKEY_LAST_UPDATE, server_time);
WriteRegistryKey64(REGKEY_HKCU, REGKEY_LAST_UPDATE, server_time);
// Might as well let the user know
if (!force_update_check) {
if (local_time > server_time + 600) {