|
|
|
@ -319,8 +319,11 @@ BOOL IsUpdateAvailableHelper( |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
if (*toast) |
|
|
|
if (*toast) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
|
|
|
|
} |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast) = NULL; |
|
|
|
(*toast) = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -636,20 +639,13 @@ BOOL UpdateProduct( |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BOOL InstallUpdatesIfAvailable( |
|
|
|
BOOL ShowUpdateSuccessNotification( |
|
|
|
HMODULE hModule, |
|
|
|
HMODULE hModule, |
|
|
|
BOOL bIsPostUpdate, |
|
|
|
|
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotifier* notifier, |
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotifier* notifier, |
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotificationFactory* notifFactory, |
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotificationFactory* notifFactory, |
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotification** toast, |
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotification** toast |
|
|
|
DWORD dwOperation, |
|
|
|
|
|
|
|
DWORD bAllocConsole, |
|
|
|
|
|
|
|
DWORD dwUpdatePolicy |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
{ |
|
|
|
{ |
|
|
|
wchar_t wszInfoURL[MAX_PATH]; |
|
|
|
|
|
|
|
ZeroMemory(wszInfoURL, MAX_PATH * sizeof(wchar_t)); |
|
|
|
|
|
|
|
wcscat_s(wszInfoURL, MAX_PATH, _T(UPDATES_RELEASE_INFO_URL_STABLE)); |
|
|
|
|
|
|
|
wchar_t buf[TOAST_BUFSIZ]; |
|
|
|
wchar_t buf[TOAST_BUFSIZ]; |
|
|
|
DWORD dwLeftMost = 0; |
|
|
|
DWORD dwLeftMost = 0; |
|
|
|
DWORD dwSecondLeft = 0; |
|
|
|
DWORD dwSecondLeft = 0; |
|
|
|
@ -657,8 +653,6 @@ BOOL InstallUpdatesIfAvailable( |
|
|
|
DWORD dwRightMost = 0; |
|
|
|
DWORD dwRightMost = 0; |
|
|
|
QueryVersionInfo(hModule, VS_VERSION_INFO, &dwLeftMost, &dwSecondLeft, &dwSecondRight, &dwRightMost); |
|
|
|
QueryVersionInfo(hModule, VS_VERSION_INFO, &dwLeftMost, &dwSecondLeft, &dwSecondRight, &dwRightMost); |
|
|
|
|
|
|
|
|
|
|
|
if (bIsPostUpdate) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
__x_ABI_CWindows_CData_CXml_CDom_CIXmlDocument* inputXml = NULL; |
|
|
|
__x_ABI_CWindows_CData_CXml_CDom_CIXmlDocument* inputXml = NULL; |
|
|
|
const wchar_t text[] = |
|
|
|
const wchar_t text[] = |
|
|
|
L"<toast displayTimestamp=\"2021-08-29T00:00:00.000Z\" scenario=\"reminder\" " |
|
|
|
L"<toast displayTimestamp=\"2021-08-29T00:00:00.000Z\" scenario=\"reminder\" " |
|
|
|
@ -680,13 +674,19 @@ BOOL InstallUpdatesIfAvailable( |
|
|
|
NULL |
|
|
|
NULL |
|
|
|
); |
|
|
|
); |
|
|
|
if (*toast) |
|
|
|
if (*toast) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
|
|
|
|
} |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast) = NULL; |
|
|
|
(*toast) = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (notifFactory) |
|
|
|
|
|
|
|
{ |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
if (*toast) |
|
|
|
} |
|
|
|
|
|
|
|
if ((*toast) && notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -695,41 +695,29 @@ BOOL InstallUpdatesIfAvailable( |
|
|
|
inputXml->lpVtbl->Release(inputXml); |
|
|
|
inputXml->lpVtbl->Release(inputXml); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HKEY hKey = NULL; |
|
|
|
|
|
|
|
DWORD dwSize = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RegCreateKeyExW( |
|
|
|
|
|
|
|
HKEY_CURRENT_USER, |
|
|
|
|
|
|
|
TEXT(REGPATH), |
|
|
|
|
|
|
|
0, |
|
|
|
|
|
|
|
NULL, |
|
|
|
|
|
|
|
REG_OPTION_NON_VOLATILE, |
|
|
|
|
|
|
|
KEY_READ | KEY_WOW64_64KEY | KEY_WRITE, |
|
|
|
|
|
|
|
NULL, |
|
|
|
|
|
|
|
&hKey, |
|
|
|
|
|
|
|
NULL |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (hKey == NULL || hKey == INVALID_HANDLE_VALUE) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hKey = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (hKey) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dwSize = FALSE; |
|
|
|
|
|
|
|
RegSetValueExW( |
|
|
|
|
|
|
|
hKey, |
|
|
|
|
|
|
|
TEXT("IsUpdatePending"), |
|
|
|
|
|
|
|
0, |
|
|
|
|
|
|
|
REG_DWORD, |
|
|
|
|
|
|
|
&dwSize, |
|
|
|
|
|
|
|
sizeof(DWORD) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
RegCloseKey(hKey); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwitchToThread(); |
|
|
|
SwitchToThread(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL InstallUpdatesIfAvailable( |
|
|
|
|
|
|
|
HMODULE hModule, |
|
|
|
|
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotifier* notifier, |
|
|
|
|
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotificationFactory* notifFactory, |
|
|
|
|
|
|
|
__x_ABI_CWindows_CUI_CNotifications_CIToastNotification** toast, |
|
|
|
|
|
|
|
DWORD dwOperation, |
|
|
|
|
|
|
|
DWORD bAllocConsole, |
|
|
|
|
|
|
|
DWORD dwUpdatePolicy |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
wchar_t wszInfoURL[MAX_PATH]; |
|
|
|
|
|
|
|
ZeroMemory(wszInfoURL, MAX_PATH * sizeof(wchar_t)); |
|
|
|
|
|
|
|
wcscat_s(wszInfoURL, MAX_PATH, _T(UPDATES_RELEASE_INFO_URL_STABLE)); |
|
|
|
|
|
|
|
wchar_t buf[TOAST_BUFSIZ]; |
|
|
|
|
|
|
|
DWORD dwLeftMost = 0; |
|
|
|
|
|
|
|
DWORD dwSecondLeft = 0; |
|
|
|
|
|
|
|
DWORD dwSecondRight = 0; |
|
|
|
|
|
|
|
DWORD dwRightMost = 0; |
|
|
|
|
|
|
|
QueryVersionInfo(hModule, VS_VERSION_INFO, &dwLeftMost, &dwSecondLeft, &dwSecondRight, &dwRightMost); |
|
|
|
|
|
|
|
|
|
|
|
if (bAllocConsole) |
|
|
|
if (bAllocConsole) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (dwUpdatePolicy) |
|
|
|
switch (dwUpdatePolicy) |
|
|
|
@ -803,13 +791,19 @@ BOOL InstallUpdatesIfAvailable( |
|
|
|
if (dwOperation == UPDATES_OP_CHECK || dwOperation == UPDATES_OP_INSTALL) |
|
|
|
if (dwOperation == UPDATES_OP_CHECK || dwOperation == UPDATES_OP_INSTALL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (*toast) |
|
|
|
if (*toast) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
|
|
|
|
} |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast) = NULL; |
|
|
|
(*toast) = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (notifFactory) |
|
|
|
|
|
|
|
{ |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
if ((*toast)) |
|
|
|
} |
|
|
|
|
|
|
|
if ((*toast) && notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -862,13 +856,19 @@ BOOL InstallUpdatesIfAvailable( |
|
|
|
if (bOk || (!bOk && (dwOperation == UPDATES_OP_INSTALL))) |
|
|
|
if (bOk || (!bOk && (dwOperation == UPDATES_OP_INSTALL))) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (*toast) |
|
|
|
if (*toast) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
|
|
|
|
} |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast) = NULL; |
|
|
|
(*toast) = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (notifFactory) |
|
|
|
|
|
|
|
{ |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
if ((*toast)) |
|
|
|
} |
|
|
|
|
|
|
|
if ((*toast) && notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -901,13 +901,19 @@ BOOL InstallUpdatesIfAvailable( |
|
|
|
NULL |
|
|
|
NULL |
|
|
|
); |
|
|
|
); |
|
|
|
if (*toast) |
|
|
|
if (*toast) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
|
|
|
|
} |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast) = NULL; |
|
|
|
(*toast) = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (notifFactory) |
|
|
|
|
|
|
|
{ |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
if ((*toast)) |
|
|
|
} |
|
|
|
|
|
|
|
if ((*toast) && notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -963,13 +969,19 @@ BOOL InstallUpdatesIfAvailable( |
|
|
|
NULL |
|
|
|
NULL |
|
|
|
); |
|
|
|
); |
|
|
|
if (*toast) |
|
|
|
if (*toast) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
notifier->lpVtbl->Hide(notifier, *toast); |
|
|
|
|
|
|
|
} |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast)->lpVtbl->Release((*toast)); |
|
|
|
(*toast) = NULL; |
|
|
|
(*toast) = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (notifFactory) |
|
|
|
|
|
|
|
{ |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
notifFactory->lpVtbl->CreateToastNotification(notifFactory, inputXml, toast); |
|
|
|
if ((*toast)) |
|
|
|
} |
|
|
|
|
|
|
|
if ((*toast) && notifier) |
|
|
|
{ |
|
|
|
{ |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
notifier->lpVtbl->Show(notifier, *toast); |
|
|
|
} |
|
|
|
} |
|
|
|
|