Found it
HERE: - Initial update check setup
commcheck is the DWORD
GetTickCount (
wiki), a part of the boolean function
SetUpdateCheck.
There is a hack included in the code:
If you run rufus.exe (no version in filename/first run) you will not get the update settings prompt and default values are applied.
If you run rufus_v1.x.x.exe (version in filename/first run) you will get the update settings prompt where you can set preferred values.
You can also get to the same update settings prompt/dialog as follows: About... > Updates
Code Function Snippet:
Code:
BOOL SetUpdateCheck(void)
{
BOOL enable_updates;
DWORD commcheck = GetTickCount();
notification_info more_info = { IDD_UPDATE_POLICY, UpdateCallback };
char filename[MAX_PATH] = "", exename[] = APPLICATION_NAME ".exe";
size_t fn_len, exe_len;
// Test if we have access to the registry. If not, forget it.
WriteRegistryKey32(REGKEY_COMM_CHECK, commcheck);
if (ReadRegistryKey32(REGKEY_COMM_CHECK) != commcheck)
return FALSE;
reg_commcheck = TRUE;
// If the update interval is not set, this is the first time we run so prompt the user
if (ReadRegistryKey32(REGKEY_UPDATE_INTERVAL) == 0) {
// Add a hack for people who'd prefer the app not to prompt about update settings on first run.
// If the executable is called "rufus.exe", without version, we disable the prompt
GetModuleFileNameU(NULL, filename, sizeof(filename));
fn_len = safe_strlen(filename);
exe_len = safe_strlen(exename);
if ((fn_len > exe_len) && (safe_stricmp(&filename[fn_len-exe_len], exename) == 0)) {
uprintf("Short name used - Disabling initial update policy prompt\n");
enable_updates = TRUE;
} else {
enable_updates = Notification(MSG_QUESTION, &more_info, APPLICATION_NAME " update policy",
"Do you want to allow " APPLICATION_NAME " to check for application updates?\n");
}
if (!enable_updates) {
WriteRegistryKey32(REGKEY_UPDATE_INTERVAL, -1);
return FALSE;
}
// If the user hasn't set the interval in the dialog, set to default
if ( (ReadRegistryKey32(REGKEY_UPDATE_INTERVAL) == 0) ||
((ReadRegistryKey32(REGKEY_UPDATE_INTERVAL) == -1) && enable_updates) )
WriteRegistryKey32(REGKEY_UPDATE_INTERVAL, 86400);
}
return TRUE;
}
~Ruby