summaryrefslogtreecommitdiff
path: root/indra/win_updater
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-12-05 23:43:56 +0000
committerDon Kjer <don@lindenlab.com>2007-12-05 23:43:56 +0000
commitfacf67ae3226105910c983a8fa8760414bf703e9 (patch)
treeb5f7cd6b79a79f769080a65b6fe2cb6b97c8b6fb /indra/win_updater
parent45057e8881c3166c7c0ef545c02bc177922af6fb (diff)
EFFECTIVE MERGE: svn merge -r 71520:73420 svn+ssh://svn/svn/linden/branches/maintenance-3 into release
ACTUAL MERGE: svn merge -r 75074:75114 svn+ssh://svn/svn/linden/qa/maintenance-3-merge-75067 into release
Diffstat (limited to 'indra/win_updater')
-rw-r--r--indra/win_updater/updater.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/win_updater/updater.cpp b/indra/win_updater/updater.cpp
index e25383bfef..f849e4e9ad 100644
--- a/indra/win_updater/updater.cpp
+++ b/indra/win_updater/updater.cpp
@@ -41,6 +41,7 @@
#define BUFSIZE 8192
int gTotalBytesRead = 0;
+DWORD gTotalBytes = -1;
HWND gWindow = NULL;
WCHAR gProgress[256];
char* gUpdateURL;
@@ -129,6 +130,9 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
return success;
}
+ DWORD sizeof_total_bytes = sizeof(gTotalBytes);
+ HttpQueryInfo(hdownload, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &gTotalBytes, &sizeof_total_bytes, NULL);
+
DWORD total_bytes = 0;
success = InternetQueryDataAvailable(hdownload, &total_bytes, 0, 0);
if (success == FALSE)
@@ -187,7 +191,11 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
gTotalBytesRead += int(bytes_read);
- wsprintf(gProgress, L"Downloaded: %dK", gTotalBytesRead / 1024);
+ if (gTotalBytes != -1)
+ wsprintf(gProgress, L"Downloaded: %d%%", 100 * gTotalBytesRead / gTotalBytes);
+ else
+ wsprintf(gProgress, L"Downloaded: %dK", gTotalBytesRead / 1024);
+
}
#if _DEBUG