Browse Source

Fixed automatic updates; improved setup

pull/400/head 22000.318.37.0_bcc1bca
Valentin Radu 4 years ago
parent
commit
bcc1bca3d0
  1. 18
      ExplorerPatcher/updates.c
  2. 11
      ep_setup/ep_setup.c

18
ExplorerPatcher/updates.c

@ -71,11 +71,11 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime @@ -71,11 +71,11 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime
INTERNET_OPEN_TYPE_PRECONFIG,
NULL,
NULL,
INTERNET_FLAG_ASYNC
0 //INTERNET_FLAG_ASYNC
))
{
InternetSetOptionA(hInternet, INTERNET_OPTION_CONNECT_TIMEOUT, &dwUpdateTimeout, sizeof(DWORD));
if (InternetSetStatusCallbackA(hInternet, IsUpdateAvailableHelperCallback) != INTERNET_INVALID_STATUS_CALLBACK)
//InternetSetOptionA(hInternet, INTERNET_OPTION_CONNECT_TIMEOUT, &dwUpdateTimeout, sizeof(DWORD));
//if (InternetSetStatusCallbackA(hInternet, IsUpdateAvailableHelperCallback) != INTERNET_INVALID_STATUS_CALLBACK)
{
HINTERNET hConnect = InternetOpenUrlA(
hInternet,
@ -87,16 +87,17 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime @@ -87,16 +87,17 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime
INTERNET_FLAG_RESYNCHRONIZE |
INTERNET_FLAG_NO_COOKIES |
INTERNET_FLAG_NO_UI |
INTERNET_FLAG_NO_CACHE_WRITE,
INTERNET_FLAG_NO_CACHE_WRITE |
INTERNET_FLAG_DONT_CACHE,
&params
);
if (!hConnect && GetLastError() == ERROR_IO_PENDING)
/*if (!hConnect && GetLastError() == ERROR_IO_PENDING)
{
if (WaitForSingleObject(params.hEvent, dwUpdateTimeout) == WAIT_OBJECT_0)
{
hConnect = params.hInternet;
}
}
}*/
if (hConnect)
{
if (szCheckAgainst)
@ -122,6 +123,9 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime @@ -122,6 +123,9 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime
}
else
{
#ifdef UPDATES_VERBOSE_OUTPUT
printf("[Updates] Failed. Read %d bytes.\n");
#endif
if (lpFail) *lpFail = TRUE;
}
}
@ -129,7 +133,7 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime @@ -129,7 +133,7 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime
{
WCHAR wszPath[MAX_PATH];
ZeroMemory(wszPath, MAX_PATH * sizeof(WCHAR));
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszPath);
SHGetFolderPathW(NULL, SPECIAL_FOLDER_LEGACY, NULL, SHGFP_TYPE_CURRENT, wszPath);
wcscat_s(wszPath, MAX_PATH, _T(APP_RELATIVE_PATH));
BOOL bRet = CreateDirectoryW(wszPath, NULL);
if (bRet || (!bRet && GetLastError() == ERROR_ALREADY_EXISTS))

11
ep_setup/ep_setup.c

@ -498,11 +498,18 @@ int WINAPI wWinMain( @@ -498,11 +498,18 @@ int WINAPI wWinMain(
//ZZRestartExplorer(0, 0, 0, 0);
}
}
if (!bOk && !(argc >= 1 && !_wcsicmp(wargv[0], L"/update_silent")))
if (!bOk) // && !(argc >= 1 && !_wcsicmp(wargv[0], L"/update_silent"))
{
MessageBoxW(
NULL,
L"An error has occured when attempting to service the product. Please reboot the computer and try again.",
L"An error has occured while servicing this product.\n"
L"Most likely, this is caused by one or more of the backup files still being in use (from"
L"a previous update). Unlocking the files will most likely fix this issue.\n\n"
L"Troubleshooting steps:\n"
L"* Close and reopen the \"Properties\" dialog, if you have it currently open.\n"
L"* Kill and restart all \"explorer.exe\" processes.\n"
L"* If you have registered this as shell extension, restarting the computer will probably fix this.\n"
L"* After everything else, reboot the computer and try again.",
_T(PRODUCT_NAME),
MB_ICONERROR | MB_OK | MB_DEFBUTTON1
);

Loading…
Cancel
Save