Different user message if update check failed.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1438 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
rainwater 2002-10-17 01:40:55 +00:00
parent 64c9fe013b
commit 8ed62444cb

View file

@ -518,6 +518,7 @@ DWORD CALLBACK UpdateThread(LPVOID v) {
char *response = (char *)GlobalAlloc(GPTR,RSZ); char *response = (char *)GlobalAlloc(GPTR,RSZ);
char *r; char *r;
char url[300]; char url[300];
BOOL error = FALSE;
static char pbuf[8192]; static char pbuf[8192];
char *p=NULL; char *p=NULL;
*response = 0; *response = 0;
@ -540,7 +541,7 @@ DWORD CALLBACK UpdateThread(LPVOID v) {
get->connect(url); get->connect(url);
while (1) { while (1) {
int st=get->run(); int st=get->run();
if (st<0) break; //error if (st<0) { error = TRUE; break; }//error
if (get->get_status()==2) { if (get->get_status()==2) {
while(len=get->bytes_available()) { while(len=get->bytes_available()) {
char b[RSZ]; char b[RSZ];
@ -559,7 +560,10 @@ DWORD CALLBACK UpdateThread(LPVOID v) {
if (*r=='\n') { *r = 0; break; } if (*r=='\n') { *r = 0; break; }
r++; r++;
} }
if (*response=='1'&&lstrlen(response)>2) { if (error) {
MessageBox(g_sdata.hwnd,"There was a problem checking for an update. Please try again later.","NSIS Update",MB_OK|MB_ICONINFORMATION);
}
else if (*response=='1'&&lstrlen(response)>2) {
char buf[200]; char buf[200];
response+=2; response+=2;
wsprintf(buf,"NSIS %s is now available. Would you like to download it now?",response); wsprintf(buf,"NSIS %s is now available. Would you like to download it now?",response);