Author: khornicek
Date: Fri Mar 20 11:12:00 2015
New Revision: 66836
URL:
http://svn.reactos.org/svn/reactos?rev=66836&view=rev
Log:
[RAPPS]
- check the HTTP status when downloading a package (trying to run XML files in NTVDM is
NOT funny)
- cleanup
Modified:
trunk/reactos/base/applications/rapps/lang/bg-BG.rc
trunk/reactos/base/applications/rapps/lang/cs-CZ.rc
trunk/reactos/base/applications/rapps/lang/de-DE.rc
trunk/reactos/base/applications/rapps/lang/en-US.rc
trunk/reactos/base/applications/rapps/lang/es-ES.rc
trunk/reactos/base/applications/rapps/lang/fr-FR.rc
trunk/reactos/base/applications/rapps/lang/he-IL.rc
trunk/reactos/base/applications/rapps/lang/it-IT.rc
trunk/reactos/base/applications/rapps/lang/ja-JP.rc
trunk/reactos/base/applications/rapps/lang/no-NO.rc
trunk/reactos/base/applications/rapps/lang/pl-PL.rc
trunk/reactos/base/applications/rapps/lang/pt-BR.rc
trunk/reactos/base/applications/rapps/lang/ro-RO.rc
trunk/reactos/base/applications/rapps/lang/ru-RU.rc
trunk/reactos/base/applications/rapps/lang/sk-SK.rc
trunk/reactos/base/applications/rapps/lang/sq-AL.rc
trunk/reactos/base/applications/rapps/lang/sv-SE.rc
trunk/reactos/base/applications/rapps/lang/tr-TR.rc
trunk/reactos/base/applications/rapps/lang/uk-UA.rc
trunk/reactos/base/applications/rapps/lang/zh-CN.rc
trunk/reactos/base/applications/rapps/lang/zh-TW.rc
trunk/reactos/base/applications/rapps/loaddlg.c
trunk/reactos/base/applications/rapps/resource.h
Modified: trunk/reactos/base/applications/rapps/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/bg-BG.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -199,5 +199,6 @@
IDS_CHOOSE_FOLDER_ERROR "Указали ÑÑе неÑÑÑеÑÑвÑваÑа
папка!"
IDS_APP_REG_REMOVE "УвеÑен ли ÑÑе, Ñе иÑкаÑе да
изÑÑиеÑе данниÑе за ÑложеноÑо пÑиложение оÑ
ÑегиÑÑÑÑа?"
IDS_INFORMATION "СведениÑ"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "ÐÑемаÑ
ванеÑо на данниÑе за пÑиложениеÑо Ð¾Ñ ÑегиÑÑÑÑа е
невÑзможно!"
END
Modified: trunk/reactos/base/applications/rapps/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/cs-CZ.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/cs-CZ.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -200,5 +200,6 @@
IDS_CHOOSE_FOLDER_ERROR "Zvolená složka neexistuje. VytvoÅit?"
IDS_APP_REG_REMOVE "UrÄitÄ odstranit data instalovaného programu z
registru?"
IDS_INFORMATION "Informace"
+ IDS_UNABLE_TO_DOWNLOAD "Soubor se nepodaÅilo stáhnout! Adresa
nenalezena!"
IDS_UNABLE_TO_REMOVE "NepodaÅilo se odstranit data programu z registru!"
END
Modified: trunk/reactos/base/applications/rapps/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -195,5 +195,6 @@
IDS_CHOOSE_FOLDER_ERROR "Sie haben ein nicht existierendes Verzeichnis
angegeben! Neu anlegen?"
IDS_APP_REG_REMOVE "Sind Sie sich sicher, dass Sie die Daten dieses Programms
aus der Registry entfernen möchten?"
IDS_INFORMATION "Informationen"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Konnte die Daten nicht aus der Registry löschen!"
END
Modified: trunk/reactos/base/applications/rapps/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -195,5 +195,6 @@
IDS_CHOOSE_FOLDER_ERROR "The folder you have specified does not exist. Create
it?"
IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -198,5 +198,6 @@
IDS_CHOOSE_FOLDER_ERROR "¡La carpeta especificada no existe!"
IDS_APP_REG_REMOVE "¿Está seguro de querer borrar del Registro los datos de
instalación del programa?"
IDS_INFORMATION "Información"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "¡No se pudieron borrar del Registro los datos de
instalación del programa!"
END
Modified: trunk/reactos/base/applications/rapps/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/fr-FR.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -195,5 +195,6 @@
IDS_CHOOSE_FOLDER_ERROR "Le dossier que vous avez spécifié n'existe pas.
Le créer ?"
IDS_APP_REG_REMOVE "Etes-vous sûr de vouloir supprimer les données du
programme installé du registre ?"
IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Impossible de supprimer les données du programme du
registre !"
END
Modified: trunk/reactos/base/applications/rapps/lang/he-IL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/he-IL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/he-IL.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -197,5 +197,6 @@
IDS_CHOOSE_FOLDER_ERROR "The folder you have specified does not exist. Create
it?"
IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
IDS_INFORMATION "××××¢"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/it-IT.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -195,5 +195,6 @@
IDS_CHOOSE_FOLDER_ERROR "La cartella indicata non esiste. Vuoi crearla?"
IDS_APP_REG_REMOVE "Sicuro di voler cancellare dal registry i dati sui programmi
installati?"
IDS_INFORMATION "Informazioni"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Impossibile cancellare i dati dal registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/ja-JP.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -195,5 +195,6 @@
IDS_CHOOSE_FOLDER_ERROR
"æå®ããããã©ã«ãã¯åå¨ãã¾ãã!"
IDS_APP_REG_REMOVE
"ã¬ã¸ã¹ããªããã¤ã³ã¹ãã¼ã«ãããããã°ã©ã ã«é¢ãããã¼ã¿ãåé¤ãã¦ãããããã§ãã?"
IDS_INFORMATION "æ
å ±"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE
"ã¬ã¸ã¹ããªãããã®ããã°ã©ã ã«é¢ãããã¼ã¿ãåé¤ã§ãã¾ãã!"
END
Modified: trunk/reactos/base/applications/rapps/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/no-NO.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -195,5 +195,6 @@
IDS_CHOOSE_FOLDER_ERROR "You have specified a nonexistent folder!"
IDS_APP_REG_REMOVE "Are you sure you want to delete the data on the installed
program from the registry?"
IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the
registry!"
END
Modified: trunk/reactos/base/applications/rapps/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -203,5 +203,6 @@
IDS_CHOOSE_FOLDER_ERROR "WybraÅeÅ nieistniejÄ
cy katalog! Czy chcesz utworzyÄ nowy?"
IDS_APP_REG_REMOVE "Czy na pewno chcesz usunÄ
Ä wpis tego programu z rejestru?"
IDS_INFORMATION "Informacja"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Nie można byÅo usunÄ
Ä wpisu z rejestru!"
END
Modified: trunk/reactos/base/applications/rapps/lang/pt-BR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/pt-BR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/pt-BR.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -197,5 +197,6 @@
IDS_CHOOSE_FOLDER_ERROR "A pasta especificada não existe. Deseja
criá-la?"
IDS_APP_REG_REMOVE "Você tem certeza que deseja apagar as informações do
programa instalado do registro?"
IDS_INFORMATION "Informações"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Não foi possÃvel remover as informações do programa do
registro!"
END
Modified: trunk/reactos/base/applications/rapps/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/ro-RO.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -201,5 +201,6 @@
IDS_CHOOSE_FOLDER_ERROR "Dosarul specificat nu existÄ. DoriÈi crearea
lui?"
IDS_APP_REG_REMOVE "Sigur doriÈi sÄ ÈtergeÈi datele din registru pentru
aceastÄ aplicaÈe?"
IDS_INFORMATION "InformaÈie"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Nu se pot elimina datele din registru pentru acest
program!"
END
Modified: trunk/reactos/base/applications/rapps/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/ru-RU.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -195,5 +195,6 @@
IDS_CHOOSE_FOLDER_ERROR "ÐÑ Ñказали неÑÑÑеÑÑвÑÑÑÑÑ
папкÑ!"
IDS_APP_REG_REMOVE "ÐÑ Ð´ÐµÐ¹ÑÑвиÑелÑно Ñ
оÑиÑе ÑдалиÑÑ Ð´Ð°Ð½Ð½Ñе об ÑÑÑановленной пÑогÑамме
из ÑееÑÑÑа?"
IDS_INFORMATION "ÐнÑоÑмаÑиÑ"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Ðе ÑдалоÑÑ ÑдалиÑÑ Ð´Ð°Ð½Ð½Ñе о
пÑогÑамме из ÑееÑÑÑа!"
END
Modified: trunk/reactos/base/applications/rapps/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/sk-SK.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -200,5 +200,6 @@
IDS_CHOOSE_FOLDER_ERROR "Zvolili ste si neexistujúci prieÄinok!"
IDS_APP_REG_REMOVE "Naozaj chcete vymazať údaje o nainštalovanom programe z
registrov?"
IDS_INFORMATION "Informácie"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Nie je možné odstrániť z registrov údaje o
programe!"
END
Modified: trunk/reactos/base/applications/rapps/lang/sq-AL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/sq-AL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/sq-AL.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -199,5 +199,6 @@
IDS_CHOOSE_FOLDER_ERROR "Dosja qe keni zgjedhur nuk ekziston. Krijoje?"
IDS_APP_REG_REMOVE "Jeni te sigurt qe do ti fshini informacionet e programit te
instaluar nga regjistri?"
IDS_INFORMATION "Informacione"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "E pamundur te fshihen informacionet e programit nga
regjistri!"
END
Modified: trunk/reactos/base/applications/rapps/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/sv-SE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/sv-SE.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -202,5 +202,6 @@
IDS_CHOOSE_FOLDER_ERROR "Du har specificrat en ej existerande mapp! Vill du
skapa den?"
IDS_APP_REG_REMOVE "Ãr du säker pÃ¥ att du vill ta bort data det installerade
programmets data från registret?"
IDS_INFORMATION "Information"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Det gick ej att ta bort programmets data från
registret!"
END
Modified: trunk/reactos/base/applications/rapps/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/tr-TR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/tr-TR.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -197,5 +197,6 @@
IDS_CHOOSE_FOLDER_ERROR "BelirttiÄiniz dizin yok. BelirttiÄiniz dizin
oluÅturulsun mu?"
IDS_APP_REG_REMOVE "Kurulan izlencenin giriÅini deÄer defterinden silmek
istediÄinizden emin misiniz?"
IDS_INFORMATION "Bilgi"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Ä°zlencenin giriÅi deÄer defterinden silinemiyor."
END
Modified: trunk/reactos/base/applications/rapps/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/uk-UA.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -203,5 +203,6 @@
IDS_CHOOSE_FOLDER_ERROR "Ðи вказали неÑÑнÑÑÑÑ ÑекÑ!"
IDS_APP_REG_REMOVE "Ðи дÑйÑно Ñ
оÑеÑе видалиÑи Ð´Ð°Ð½Ñ Ð¿Ñо вÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ñ Ð¿ÑогÑÐ°Ð¼Ñ Ð·
ÑеÑÑÑÑÑ?"
IDS_INFORMATION "ÐнÑоÑмаÑÑÑ"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "Ðе вдалоÑÑ Ð²Ð¸Ð´Ð°Ð»Ð¸Ñи Ð´Ð°Ð½Ñ Ð¿Ñо
пÑогÑÐ°Ð¼Ñ Ð· ÑеÑÑÑÑÑ!"
END
Modified: trunk/reactos/base/applications/rapps/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/zh-CN.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -197,5 +197,6 @@
IDS_CHOOSE_FOLDER_ERROR "æ¨éæ©çæ件夹ä¸åå¨ãå建åï¼"
IDS_APP_REG_REMOVE
"æ¨ç¡®å®è¦ä»æ³¨å表å é¤è¯¥ç¨åºçæ°æ®åï¼"
IDS_INFORMATION "ä¿¡æ¯"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "æ æ³ä»æ³¨å表å é¤è¯¥ç¨åºçæ°æ®ï¼"
END
Modified: trunk/reactos/base/applications/rapps/lang/zh-TW.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/zh-TW.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/zh-TW.rc [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -197,5 +197,6 @@
IDS_CHOOSE_FOLDER_ERROR "æ¨é¸æçè³æ夾ä¸åå¨ãåµå»ºåï¼"
IDS_APP_REG_REMOVE
"æ¨ç¢ºå®è¦å¾ç»éæªåªé¤è©²ç¨å¼çè³æåï¼"
IDS_INFORMATION "è³è¨"
+ IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not
found!"
IDS_UNABLE_TO_REMOVE "ç¡æ³å¾ç»éæªåªé¤è©²ç¨å¼çè³æï¼"
END
Modified: trunk/reactos/base/applications/rapps/loaddlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/lo…
==============================================================================
--- trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] Fri Mar 20 11:12:00 2015
@@ -191,7 +191,8 @@
IBindStatusCallbackImpl *This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(IBindStatusCallbackImpl));
- if (!This) return NULL;
+ if (!This)
+ return NULL;
This->vtbl = &dlVtbl;
This->ref = 1;
@@ -209,9 +210,9 @@
WCHAR path[MAX_PATH];
LPWSTR p;
HWND Dlg = (HWND) Context;
- DWORD len, dwContentLen, dwBytesWritten, dwBytesRead;
+ DWORD dwContentLen, dwBytesWritten, dwBytesRead, dwStatus;
DWORD dwCurrentBytesRead = 0;
- DWORD dwBufLen = sizeof(dwContentLen);
+ DWORD dwStatusLen = sizeof(dwStatus);
BOOL bCancelled = FALSE;
BOOL bTempfile = FALSE;
BOOL bCab = FALSE;
@@ -225,15 +226,11 @@
/* built the path for the download */
p = wcsrchr(AppInfo->szUrlDownload, L'/');
- if (!p) goto end;
-
- len = wcslen(AppInfo->szUrlDownload);
- if (len > 4)
- {
- if (AppInfo->szUrlDownload[len - 4] == '.' &&
- AppInfo->szUrlDownload[len - 3] == 'c' &&
- AppInfo->szUrlDownload[len - 2] == 'a' &&
- AppInfo->szUrlDownload[len - 1] == 'b')
+
+ if (!p)
+ goto end;
+
+ if (wcscmp(AppInfo->szUrlDownload, APPLICATION_DATABASE_URL) == 0)
{
bCab = TRUE;
if (!GetStorageDirectory(path, sizeof(path) / sizeof(path[0])))
@@ -241,14 +238,10 @@
}
else
{
- if (FAILED(StringCbCopyW(path, sizeof(path),
- SettingsInfo.szDownloadDir)))
- {
+ if (FAILED(StringCbCopyW(path, sizeof(path), SettingsInfo.szDownloadDir)))
goto end;
- }
}
- }
- else goto end;
+
if (GetFileAttributesW(path) == INVALID_FILE_ATTRIBUTES)
{
@@ -264,7 +257,9 @@
/* download it */
bTempfile = TRUE;
dl = CreateDl(Context, &bCancelled);
- if (dl == NULL) goto end;
+
+ if (dl == NULL)
+ goto end;
switch(SettingsInfo.Proxy)
{
@@ -281,26 +276,54 @@
hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL,
0);
break;
}
- if (!hOpen) goto end;
+
+ if (!hOpen)
+ goto end;
hFile = InternetOpenUrlW(hOpen, AppInfo->szUrlDownload, NULL, 0,
INTERNET_FLAG_PRAGMA_NOCACHE|INTERNET_FLAG_KEEP_CONNECTION, 0);
- if (!hFile) goto end;
+ if (!hFile)
+ goto end;
+
+ if (!HttpQueryInfoW(hFile, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER,
&dwStatus, &dwStatusLen, NULL))
+ goto end;
+
+ if(dwStatus != HTTP_STATUS_OK)
+ {
+ WCHAR szMsgText[MAX_STR_LEN];
+
+ if (!LoadStringW(hInst, IDS_UNABLE_TO_DOWNLOAD, szMsgText, sizeof(szMsgText) /
sizeof(WCHAR)))
+ goto end;
+
+ MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR);
+ goto end;
+ }
+
+ dwStatusLen = sizeof(dwStatus);
memset(&urlComponents, 0, sizeof(urlComponents));
urlComponents.dwStructSize = sizeof(urlComponents);
- if(FAILED(StringCbLengthW(AppInfo->szUrlDownload,
sizeof(AppInfo->szUrlDownload), &urlLength))) goto end;
+
+ if(FAILED(StringCbLengthW(AppInfo->szUrlDownload,
sizeof(AppInfo->szUrlDownload), &urlLength)))
+ goto end;
+
urlComponents.dwSchemeLength = urlLength*sizeof(WCHAR);
urlComponents.lpszScheme = malloc(urlComponents.dwSchemeLength);
- if(!InternetCrackUrlW(AppInfo->szUrlDownload, urlLength+1, ICU_DECODE |
ICU_ESCAPE, &urlComponents)) goto end;
+
+ if(!InternetCrackUrlW(AppInfo->szUrlDownload, urlLength+1, ICU_DECODE |
ICU_ESCAPE, &urlComponents))
+ goto end;
+
if(urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme ==
INTERNET_SCHEME_HTTPS)
- HttpQueryInfo(hFile, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER,
&dwContentLen, &dwBufLen, 0);
+ HttpQueryInfo(hFile, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER,
&dwContentLen, &dwStatus, 0);
+
if(urlComponents.nScheme == INTERNET_SCHEME_FTP)
- dwContentLen = FtpGetFileSize(hFile, &dwBufLen);
+ dwContentLen = FtpGetFileSize(hFile, &dwStatus);
+
free(urlComponents.lpszScheme);
hOut = CreateFileW(path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
CREATE_ALWAYS, 0, NULL);
- if (hOut == INVALID_HANDLE_VALUE) goto end;
-
+
+ if (hOut == INVALID_HANDLE_VALUE)
+ goto end;
do
{
@@ -314,21 +337,24 @@
CloseHandle(hOut);
hOut = INVALID_HANDLE_VALUE;
- if (bCancelled) goto end;
+ if (bCancelled)
+ goto end;
ShowWindow(Dlg, SW_HIDE);
/* run it */
if (!bCab)
- {
ShellExecuteW( NULL, L"open", path, NULL, NULL, SW_SHOWNORMAL );
- }
+
end:
- if (hOut != INVALID_HANDLE_VALUE) CloseHandle(hOut);
+ if (hOut != INVALID_HANDLE_VALUE)
+ CloseHandle(hOut);
+
InternetCloseHandle(hFile);
InternetCloseHandle(hOpen);
- if (dl) IBindStatusCallback_Release(dl);
+ if (dl)
+ IBindStatusCallback_Release(dl);
if (bTempfile)
{
Modified: trunk/reactos/base/applications/rapps/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/re…
==============================================================================
--- trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/resource.h [iso-8859-1] Fri Mar 20 11:12:00
2015
@@ -95,6 +95,7 @@
#define IDS_APP_REG_REMOVE 116
#define IDS_INFORMATION 117
#define IDS_UNABLE_TO_REMOVE 118
+#define IDS_UNABLE_TO_DOWNLOAD 119
/* Tooltips */
#define IDS_TOOLTIP_INSTALL 200