Index: base/applications/rapps/available.c =================================================================== --- base/applications/rapps/available.c (revision 69459) +++ base/applications/rapps/available.c (working copy) @@ -17,14 +17,18 @@ InsertRichEditText(b, d); \ } \ -#define GET_STRING1(a, b) \ +#define GET_REQUIRED_STRING(a, b) \ if (!ParserGetString(a, b, MAX_PATH, FindFileData.cFileName)) \ continue; -#define GET_STRING2(a, b) \ +#define GET_OPTIONAL_STRING(a, b) \ if (!ParserGetString(a, b, MAX_PATH, FindFileData.cFileName)) \ b[0] = '\0'; +#define GET_OPTIONAL_FMSIZE(a, b) \ + if (!StrFormatByteSizeW(ParserGetInt(a, FindFileData.cFileName), b, _countof(b))) \ + b[0] = '\0'; + LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead }; PLIST_ENTRY pCachedEntry = &CachedEntriesHead; @@ -37,15 +41,18 @@ if (!Info) return FALSE; NewRichEditText(Info->szName, CFE_BOLD); + InsertRichEditText(L" | ", 0); + InsertRichEditText(Info->szVersion, 0); InsertRichEditText(L"\n", 0); - ADD_TEXT(IDS_AINFO_VERSION, Info->szVersion, CFE_BOLD, 0); ADD_TEXT(IDS_AINFO_LICENSE, Info->szLicense, CFE_BOLD, 0); ADD_TEXT(IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0); ADD_TEXT(IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD, CFE_LINK); ADD_TEXT(IDS_AINFO_DESCRIPTION, Info->szDesc, CFE_BOLD, 0); + RichEditUnselect(); + return TRUE; } @@ -250,17 +257,17 @@ if (Info->szUrlDownload[0] == 0) { - GET_STRING1(L"Name", Info->szName); - GET_STRING1(L"URLDownload", Info->szUrlDownload); + GET_REQUIRED_STRING(L"Name", Info->szName); + GET_REQUIRED_STRING(L"URLDownload", Info->szUrlDownload); - GET_STRING2(L"RegName", Info->szRegName); - GET_STRING2(L"Version", Info->szVersion); - GET_STRING2(L"License", Info->szLicense); - GET_STRING2(L"Description", Info->szDesc); - GET_STRING2(L"Size", Info->szSize); - GET_STRING2(L"URLSite", Info->szUrlSite); - GET_STRING2(L"CDPath", Info->szCDPath); - GET_STRING2(L"SHA1", Info->szSHA1); + GET_OPTIONAL_STRING(L"RegName", Info->szRegName); + GET_OPTIONAL_STRING(L"Version", Info->szVersion); + GET_OPTIONAL_STRING(L"License", Info->szLicense); + GET_OPTIONAL_STRING(L"Description", Info->szDesc); + GET_OPTIONAL_STRING(L"URLSite", Info->szUrlSite); + GET_OPTIONAL_STRING(L"CDPath", Info->szCDPath); + GET_OPTIONAL_STRING(L"SHA1", Info->szSHA1); + GET_OPTIONAL_FMSIZE(L"Size", Info->szSize); } if (!lpEnumProc(Info)) Index: base/applications/rapps/installed.c =================================================================== --- base/applications/rapps/installed.c (revision 69458) +++ base/applications/rapps/installed.c (working copy) @@ -104,7 +104,7 @@ ItemIndex = Index; } - ListView_GetItemText(hListView, ItemIndex, 0, szAppName, sizeof(szAppName) / sizeof(WCHAR)); + ListView_GetItemText(hListView, ItemIndex, 0, szAppName, _countof(szAppName)); WriteLogMessage(EVENTLOG_SUCCESS, MSG_SUCCESS_REMOVE, szAppName); ZeroMemory(&Item, sizeof(LVITEM)); @@ -149,7 +149,7 @@ #define GET_INFO(a, b, c, d) \ if (GetApplicationString(Info->hSubKey, a, szInfo)) \ { \ - LoadStringW(hInst, b, szText, sizeof(szText) / sizeof(WCHAR)); \ + LoadStringW(hInst, b, szText, _countof(szText)); \ InsertRichEditText(szText, c); \ InsertRichEditText(szInfo, d); \ } \ @@ -172,6 +172,8 @@ GET_INFO(L"InstallSource", IDS_INFO_INSTALLSRC, CFE_BOLD, 0); GET_INFO(L"ModifyPath", IDS_INFO_MODIFYPATH, CFE_BOLD, 0); + RichEditUnselect(); + return TRUE; } @@ -190,8 +192,8 @@ Info = ListViewGetlParam(Index); if (!Info || !Info->hSubKey || (ItemIndex == -1)) return; - if (!LoadStringW(hInst, IDS_APP_REG_REMOVE, szMsgText, sizeof(szMsgText) / sizeof(WCHAR)) || - !LoadStringW(hInst, IDS_INFORMATION, szMsgTitle, sizeof(szMsgTitle) / sizeof(WCHAR))) + if (!LoadStringW(hInst, IDS_APP_REG_REMOVE, szMsgText, _countof(szMsgText)) || + !LoadStringW(hInst, IDS_INFORMATION, szMsgTitle, _countof(szMsgTitle))) return; if (MessageBoxW(hMainWnd, szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES) @@ -204,7 +206,7 @@ return; } - if (!LoadStringW(hInst, IDS_UNABLE_TO_REMOVE, szMsgText, sizeof(szMsgText) / sizeof(WCHAR))) + if (!LoadStringW(hInst, IDS_UNABLE_TO_REMOVE, szMsgText, _countof(szMsgText))) return; MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR); Index: base/applications/rapps/lang/en-US.rc =================================================================== --- base/applications/rapps/lang/en-US.rc (revision 69459) +++ base/applications/rapps/lang/en-US.rc (working copy) @@ -197,7 +197,7 @@ 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!" - IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." + IDS_CERT_DOES_NOT_MATCH "While establishing a secure connection the remote server answered with a suspect TLS certificate. This does not look like the official ReactOS download server." IDS_INTEG_CHECK_TITLE "Verifying package integrity..." IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." END Index: base/applications/rapps/lang/es-ES.rc =================================================================== --- base/applications/rapps/lang/es-ES.rc (revision 69459) +++ base/applications/rapps/lang/es-ES.rc (working copy) @@ -200,7 +200,7 @@ IDS_INFORMATION "Información" IDS_UNABLE_TO_DOWNLOAD "No se pudo descargar el paquete. No se ha encontrado la dirección de Internet." IDS_UNABLE_TO_REMOVE "No se pudieron borrar del Registro los datos de instalación del programa." - IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." + IDS_CERT_DOES_NOT_MATCH "El certificado TLS de conexión segura no coincide con el utilizado en el servidor oficial de ReactOS." IDS_INTEG_CHECK_TITLE "Verificando integridad del paquete..." IDS_INTEG_CHECK_FAIL "El paquete no ha pasado la comprobación de integridad, puede haber sido alterado o estar corrupto. No se recomienda ejecutarlo." END Index: base/applications/rapps/loaddlg.c =================================================================== --- base/applications/rapps/loaddlg.c (revision 69459) +++ base/applications/rapps/loaddlg.c (working copy) @@ -291,6 +291,18 @@ } #endif +void MessageBoxWithLastError(HWND ParentWindow) +{ + /* oops, this looks like a serious problem, let's retrieve its + error number and show it in string-form to the user */ + PWSTR allocatedMessage = NULL; + + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, GetLastError(), 0, (LPTSTR)&allocatedMessage, 0, NULL); + MessageBoxW(ParentWindow, allocatedMessage, NULL, MB_OK | MB_ICONERROR); + HeapFree(GetProcessHeap(), 0, allocatedMessage); +} + static DWORD WINAPI ThreadFunc(LPVOID Context) @@ -313,9 +325,15 @@ URL_COMPONENTS urlComponents; size_t urlLength, filenameLength; + /* decode the URL so that the file system name appears correctly */ + WCHAR szDecodedUrlDownload[MAX_PATH]; + + dwContentLen = _countof(szDecodedUrlDownload); + InternetCanonicalizeUrl(AppInfo->szUrlDownload, (LPWSTR)&szDecodedUrlDownload, &dwContentLen, ICU_DECODE | ICU_NO_ENCODE); + /* build the path for the download */ - p = wcsrchr(AppInfo->szUrlDownload, L'/'); - q = wcsrchr(AppInfo->szUrlDownload, L'?'); + p = wcsrchr(szDecodedUrlDownload, L'/'); + q = wcsrchr(szDecodedUrlDownload, L'?'); /* do we have a final slash separator? */ if (!p) @@ -388,11 +406,17 @@ } if (!hOpen) + { + MessageBoxWithLastError(Dlg); goto end; + } hFile = InternetOpenUrlW(hOpen, AppInfo->szUrlDownload, NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_KEEP_CONNECTION, 0); if (!hFile) + { + MessageBoxWithLastError(Dlg); goto end; + } if (!HttpQueryInfoW(hFile, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwStatus, &dwStatusLen, NULL)) goto end; @@ -401,10 +425,10 @@ { WCHAR szMsgText[MAX_STR_LEN]; - if (!LoadStringW(hInst, IDS_UNABLE_TO_DOWNLOAD, szMsgText, sizeof(szMsgText) / sizeof(WCHAR))) + if (!LoadStringW(hInst, IDS_UNABLE_TO_DOWNLOAD, szMsgText, _countof(szMsgText))) goto end; - MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR); + MessageBoxW(Dlg, szMsgText, NULL, MB_OK | MB_ICONERROR); goto end; } @@ -439,7 +463,7 @@ { WCHAR szMsgText[MAX_STR_LEN]; - if (!LoadStringW(hInst, IDS_CERT_DOES_NOT_MATCH, szMsgText, sizeof(szMsgText) / sizeof(WCHAR))) + if (!LoadStringW(hInst, IDS_CERT_DOES_NOT_MATCH, szMsgText, _countof(szMsgText))) goto end; MessageBoxW(Dlg, szMsgText, NULL, MB_OK | MB_ICONERROR); @@ -455,10 +479,19 @@ if (hOut == INVALID_HANDLE_VALUE) goto end; + /* download the package by looping and print its + progress unless we've hiccups or the user cancels */ do { - if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead)) goto end; - if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL)) goto end; + if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead) || + !WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL)) + { + /* oops, this looks like a serious problem, let's retrieve its + error number and show it in string-form to the user */ + MessageBoxWithLastError(Dlg); + goto end; + } + dwCurrentBytesRead += dwBytesRead; IBindStatusCallback_OnProgress(dl, dwCurrentBytesRead, dwContentLen, 0, AppInfo->szUrlDownload); } @@ -668,8 +701,10 @@ return FALSE; AppInfo = (PAPPLICATION_INFO) ListViewGetlParam(Index); - if (!AppInfo) return FALSE; + if (!AppInfo) + return FALSE; + WriteLogMessage(EVENTLOG_SUCCESS, MSG_SUCCESS_INSTALL, AppInfo->szName); DialogBoxW(hInst, Index: base/applications/rapps/misc.c =================================================================== --- base/applications/rapps/misc.c (revision 69459) +++ base/applications/rapps/misc.c (working copy) @@ -143,14 +143,16 @@ { WCHAR szText[MAX_STR_LEN*3]; - LoadStringW(hInst, IDS_WELCOME_TITLE, szText, sizeof(szText) / sizeof(WCHAR)); + LoadStringW(hInst, IDS_WELCOME_TITLE, szText, _countof(szText)); NewRichEditText(szText, CFE_BOLD); - LoadStringW(hInst, IDS_WELCOME_TEXT, szText, sizeof(szText) / sizeof(WCHAR)); + LoadStringW(hInst, IDS_WELCOME_TEXT, szText, _countof(szText)); InsertRichEditText(szText, 0); - LoadStringW(hInst, IDS_WELCOME_URL, szText, sizeof(szText) / sizeof(WCHAR)); + LoadStringW(hInst, IDS_WELCOME_URL, szText, _countof(szText)); InsertRichEditText(szText, CFM_LINK); + + RichEditUnselect(); } VOID Index: base/applications/rapps/rapps.h =================================================================== --- base/applications/rapps/rapps.h (revision 69459) +++ base/applications/rapps/rapps.h (working copy) @@ -192,6 +192,7 @@ VOID RichEditOnLink(HWND hwnd, ENLINK *Link); VOID InsertRichEditText(LPCWSTR lpszText, DWORD dwEffects); VOID NewRichEditText(LPCWSTR lpszText, DWORD dwEffects); +VOID RichEditUnselect(VOID); /* settingsdlg.c */ VOID CreateSettingsDlg(HWND hwnd); Index: base/applications/rapps/resource.h =================================================================== --- base/applications/rapps/resource.h (revision 69459) +++ base/applications/rapps/resource.h (working copy) @@ -132,7 +132,7 @@ #define IDS_INFO_MODIFYPATH 295 #define IDS_INFO_INSTALLDATE 296 -/* Info for availabled apps */ +/* Info for available apps */ #define IDS_AINFO_VERSION 350 #define IDS_AINFO_DESCRIPTION 351 #define IDS_AINFO_SIZE 352 Index: base/applications/rapps/richedit.c =================================================================== --- base/applications/rapps/richedit.c (revision 69458) +++ base/applications/rapps/richedit.c (working copy) @@ -60,6 +60,12 @@ SendMessageW(hRichEdit, EM_SETSEL, End, End + 1); } +VOID +RichEditUnselect(VOID) +{ + SendMessageW(hRichEdit, EM_SETSEL, -1, -1); +} + static LONG GetRichEditTextLen(VOID) { @@ -115,7 +121,7 @@ NULL, WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_LEFT | ES_READONLY, - 205, 28, 465, 100, + 205, 28, 465, 105, hwnd, NULL, hInst, Index: base/applications/rapps/winmain.c =================================================================== --- base/applications/rapps/winmain.c (revision 69458) +++ base/applications/rapps/winmain.c (working copy) @@ -918,10 +918,10 @@ hMutex = CreateMutexW(NULL, FALSE, szWindowClass); if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS)) { - /* If already started, it is found its window */ + /* If already started, find its window... */ HWND hWindow = FindWindowW(szWindowClass, NULL); - /* Activate window */ + /* ...activate that window and close this instance */ ShowWindow(hWindow, SW_SHOWNORMAL); SetForegroundWindow(hWindow); return 1; @@ -963,7 +963,8 @@ hInstance, NULL); - if (!hMainWnd) goto Exit; + if (!hMainWnd) + goto Exit; /* Maximize it if we must */ ShowWindow(hMainWnd, (SettingsInfo.bSaveWndPos && SettingsInfo.Maximized ? SW_MAXIMIZE : nShowCmd)); @@ -975,7 +976,7 @@ /* Load the menu hotkeys */ KeyBrd = LoadAccelerators(NULL, MAKEINTRESOURCE(HOTKEYS)); - /* Message Loop */ + /* Message loop */ while (GetMessage(&Msg, NULL, 0, 0)) { if (!TranslateAccelerator(hMainWnd, KeyBrd, &Msg)) Index: media/rapps/7zip.txt =================================================================== --- media/rapps/7zip.txt (revision 69459) +++ media/rapps/7zip.txt (working copy) @@ -7,11 +7,11 @@ Version = 15.05b License = LGPL Description = A file archiving utility with support for 7zip, zip, tar, rar and many other archive formats. -Size = 1.14 MB Category = 12 URLSite = http://www.7-zip.org/ URLDownload = http://www.7-zip.org/a/7z1505.exe SHA1 = ece8bbd4c8903095d44e99196219c953a1d47bfd +Size = 1062749 CDPath = none [Section.0407] @@ -22,7 +22,6 @@ [Section.040c] Description = Utilitaire pour créer et ouvrir les fichiers 7zip, zip, tar, rar et d'autres archives. -Size = 1,14 Mo [Section.0410] Description = Utilità per creare e aprire 7zip, zip, tar, rar e altri file archivio. @@ -35,7 +34,6 @@ [Section.0418] Description = Utilitar de arhivare a fișierelor, compatibil cu 7zip, zip, tar, rar și multe alte formate de arhive. -Size = 1,14 Mo [Section.0419] Description = Утилита для создания и открытия 7zip, zip, tar, rar и других архивных файлов. @@ -42,7 +40,6 @@ [Section.041f] Description = 7zip, zip, tar, rar ve başka birçok belgelik biçimi destekli bir kütük belgelikleme aracı. -Size = 1,14 MB [Section.0422] Description = Утиліта для створення та відкриття 7zip, zip, tar, rar та інших архівних файлів. Index: media/rapps/ccleaner.txt =================================================================== --- media/rapps/ccleaner.txt (revision 69459) +++ media/rapps/ccleaner.txt (working copy) @@ -2,31 +2,32 @@ ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) ; Simplified Chinese translation by Henry Tang Ih (henrytang5247) (henrytang2@hotmail.com) - [Section] Name = CCleaner Version = 5.08 License = Freeware -Description = Very good tool for cleaning your PC. -Size = 6.25 MB +Description = A decent tool for cleaning temporary files and general computer maintenance. Category = 12 URLSite = http://www.piriform.com/ccleaner URLDownload = http://download.piriform.com/ccsetup508.exe SHA1 = aa7affcbdaf13c3872f32eaccf3befb92fd0fa80 +Size = 6609608 CDPath = none [Section.0407] Description = Sehr gutes Bereinigungswerkzeug für den PC. +[Section.0a] +License = Gratuita +Description = Una herramienta de limpieza y mantenimiento con la que borrar archivos temporales. + [Section.041f] License = Ücretsiz Description = PC'nizi temizleme için çok iyi araç. -Size = 6,25 MB [Section.0418] License = Gratuită Description = Utilitar pentru mentenanța ordinii în configurația sistemului. -Size = 6,25 Mo [Section.0804] Description = 非常好的工具,清理您的电脑。 Index: media/rapps/dosbox.txt =================================================================== --- media/rapps/dosbox.txt (revision 69459) +++ media/rapps/dosbox.txt (working copy) @@ -7,11 +7,11 @@ Version = 0.74 License = GPL Description = An open-source DOS emulator. -Size = 1.38 MB Category = 15 URLSite = http://www.dosbox.com/ URLDownload = http://download.sourceforge.net/project/dosbox/dosbox/0.74/DOSBox0.74-win32-installer.exe SHA1 = b4d671ed3fc1fc36aaf8abc1341d2ddaaafa8f88 +Size = 1448809 CDPath = none [Section.0407] @@ -22,7 +22,6 @@ [Section.040c] Description = DOSBox est un émulateur DOS. -Size = 1,38 Mo [Section.0410] Description = DOSBox è un emulatore DOS. @@ -32,11 +31,9 @@ [Section.0418] Description = Emulator DOS, cu surse deschise. -Size = 1,38 Mo [Section.041f] Description = DOSBox bir DOS öykünücüsüdür. -Size = 1,38 MB [Section.0422] Description = DOSBox - емулятор DOSу. Index: media/rapps/firefox28.txt =================================================================== --- media/rapps/firefox28.txt (revision 69459) +++ media/rapps/firefox28.txt (working copy) @@ -7,11 +7,11 @@ Version = 28.0 License = MPL/GPL/LGPL Description = A popular Web browser. Free and open source, made by a global community. -Size = 24.03 MB Category = 5 URLSite = http://www.mozilla.org/en-US/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/en-US/Firefox%20Setup%2028.0.exe SHA1 = 0154f7a38acad5c186c000533f992830e509abee +Size = 25200168 CDPath = none [Section.0405] @@ -28,9 +28,10 @@ [Section.0a] Description = Navegador web popular, libre y gratuito. -Size = 23.82 MB URLSite = http://www.mozilla.org/es-ES/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/es-ES/Firefox%20Setup%2028.0.exe +SHA1 = 1c309423345543b9962e34d9092858fd12a4c099 +Size = 24976024 [Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. Index: media/rapps/inkscape.txt =================================================================== --- media/rapps/inkscape.txt (revision 69459) +++ media/rapps/inkscape.txt (working copy) @@ -8,11 +8,11 @@ Version = 0.91 License = GPL Description = A vector graphics editor licensed under the GNU General Public License. -Size = 41.31 MB Category = 3 URLSite = http://www.inkscape.org/ URLDownload = https://inkscape.global.ssl.fastly.net/media/resources/file/Inkscape-0.91-1.exe SHA1 = aac506f8a71c943d89a27a38970733a8bc6f9b32 +Size = 43314243 CDPath = none [Section.0407] @@ -20,7 +20,6 @@ [Section.0418] Description = Editor de grafică vectorială oferit sub Licența Publică Generală GNU. -Size = 41,31 Mo [Section.0a] Description = Un editor de gráficos vectoriales bajo la licencia GNU GPL. @@ -27,7 +26,6 @@ [Section.041f] Description = Inkscape, GNU Umûmî Kamu Ruhsatı altında ruhsatlanmış bir yöney çizge düzenleyicisidir. -Size = 41,31 MB [Section.0804] Description = GNU 通用公共许可证授权的矢量图形编辑器。