Skip to content

Commit bcc1bca

Browse files
committed
Fixed automatic updates; improved setup
1 parent 140866e commit bcc1bca

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

ExplorerPatcher/updates.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime
7171
INTERNET_OPEN_TYPE_PRECONFIG,
7272
NULL,
7373
NULL,
74-
INTERNET_FLAG_ASYNC
74+
0 //INTERNET_FLAG_ASYNC
7575
))
7676
{
77-
InternetSetOptionA(hInternet, INTERNET_OPTION_CONNECT_TIMEOUT, &dwUpdateTimeout, sizeof(DWORD));
78-
if (InternetSetStatusCallbackA(hInternet, IsUpdateAvailableHelperCallback) != INTERNET_INVALID_STATUS_CALLBACK)
77+
//InternetSetOptionA(hInternet, INTERNET_OPTION_CONNECT_TIMEOUT, &dwUpdateTimeout, sizeof(DWORD));
78+
//if (InternetSetStatusCallbackA(hInternet, IsUpdateAvailableHelperCallback) != INTERNET_INVALID_STATUS_CALLBACK)
7979
{
8080
HINTERNET hConnect = InternetOpenUrlA(
8181
hInternet,
@@ -87,16 +87,17 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime
8787
INTERNET_FLAG_RESYNCHRONIZE |
8888
INTERNET_FLAG_NO_COOKIES |
8989
INTERNET_FLAG_NO_UI |
90-
INTERNET_FLAG_NO_CACHE_WRITE,
90+
INTERNET_FLAG_NO_CACHE_WRITE |
91+
INTERNET_FLAG_DONT_CACHE,
9192
&params
9293
);
93-
if (!hConnect && GetLastError() == ERROR_IO_PENDING)
94+
/*if (!hConnect && GetLastError() == ERROR_IO_PENDING)
9495
{
9596
if (WaitForSingleObject(params.hEvent, dwUpdateTimeout) == WAIT_OBJECT_0)
9697
{
9798
hConnect = params.hInternet;
9899
}
99-
}
100+
}*/
100101
if (hConnect)
101102
{
102103
if (szCheckAgainst)
@@ -122,14 +123,17 @@ BOOL IsUpdateAvailableHelper(char* url, char* szCheckAgainst, DWORD dwUpdateTime
122123
}
123124
else
124125
{
126+
#ifdef UPDATES_VERBOSE_OUTPUT
127+
printf("[Updates] Failed. Read %d bytes.\n");
128+
#endif
125129
if (lpFail) *lpFail = TRUE;
126130
}
127131
}
128132
else
129133
{
130134
WCHAR wszPath[MAX_PATH];
131135
ZeroMemory(wszPath, MAX_PATH * sizeof(WCHAR));
132-
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, wszPath);
136+
SHGetFolderPathW(NULL, SPECIAL_FOLDER_LEGACY, NULL, SHGFP_TYPE_CURRENT, wszPath);
133137
wcscat_s(wszPath, MAX_PATH, _T(APP_RELATIVE_PATH));
134138
BOOL bRet = CreateDirectoryW(wszPath, NULL);
135139
if (bRet || (!bRet && GetLastError() == ERROR_ALREADY_EXISTS))

ep_setup/ep_setup.c

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

0 commit comments

Comments
 (0)