mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-17 16:44:27 -04:00
[efi] check for 7-zip path in HKLM
* Closes #121 * Also update registry handling * Issues reported by Ronny Kalusniok
This commit is contained in:
parent
c51bf5ce45
commit
d2e7e003c3
6 changed files with 70 additions and 72 deletions
14
src/net.c
14
src/net.c
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue