https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=069cfbb46fec0e5f54c0d009e3e3dc0870187dab commit 069cfbb46fec0e5f54c0d009e3e3dc0870187dab Author: Jon Turney Date: Thu Apr 15 20:12:27 2021 +0100 Add an option to set the GUI language Add an option to set the GUI language, primarily for testing purposes. We need to call SetThreadUILanguage() not only in the main thread, but in every thread which might access localized resources (directly or indirectly). https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=ce5242d37f70038a0c297e3147cbc1239f584520 commit ce5242d37f70038a0c297e3147cbc1239f584520 Author: Jon Turney Date: Fri May 7 19:17:01 2021 +0100 Add french res.rc Add french res.rc, with dialog, message box, progress and actions string translations from Eric Laussage, converted to utf8 encoding. v2: Update with translations for dynamically modified text in IDD_DESKTOP and IDD_CHOOSE DIALOG resource v3: Add mbox caption, more mbox strings MB_RETRYCONTINUE button label https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=5e9eb131fa18006c5e6dde543b7391b178d5c2ba commit 5e9eb131fa18006c5e6dde543b7391b178d5c2ba Author: Jon Turney Date: Thu Apr 15 20:40:51 2021 +0100 Use UTF8 encoding in .rc file Use UTF8 encoding in resources .rc file (rather than defaulting to Windows codepage 1252) https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=01878bdfb73408fa8820b4a9b56bb3d97b15ddea commit 01878bdfb73408fa8820b4a9b56bb3d97b15ddea Author: Jon Turney Date: Thu Nov 25 19:22:06 2021 +0000 Move some non-localizable string from resources https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=83119c974aa9033f454d94dd9165675a14b4842a commit 83119c974aa9033f454d94dd9165675a14b4842a Author: Jon Turney Date: Thu Nov 25 17:38:22 2021 +0000 Push MB_RETRYCONTINUE MessageBox customization into mbox wrapper Push the MB_RETRYCONTINUE MessageBox customization into the mbox wrapper, and use it for a generic error during file extraction. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=17d647470cea03ba6461fdaf4bbb640a2a3a446d commit 17d647470cea03ba6461fdaf4bbb640a2a3a446d Author: Jon Turney Date: Mon May 10 23:15:30 2021 +0100 Use generic formatting mbox wrapper Use generic formatting mbox wrapper for some: - message boxes whose contents are currently hand-made using a format string. - message boxes whose contents can be put into a string resource. This also makes the various captions used by these messageboxes consistent. Future work: Aim to phase out remaining uses of the existing mbox() wrapper: - via note(), fatal(), yesno() - where we a need to use a fully dynamic string (e.g. from ini parser) https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=dd0631fae8422ca53f86c4ddf652ee8526141fd9 commit dd0631fae8422ca53f86c4ddf652ee8526141fd9 Author: Jon Turney Date: Mon May 10 22:35:32 2021 +0100 Add a more generic mbox wrapper This mbox wrapper understands loading format strings from string resources and unattended mode. Factor out the unattended_result logic from the existing mbox wrapper, so it can be shared with that. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=6d0bac5d1ae7941768d80769b1b544e6bf9649e4 commit 6d0bac5d1ae7941768d80769b1b544e6bf9649e4 Author: Jon Turney Date: Fri Nov 12 14:37:33 2021 +0000 Drop message box for invalid --arch option Make this consistent with all other cases of an invalid option, where the error is just reported to stdout. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=16007bd3915c50038138af48e9c2192e5128b60a commit 16007bd3915c50038138af48e9c2192e5128b60a Author: Jon Turney Date: Thu Nov 11 22:17:12 2021 +0000 Fix uses of MessageBox() which could be problematic in unattended mode Direct uses of MessageBox should be avoided, as they need special attention to check that they are avoided in unattended mode (as they could cause setup to stop and wait for user interaction). Fix a few remaining uses that aren't guarded by checks of unattended_mode, by using mbox() instead. (These are new or slightly non-trivial uses which didn't get changed in a123de66). https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=7a2a67882f28a11e7a1797c69e8255ef494b99c5 commit 7a2a67882f28a11e7a1797c69e8255ef494b99c5 Author: Jon Turney Date: Mon May 10 21:43:26 2021 +0100 Review uses of MessageBox() Use a consistent caption "Cygwin Setup" (for consistency with mbox()). Also drop pointless CANCEL logic and clean up handling of IGNORE for ABORTRETRYINGORE mbox when local package directory can't be accessed. Also remove the CANCEL button from the MessageBox displayed for a 'message:' hint, which quits setup, with no indication that's what it's going to do. Also drop some commented out code for a modeless propsheet https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=20f95aca2fba145a190425426a779d179a3612f4 commit 20f95aca2fba145a190425426a779d179a3612f4 Author: Jon Turney Date: Mon May 10 20:50:55 2021 +0100 Remove one version of fatal() This is only used in two places, which are "this can't happen" situations, where it doesn't actually make much sense to exit setup. Diff: --- Makefile.am | 6 +- String++.cc | 34 +++ String++.h | 4 + desktop.cc | 4 +- dialog.cc | 14 -- dialog.h | 5 - download.cc | 2 + ini.cc | 2 + install.cc | 86 ++------ localdir.cc | 52 ++--- main.cc | 21 +- mount.cc | 4 +- msg.cc | 120 ++++++++--- msg.h | 5 + nio-ie5.cc | 2 +- package_message.h | 13 +- postinstall.cc | 3 +- prereq.cc | 10 +- propsheet.cc | 19 +- res.rc | 57 ++++- res/fr/res.rc | 605 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ resource.h | 15 +- root.cc | 14 +- site.cc | 15 +- splash.cc | 7 +- state.cc | 2 + state.h | 4 + threebar.cc | 2 +- 28 files changed, 905 insertions(+), 222 deletions(-) diff --git a/Makefile.am b/Makefile.am index 63e96dae..3d032d68 100644 --- a/Makefile.am +++ b/Makefile.am @@ -274,11 +274,11 @@ setup_version.c : Makefile echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp && \ mv version.tmp setup_version.c -# setup.exe.manifest is included in res.rc -res.o: setup.exe.manifest +# files included by res.rc +res.o: setup.exe.manifest res/fr/res.rc .rc.o: - $(AM_V_GEN)$(WINDRES) --include-dir $(srcdir) -o $@ $< + $(AM_V_GEN)$(WINDRES) --codepage 65001 --include-dir $(srcdir) -o $@ $< setup-src: @ver=setup-$(VER);\ diff --git a/String++.cc b/String++.cc index 0f88c61d..0984c166 100644 --- a/String++.cc +++ b/String++.cc @@ -114,3 +114,37 @@ std::wstring string_to_wstring(const std::string &s) return w; } + +// convert a UTF-16 wstring to a UTF-8 string +std::string wstring_to_string(const std::wstring &w) +{ + int n = WideCharToMultiByte(CP_UTF8, 0, w.c_str(), -1, NULL, 0, NULL, NULL); + + if (n <= 0) + return "conversion failed"; + + char *buf = new char[n+1]; + WideCharToMultiByte(CP_UTF8, 0, w.c_str(), -1, buf, n, NULL, NULL); + + std::string s(buf); + delete[] buf; + + return s; +} + +std::wstring +vformat(const std::wstring &fmt, va_list ap) +{ + va_list apc; + va_copy(apc, ap); + + int n = vsnwprintf(NULL, 0, fmt.c_str(), ap); + + std::wstring str; + str.resize(n+1); + vsnwprintf(&str[0], n+1, fmt.c_str(), apc); + + va_end(apc); + + return str; +} diff --git a/String++.h b/String++.h index 3d977e9e..0851f4e8 100644 --- a/String++.h +++ b/String++.h @@ -43,5 +43,9 @@ inline std::string operator+ (const char *a, const std::string& b) { return std::string(a) + b; } std::wstring string_to_wstring(const std::string &s); +std::string wstring_to_string(const std::wstring &w); + +// produce a std::string using formatting like sprintf +std::wstring vformat(const std::wstring &fmt, va_list ap); #endif /* SETUP_STRING___H */ diff --git a/desktop.cc b/desktop.cc index 465e8f9f..4f692b8a 100644 --- a/desktop.cc +++ b/desktop.cc @@ -172,8 +172,10 @@ save_icon (std::string &iconpath, const char *resource_name) HRSRC rsrc = FindResource (NULL, resource_name, "FILE"); if (rsrc == NULL) { - fatal ("FindResource failed"); + Log (LOG_PLAIN) << "FindResource failed" << GetLastError() << endLog; + return; } + HGLOBAL res = LoadResource (NULL, rsrc); char *data = (char *) LockResource (res); int len = SizeofResource (NULL, rsrc); diff --git a/dialog.cc b/dialog.cc index 6e673d39..dd12fc44 100644 --- a/dialog.cc +++ b/dialog.cc @@ -20,7 +20,6 @@ #include #include #include "dialog.h" -#include "msg.h" #include "LogFile.h" #include "mount.h" @@ -95,16 +94,3 @@ rbset (HWND h, int *ids, int id) for (i = 0; ids[i]; i++) CheckDlgButton (h, ids[i], id == ids[i] ? BST_CHECKED : BST_UNCHECKED); } - -void -fatal (const char *msg, DWORD err) -{ - DWORD e = (err != ERROR_SUCCESS) ? err : GetLastError(); - char *buf; - FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - 0, e, 0, (CHAR *) & buf, 0, 0); - mbox (0, buf, msg, MB_OK); - Logger ().exit (1); - // Keep gcc happy - some sort of bug! - exit (1); -} diff --git a/dialog.h b/dialog.h index da81384a..47212e3e 100644 --- a/dialog.h +++ b/dialog.h @@ -67,9 +67,4 @@ void eset (HWND h, int id, int var); int rbget (HWND h, int *ids); void rbset (HWND h, int *ids, int id); -/* *This* version of fatal (compare with msg.h) uses GetLastError() to - format a suitable error message. Similar to perror() */ - -void fatal (const char *msg, DWORD err = ERROR_SUCCESS) __attribute__ ((noreturn)); - #endif /* SETUP_DIALOG_H */ diff --git a/download.cc b/download.cc index 3c3df7ec..fd1253b9 100644 --- a/download.cc +++ b/download.cc @@ -382,6 +382,8 @@ do_download_reflector (void *p) HANDLE *context; context = (HANDLE *) p; + SetThreadUILanguage(langid); + try { int next_dialog = diff --git a/ini.cc b/ini.cc index 54128342..99b2ac63 100644 --- a/ini.cc +++ b/ini.cc @@ -437,6 +437,8 @@ do_ini_thread_reflector (void* p) HANDLE *context; context = (HANDLE*)p; + SetThreadUILanguage(langid); + try { bool succeeded = do_ini_thread ((HINSTANCE)context[0], (HWND)context[1]); diff --git a/install.cc b/install.cc index de98b999..9bb08203 100644 --- a/install.cc +++ b/install.cc @@ -266,44 +266,6 @@ Installer::replaceOnRebootSucceeded (const std::string& fn, bool &rebootneeded) rebootneeded = true; } -#define MB_RETRYCONTINUE 7 -#if !defined(IDCONTINUE) -#define IDCONTINUE IDCANCEL -#endif - -static HHOOK hMsgBoxHook; -LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { - HWND hWnd; - switch (nCode) { - case HCBT_ACTIVATE: - hWnd = (HWND)wParam; - if (GetDlgItem(hWnd, IDCANCEL) != NULL) - SetDlgItemText(hWnd, IDCANCEL, "Continue"); - UnhookWindowsHookEx(hMsgBoxHook); - } - return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam); -} - -int _custom_MessageBox(HWND hWnd, LPCTSTR szText, LPCTSTR szCaption, UINT uType) { - int retval; - bool retry_continue = (uType & MB_TYPEMASK) == MB_RETRYCONTINUE; - if (retry_continue) { - uType &= ~MB_TYPEMASK; uType |= MB_RETRYCANCEL; - // Install a window hook, so we can intercept the message-box - // creation, and customize it - // Only install for THIS thread!!! - hMsgBoxHook = SetWindowsHookEx(WH_CBT, CBTProc, NULL, GetCurrentThreadId()); - } - retval = MessageBox(hWnd, szText, szCaption, uType); - // Intercept the return value for less confusing results - if (retry_continue && retval == IDCANCEL) - return IDCONTINUE; - return retval; -} - -#undef MessageBox -#define MessageBox _custom_MessageBox - typedef struct { const char *msg; @@ -660,16 +622,9 @@ Installer::_installOne (packagemeta &pkgm, // policy) prevents us from listing those processes. // All we can offer the user is a generic "retry or ignore" choice and a chance // to fix the problem themselves - char msg[fn.size() + 300]; - sprintf (msg, - "Unable to extract /%s\r\n\r\n" - "The file is in use or some other error occurred.\r\n\r\n" - "Please stop all Cygwin processes and select \"Retry\", or " - "select \"Continue\" to go on anyway (the file will be updated after a reboot).\r\n", - fn.c_str()); - - rc = MessageBox (owner, msg, "Error writing file", - MB_RETRYCONTINUE | MB_ICONWARNING | MB_TASKMODAL); + rc = mbox (owner, IDS_EXTRACTION_INUSE, + MB_RETRYCONTINUE | MB_ICONWARNING | MB_TASKMODAL, + fn.c_str()); } } @@ -729,11 +684,6 @@ Installer::_installOne (packagemeta &pkgm, { if (!ignoreExtractErrors) { - char msg[fn.size() + 300]; - sprintf (msg, - "Unable to extract /%s -- corrupt package?\r\n", - fn.c_str()); - // XXX: We should offer the option to retry, // continue without extracting this particular archive, // or ignore all extraction errors. @@ -742,8 +692,9 @@ Installer::_installOne (packagemeta &pkgm, // and ignore all errors is mis-implemented at present // to only apply to errors arising from a single archive, // so we degenerate to the continue option. - mbox (owner, msg, "File extraction error", - MB_OK | MB_ICONWARNING | MB_TASKMODAL); + mbox (owner, IDS_EXTRACTION_FAILED, + MB_OK | MB_ICONWARNING | MB_TASKMODAL, + fn.c_str()); } error_in_this_file = true; @@ -784,24 +735,17 @@ check_for_old_cygwin (HWND owner) if (_access (buf, 0) != 0) return; - char msg[sizeof (buf) + 132]; - sprintf (msg, - "An old version of cygwin1.dll was found here:\r\n%s\r\nDelete?", - buf); - switch (MessageBox - (owner, msg, "What's that doing there?", - MB_YESNO | MB_ICONQUESTION | MB_TASKMODAL)) + switch (mbox(owner, IDS_INSTALL_OLD_CYGWIN, + MB_YESNO | MB_ICONQUESTION | MB_TASKMODAL, + buf)) { case IDYES: if (!DeleteFile (buf)) - { - sprintf (msg, "Couldn't delete file %s.\r\n" - "Is the DLL in use by another application?\r\n" - "You should delete the old version of cygwin1.dll\r\n" - "at your earliest convenience.", buf); - mbox (owner, buf, "Couldn't delete file", - MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL); - } + { + mbox (owner, IDS_INSTALL_DELETE_OLD_CYGWIN_FAILED, + MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL, + buf); + } break; default: break; @@ -1010,6 +954,8 @@ do_install_reflector (void *p) HANDLE *context; context = (HANDLE *) p; + SetThreadUILanguage(langid); + try { do_install_thread ((HINSTANCE) context[0], (HWND) context[1]); diff --git a/localdir.cc b/localdir.cc index fd49634d..7a01e117 100644 --- a/localdir.cc +++ b/localdir.cc @@ -123,14 +123,8 @@ offer_to_create (HWND h, const char *dirname) if (!unattended_mode) { - char msgText[MAX_PATH + 100]; - char fmtString[100]; DWORD ret; - - LoadString (hinstance, IDS_MAYBE_MKDIR, fmtString, sizeof fmtString); - snprintf (msgText, sizeof msgText, fmtString, dirname); - - ret = MessageBox (h, msgText, 0, MB_ICONSTOP | MB_YESNO); + ret = mbox (h, IDS_MAYBE_MKDIR, MB_ICONSTOP | MB_YESNO, dirname); if (ret == IDNO) return -1; } @@ -280,12 +274,9 @@ LocalDirPage::OnNext () if (!unattended_mode) { // Check the user really wants only to uninstall. - char msgText[1000]; - LoadString (hinstance, IDS_NO_LOCALDIR, msgText, - sizeof (msgText)); - char msg[1000 + local_dir.size ()]; - snprintf (msg, sizeof (msg), msgText, local_dir.c_str ()); - int ret = MessageBox (h, msg, 0, MB_ICONEXCLAMATION | MB_OKCANCEL); + int ret = mbox(h, IDS_NO_LOCALDIR, + MB_ICONEXCLAMATION | MB_OKCANCEL, + local_dir.c_str ()); if (ret == IDCANCEL) return -1; } @@ -299,34 +290,29 @@ LocalDirPage::OnNext () else { DWORD err = GetLastError (); - char msgText[1000]; - LoadString (hinstance, IDS_ERR_CHDIR, msgText, sizeof (msgText)); - char* buf; - char msg[1000]; - if (FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_ALLOCATE_BUFFER, 0, err, LANG_NEUTRAL, - (LPSTR)&buf, 0, 0) != 0) + char* buf; + char msg[1000]; + if (FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, + 0, err, LANG_NEUTRAL, (LPSTR)&buf, 0, 0) != 0) { - snprintf (msg, sizeof (msg), msgText, local_dir.c_str(), - buf, err); + snprintf (msg, sizeof (msg), "%s", buf); LocalFree (buf); - } - else - snprintf (msg, sizeof (msg), msgText, local_dir.c_str(), - "(unknown error)", err); - Log (LOG_PLAIN) << msg << endLog; - int ret = MessageBox (h, msg, 0, MB_ICONEXCLAMATION | - MB_ABORTRETRYIGNORE); - - if ((ret == IDABORT) || (ret == IDCANCEL)) + } + else + snprintf (msg, sizeof (msg), "%s", "(unknown error)"); + int ret = mbox (h, IDS_ERR_CHDIR, + MB_ICONEXCLAMATION | MB_ABORTRETRYIGNORE, + local_dir.c_str(), msg, err); + if (ret == IDABORT) return -1; else tryLocalDir = (ret == IDRETRY); - // XXX: On IDIGNORE we drop through to IDD_NET, which is wrong in - // the source == IDC_SOURCE_LOCALDIR case? } } + if (source == IDC_SOURCE_LOCALDIR) + return IDD_INSTATUS; + return 0; // IDD_NET } diff --git a/main.cc b/main.cc index f4756c73..162028ff 100644 --- a/main.cc +++ b/main.cc @@ -105,6 +105,7 @@ static BoolOption VersionOption (false, 'V', "version", "Show version"); static StringOption SetupBaseNameOpt ("setup", 'i', "ini-basename", "Use a different basename, e.g. \"foo\", instead of \"setup\"", false); BoolOption UnsupportedOption (false, '\0', "allow-unsupported-windows", "Allow old, unsupported Windows versions"); static StringChoiceOption SymlinkTypeOption(symlink_types, '\0', "symlink-type", "Symlink type (lnk, native, sys, wsl)", false, SymlinkTypeMagic); +static StringOption GuiLangOption ("", '\0', "lang", "Specify GUI language langid"); std::string SetupBaseName; @@ -167,11 +168,7 @@ main_display () (LPVOID *) & sl); if (res) { - char buf[256]; - sprintf (buf, "CoCreateInstance failed with error 0x%x.\n" - "Setup will not be able to create Cygwin Icons\n" - "in the Start Menu or on the Desktop.", (int) res); - mbox (NULL, buf, "Cygwin Setup", MB_OK); + mbox (NULL, IDS_SHELLLINK_FAILED, MB_OK, res); } // Init window class lib @@ -265,10 +262,18 @@ WinMain (HINSTANCE h, sprintf (buff, "Invalid option for --arch: \"%s\"", ((std::string) Arch).c_str ()); fprintf (stderr, "*** %s\n", buff); - mbox (NULL, buff, "Invalid option", MB_ICONEXCLAMATION | MB_OK); exit (1); } + if (GuiLangOption.isPresent()) + { + // If option's value isn't numeric, perhaps we should try to interpret + // it as a locale name? + int rc = sscanf(((std::string)GuiLangOption).c_str(), "%hx", &langid); + if (rc > 0) + SetThreadUILanguage(langid); + } + unattended_mode = PackageManagerOption ? chooseronly : (UnattendedOption ? unattended : attended); @@ -327,8 +332,8 @@ WinMain (HINSTANCE h, /* Check if Cygwin works on this Windows version */ if (!UnsupportedOption && (OSMajorVersion () < 6)) { - mbox (NULL, "Cygwin is not supported on this Windows version", - "Cygwin Setup", MB_ICONEXCLAMATION | MB_OK); + mbox (NULL, IDS_UNSUPPORTED_WINDOWS_VERSION, + MB_ICONEXCLAMATION | MB_OK); Logger ().exit (1, false); } diff --git a/mount.cc b/mount.cc index f261ce06..f63edd4c 100644 --- a/mount.cc +++ b/mount.cc @@ -132,9 +132,7 @@ create_install_root () } while (rv == ERROR_ACCESS_DENIED); if (rv != ERROR_SUCCESS) - mbox (NULL, "Couldn't create registry key\n" - "to store installation path", - "Cygwin Setup", MB_OK | MB_ICONWARNING); + mbox (NULL, IDS_MOUNT_REGISTRY_KEY_FAILED, MB_OK | MB_ICONWARNING); RegCloseKey (key); // The mount table is already in the right shape at this point. diff --git a/msg.cc b/msg.cc index 403e78aa..5badcc3c 100644 --- a/msg.cc +++ b/msg.cc @@ -25,37 +25,49 @@ #include #include "dialog.h" #include "state.h" +#include "String++.h" +#include "resource.h" + +static int +unattended_result(int mb_type) +{ + // Return some default values. + Log (LOG_PLAIN) << "unattended_mode is set at mbox: returning default value" << endLog; + + switch (mb_type & MB_TYPEMASK) + { + case MB_OK: + case MB_OKCANCEL: + return IDOK; + break; + case MB_YESNO: + case MB_YESNOCANCEL: + return IDYES; + break; + case MB_ABORTRETRYIGNORE: + return IDIGNORE; + break; + case MB_RETRYCANCEL: + return IDCANCEL; + break; + default: + Log (LOG_PLAIN) << "unattended_mode failed for " << (mb_type & MB_TYPEMASK) << endLog; + return 0; + } +} int mbox (HWND owner, const char *buf, const char *name, int type) { + // 'name' is not the mbox caption, just some text written to the log Log (LOG_PLAIN) << "mbox " << name << ": " << buf << endLog; if (unattended_mode) - { - // Return some default values. - Log (LOG_PLAIN) << "unattended_mode is set at mbox: returning default value" << endLog; - switch (type & MB_TYPEMASK) - { - case MB_OK: - case MB_OKCANCEL: - return IDOK; - break; - case MB_YESNO: - case MB_YESNOCANCEL: - return IDYES; - break; - case MB_ABORTRETRYIGNORE: - return IDIGNORE; - break; - case MB_RETRYCANCEL: - return IDCANCEL; - break; - default: - Log (LOG_PLAIN) << "unattended_mode failed for " << (type & MB_TYPEMASK) << endLog; - return 0; - } - } - return MessageBox (owner, buf, "Cygwin Setup", type); + return unattended_result(type); + + char caption[32]; + LoadString (hinstance, IDS_MBOX_CAPTION, caption, sizeof (caption)); + + return MessageBox (owner, buf, caption, type); } static int @@ -94,3 +106,61 @@ yesno (HWND owner, int id, ...) va_start (args, id); return mbox (owner, "yesno", MB_YESNO, id, args); } + +static HHOOK hMsgBoxHook; + +LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) { + HWND hWnd; + switch (nCode) { + case HCBT_ACTIVATE: + hWnd = (HWND)wParam; + if (GetDlgItem(hWnd, IDCANCEL) != NULL) + { + // XXX: ideally we'd discover the text used for 'Continue' buttons in + // MessageBoxes, rather than having our own translation. + std::wstring cont = LoadStringW(IDS_CONTINUE); + SetDlgItemTextW(hWnd, IDCANCEL, cont.c_str()); + } + UnhookWindowsHookEx(hMsgBoxHook); + } + return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam); +} + +int +mbox(HWND owner, unsigned int format_id, int mb_type, ...) +{ + std::wstring fmt = LoadStringW(format_id); + if (fmt.empty()) + fmt = L"Internal error: format string resource not found"; + + va_list args; + va_start(args, mb_type); + std::wstring buf = vformat(fmt, args); + va_end(args); + + // write to log as UTF8 + Log (LOG_PLAIN) << "mbox " << ": " << wstring_to_string(buf) << endLog; + + if (unattended_mode) + return unattended_result(mb_type); + + bool retry_continue = (mb_type & MB_TYPEMASK) == MB_RETRYCONTINUE; + if (retry_continue) { + mb_type &= ~MB_TYPEMASK; + mb_type |= MB_RETRYCANCEL; + // Install a window hook, so we can intercept the message-box creation, and + // customize it (replacing the text on the 'cancel' button with 'continue') + // Only install for THIS thread!!! + hMsgBoxHook = SetWindowsHookEx(WH_CBT, CBTProc, NULL, GetCurrentThreadId()); + } + + std::wstring caption = LoadStringW(IDS_MBOX_CAPTION); + int retval = MessageBoxW(owner, buf.c_str(), caption.c_str(), mb_type); + + // When the the retry_continue customization is active, adjust the return + // value for less confusing results + if (retry_continue && retval == IDCANCEL) + retval = IDCONTINUE; + + return retval; +} diff --git a/msg.h b/msg.h index 48100579..98dff693 100644 --- a/msg.h +++ b/msg.h @@ -34,4 +34,9 @@ int yesno (HWND owner, int id, ...); /* general MessageBox() wrapper which understands unattended mode */ int mbox (HWND owner, const char *buf, const char *name, int type); +/* MessageBox() wrapper which understands format string and unattended mode */ +int mbox(HWND owner, unsigned int format_id, int mb_type, ...); + +#define MB_RETRYCONTINUE 7 + #endif /* SETUP_MSG_H */ diff --git a/nio-ie5.cc b/nio-ie5.cc index 8fd7008a..876aac63 100644 --- a/nio-ie5.cc +++ b/nio-ie5.cc @@ -241,7 +241,7 @@ try_again: // show errors apart from file-not-found (e doesn't contain the // response code so we have to resort to looking at the message) if (strncmp("550", buf, 3) != 0) - mbox (0, buf, "Internet Error", MB_OK); + mbox (0, IDS_NIO_ERROR, MB_OK, buf); for (unsigned int i = 0; i < l; i++) if (buf[i] == '\n' or buf[i] == '\r') diff --git a/package_message.h b/package_message.h index 7ff7d155..22d794cb 100644 --- a/package_message.h +++ b/package_message.h @@ -15,8 +15,8 @@ #include "UserSettings.h" #include "state.h" +#include "msg.h" #include -#include "win32.h" class packagemessage { @@ -33,14 +33,13 @@ public: { if (unattended_mode || !id.length () || UserSettings::instance().get (id.c_str ())) /* No message or already seen */; - else if (MessageBox (NULL, message.c_str (), "Setup Alert", - MB_OKCANCEL | MB_ICONSTOP | MB_SETFOREGROUND - | MB_TOPMOST) != IDCANCEL) - UserSettings::instance().set (id.c_str (), "1"); else - exit (1); + { + mbox (NULL, message.c_str (), "Cygwin Setup", + MB_OK | MB_ICONSTOP | MB_SETFOREGROUND | MB_TOPMOST); + UserSettings::instance().set (id.c_str (), "1"); + } } }; #endif /* SETUP_PACKAGE_MESSAGE_H */ - diff --git a/postinstall.cc b/postinstall.cc index 136f40f1..9e063a2d 100644 --- a/postinstall.cc +++ b/postinstall.cc @@ -240,6 +240,8 @@ do_postinstall_reflector (void *p) HANDLE *context; context = (HANDLE *) p; + SetThreadUILanguage(langid); + try { std::string s = do_postinstall_thread ((HINSTANCE) context[0], (HWND) context[1]); @@ -280,4 +282,3 @@ do_postinstall (HINSTANCE h, HWND owner) DWORD threadID; CreateThread (NULL, 0, do_postinstall_reflector, context, 0, &threadID); } - diff --git a/prereq.cc b/prereq.cc index 2382ee21..65a6b391 100644 --- a/prereq.cc +++ b/prereq.cc @@ -92,12 +92,8 @@ PrereqPage::OnNext () if (!IsDlgButtonChecked (h, IDC_PREREQ_CHECK)) { // breakage imminent! danger, danger - int res = MessageBox (h, - "Some packages may not work properly if you continue." - "\r\n\r\n" - "Are you sure you want to proceed (NOT RECOMMENDED)?", - "WARNING - Unsolved Problems", - MB_YESNO | MB_ICONEXCLAMATION | MB_DEFBUTTON2); + int res = mbox (h, IDS_PREREQ_UNSOLVED_PROBLEMS, + MB_YESNO | MB_ICONEXCLAMATION | MB_DEFBUTTON2); if (res == IDNO) return -1; else @@ -229,6 +225,8 @@ do_prereq_check_reflector (void *p) HANDLE *context; context = (HANDLE *) p; + SetThreadUILanguage(langid); + try { int next_dialog = do_prereq_check_thread ((HINSTANCE) context[0], (HWND) context[1]); diff --git a/propsheet.cc b/propsheet.cc index 93282811..00b2ad81 100644 --- a/propsheet.cc +++ b/propsheet.cc @@ -24,6 +24,7 @@ #include "RECTWrapper.h" #include "ControlAdjuster.h" #include "choose.h" +#include "msg.h" // Sort of a "hidden" Windows structure. Used in the PropSheetCallback. #include @@ -160,9 +161,7 @@ static LRESULT CALLBACK PropSheetWndProc (HWND hwnd, UINT uMsg, if (wParam != 2) break; areyousure: - if (MessageBox(hwnd, - "Are you sure you want to exit setup? Any current download or installation will be aborted.", - "Exit Cygwin Setup?", MB_YESNO) == IDNO) + if (mbox(hwnd, IDS_CONFIRM_EXIT, MB_YESNO) == IDNO) return 0; break; case WM_SIZE: @@ -302,23 +301,9 @@ PropSheet::Create (const Window * Parent, DWORD Style) p.phpage = PageHandles; p.pfnCallback = PropSheetProc; - // The winmain event loop actually resides in here. PropertySheet (&p); - // Do a modeless property sheet... - //SetHWND((HWND)PropertySheet(&p)); - /*Show(SW_SHOWNORMAL); - - // ...but pretend it's modal - MessageLoop(); - MessageBox(NULL, "DONE", NULL, MB_OK); - - // FIXME: Enable the parent before destroying this window to prevent another window - // from becoming the foreground window - // ala: EnableWindow(, TRUE); - //DestroyWindow(WindowHandle); - */ SetHWND (NULL); diff --git a/res.rc b/res.rc index 7fc0ee57..febf357a 100644 --- a/res.rc +++ b/res.rc @@ -15,6 +15,11 @@ #define SETUP_HEADICON_X (SETUP_STANDARD_DIALOG_W - 27) +///////////////////////////////////////////////////////////////////////////// +// +// English (en_US) resources +// + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US ///////////////////////////////////////////////////////////////////////////// @@ -265,9 +270,9 @@ BEGIN "the future to add, remove, or upgrade packages as " "necessary.",IDC_SPLASH_TEXT,115,25,195,90 ICON IDI_CYGWIN,IDC_SPLASH_ICON,4,6,0,0,SS_ICON | SS_REALSIZEIMAGE - LTEXT "Version (unknown)",IDC_VERSION,115,127,195,10 - LTEXT "Copyright 2000-2021",IDC_SPLASH_COPYR,115,140,195,8 - LTEXT "https://cygwin.com/",IDC_SPLASH_URL,115,152,90,8 + LTEXT "",IDC_VERSION,115,127,195,10 + LTEXT "",IDC_SPLASH_COPYR,115,140,195,8 + LTEXT "",IDC_SPLASH_URL,115,152,90,8 END IDD_DESKTOP DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS @@ -542,7 +547,6 @@ STRINGTABLE BEGIN IDS_ROOT_SLASH "Warning: we recommend you do not use the root of your hard drive as the cygwin root, to prevent possible conflicts with other programs. Proceed anyway?" IDS_ROOT_SPACE "You should not choose a root path that include spaces in directory names. Proceed anyway?" - IDS_MIRROR_LST "https://cygwin.com/mirrors.lst" IDS_ERR_OPEN_WRITE "Can't open %s for writing: %s" IDS_SETUPINI_MISSING "Unable to get %s from <%s>" IDS_OLD_SETUPINI "This setup.ini is older than the one you used last time you installed cygwin. Proceed anyway?" @@ -645,4 +649,49 @@ BEGIN IDS_COLUMN_CATEGORIES "Categories" IDS_COLUMN_SIZE "Size" IDS_COLUMN_DESCR "Description" + IDS_MBOX_CAPTION "Cygwin Setup" + IDS_EXTRACTION_FAILED "Unable to extract /%s -- corrupt package?" + IDS_EXTRACTION_INUSE + "Unable to extract /%s -- error writing file\r\n\r\n" + "The file is in use or some other error occurred.\r\n\r\n" + "Please stop all Cygwin processes and select ""Retry"", or " + "select ""Continue"" to go on anyway (the file will be updated after a reboot).\r\n" + IDS_INSTALL_OLD_CYGWIN "An old version of cygwin1.dll was found here:\r\n%s\r\nDelete?" + IDS_INSTALL_DELETE_OLD_CYGWIN_FAILED "Couldn't delete file %s.\r\n" + "Is the DLL in use by another application?\r\n" + "You should delete the old version of cygwin1.dll " + "at your earliest convenience." + IDS_SHELLLINK_FAILED + "CoCreateInstance failed with error 0x%x.\n" + "Setup will not be able to create Cygwin Icons " + "in the Start Menu or on the Desktop." + IDS_UNSUPPORTED_WINDOWS_VERSION "Cygwin is not supported on this Windows version" + IDS_MOUNT_REGISTRY_KEY_FAILED "Couldn't create registry key to store installation path" + IDS_NIO_ERROR "Internet Error: %s" + IDS_PREREQ_UNSOLVED_PROBLEMS + "WARNING - Unsolved Problems" + "\r\n\r\n" + "Some packages may not work properly if you continue." + "\r\n\r\n" + "Are you sure you want to proceed (NOT RECOMMENDED)?" + IDS_MIXED_BITNESS_ERROR + "Target CPU mismatch" + "\r\n\r\n" + "You're trying to install a %s bit version of Cygwin into a directory " + "containing a %s bit version of Cygwin. Continuing to do so would " + "break the existing installation." + "\r\n\r\n" + "Either run setup-%s.exe to update your existing %s bit installation of Cygwin, " + "or choose another directory for your %s bit installation." + IDS_GET_SITELIST_ERROR + "Can't get list of download sites.\r\n" + "Make sure your network settings are correct and try again." + IDS_CONFIRM_EXIT "Are you sure you want to exit setup? Any current download or installation will be aborted." + IDS_CONTINUE "Continue" END + +///////////////////////////////////////////////////////////////////////////// +// +// Translations + +#include "res/fr/res.rc" diff --git a/res/fr/res.rc b/res/fr/res.rc new file mode 100644 index 00000000..0b365e2f --- /dev/null +++ b/res/fr/res.rc @@ -0,0 +1,605 @@ +///////////////////////////////////////////////////////////////////////////// +// +// French (fr_FR) resources +// + +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SOURCE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - Choisissez le type d'installation" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "&Installer depuis Internet\n(les fichiers téléchargés seront gardés pour une réutilisation ultérieure)", + IDC_SOURCE_NETINST, "Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP | BS_MULTILINE + | BS_TOP, + 71, 60, 200, 30 + CONTROL "&Télécharger sans installer", + IDC_SOURCE_DOWNLOAD, "Button", + BS_AUTORADIOBUTTON | WS_TABSTOP, + 71, 90, 200, 10 + CONTROL "Installer depuis un dossier &local",IDC_SOURCE_LOCALDIR,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP, + 71,120,200,10 + ICON IDI_CYGWIN, IDC_HEADICON, SETUP_HEADICON_X, 0, 21, 20 + CONTROL "", IDC_HEADSEPARATOR, "Static", SS_BLACKFRAME | SS_SUNKEN, + 0, 28, SETUP_STANDARD_DIALOG_W, 1 + LTEXT "Choisissez la source du téléchargement",IDC_STATIC_HEADER_TITLE, + 7, 0, 258, 8, NOT WS_GROUP + LTEXT "Choisissez si vous installez ou téléchargez depuis Internet, ou installez des fichiers depuis un dossier local.", + IDC_SOURCE_SUBTEXT, + 21, 9, 239, 16, NOT WS_GROUP +END + +IDD_VIRUS DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - Inhiber l'Anti-Virus ?" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "&Inhiber l'anti-virus",IDC_DISABLE_AV,"Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,101,69,115,10 + CONTROL "&Laisser l'anti-virus tranquille",IDC_LEAVE_AV,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,101,84,115,10 + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28, + SETUP_STANDARD_DIALOG_W,1 + LTEXT "Choisissez si vous inhibez votre anti-virus pendant l'installation.",IDC_STATIC_HEADER_TITLE,7,0, + 258,8,NOT WS_GROUP + LTEXT "Certains anti-virus, notamment McAfee, génèrent un écran bleu sur Windows XP lors de l'installation de Cygwin.", + IDC_STATIC,21,9,239,16,NOT WS_GROUP + LTEXT "Un anti-virus problématique a été détecté. L'assistant Cygwin peut l'inhiber pendant le processus d'installation, et le revalider à la fin de l'installation.", + IDC_STATIC,21,32,239,24,NOT WS_GROUP +END + +IDD_LOCAL_DIR DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - Sélection du dossier local des paquets" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Sélection du dossier local des paquets",IDC_STATIC_HEADER_TITLE, + 7,0,258,8,NOT WS_GROUP + LTEXT "",IDC_LOCAL_DIR_DESC,21,9,248,16,NOT WS_GROUP + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28, + SETUP_STANDARD_DIALOG_W,1 + GROUPBOX "Dossier local des paquets",IDC_LOCALDIR_GRP,5,35,330,35 + EDITTEXT IDC_LOCAL_DIR,13,47,270,14,ES_AUTOHSCROLL | WS_TABSTOP + PUSHBUTTON "Par&courir...",IDC_LOCAL_DIR_BROWSE,285,47,44,14,WS_TABSTOP +END + +IDD_ROOT DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - Choix du dossier d'installation" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Sélection du dossier racine", IDC_STATIC_HEADER_TITLE, + 7,0,258,8,NOT WS_GROUP + LTEXT "Sélectionnez le dossier où installer Cygwin. " + "Choisissez également des paramètres d'installation.", + IDC_ROOTDIR_SUBTEXT,21,9,239,16,NOT WS_GROUP + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28, + SETUP_STANDARD_DIALOG_W,1 + + GROUPBOX "Dossier racine", IDC_ROOTDIR_GRP,5,35,330,35 + EDITTEXT IDC_ROOT_DIR,15,47,270,14,ES_AUTOHSCROLL | WS_TABSTOP + PUSHBUTTON "Pa&rcourir...",IDC_ROOT_BROWSE,285,47,44,14,WS_TABSTOP + + GROUPBOX "Installer pour",IDC_INSTALLFOR_GRP,5,76,330,101 + CONTROL "&Tout le monde (RECOMMANDÉ)",IDC_ROOT_SYSTEM,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP,13,89,130,8 + CONTROL "Juste &Moi",IDC_ROOT_USER,"Button",BS_AUTORADIOBUTTON | + WS_TABSTOP,13,130,130,8 + LTEXT "Cygwin sera disponible pour tous les utilisateurs", + IDC_ALLUSERS_TEXT,25,101,300,28 + LTEXT "Cygwin sera disponible pour tous les utilisateurs " + "mais les icones et les menus uniquement pour l'utilisateur " + "en cours. Ne sélectionner que si vous n'avez pas les droits " + "administrateur ou en cas de besoin spécifique.", + IDC_JUSTME_TEXT,25,140,300,32 +END + +IDD_SITE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Assistant Cygwin - Choix site(s) de téléchargement" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + LISTBOX IDC_URL_LIST,66,45,185,110,LBS_NOINTEGRALHEIGHT | + LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_GROUP | + WS_TABSTOP + LTEXT "Sites disponibles :",IDC_STATIC,66,34,183,8,NOT + WS_GROUP + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28, + SETUP_STANDARD_DIALOG_W,1 + LTEXT "Choisissez un site dans cette liste, ou ajoutez vos propres sites à la liste.", + IDC_STATIC,21,9,239,16,NOT WS_GROUP + LTEXT "Choisissez un site de téléchargement",IDC_STATIC_HEADER_TITLE,7,0,258, + 8,NOT WS_GROUP + EDITTEXT IDC_EDIT_USER_URL,65,160,185,14,ES_AUTOHSCROLL | WS_GROUP + LTEXT "URL perso :",IDC_SITE_USERURL,15,162,45,8,NOT WS_GROUP + PUSHBUTTON "Ajouter",IDC_BUTTON_ADD_URL,255,160,50,14 +END + +IDD_NET DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - Sélection du type de connexion" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Utiliser les paramètres proxy &Système",IDC_NET_PRECONFIG,"Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,60,55,185,10 + CONTROL "Connexion &directe",IDC_NET_DIRECT,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,60,70,73,10 + CONTROL "Utiliser le &proxy HTTP/FTP :",IDC_NET_PROXY,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,60,85,110,10 + EDITTEXT IDC_PROXY_HOST,120,105,120,12,ES_AUTOHSCROLL | + WS_DISABLED | WS_GROUP + EDITTEXT IDC_PROXY_PORT,120,125,30,12,ES_AUTOHSCROLL | + WS_DISABLED + GROUPBOX "",IDC_STATIC,60,95,185,50 + RTEXT "&Serveur proxy",IDC_STATIC,65,105,50,12,SS_CENTERIMAGE | + NOT WS_GROUP + RTEXT "Por&t",IDC_STATIC,85,125,30,12,SS_CENTERIMAGE | NOT + WS_GROUP + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28, + SETUP_STANDARD_DIALOG_W,1 + LTEXT "L'assistant a besoin de savoir comment vous désirez le connecter à Internet. Choisissez un paramètre approprié ci-dessous.", + IDC_STATIC,21,9,239,16,NOT WS_GROUP + LTEXT "Sélectionnez votre connexion Internet", + IDC_STATIC_HEADER_TITLE,7,0,258,8,NOT WS_GROUP +END + +IDD_INSTATUS DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Assistant Cygwin" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Installation...",IDC_INS_ACTION,45,55,205,8,SS_ENDELLIPSIS + LTEXT "(PAQUET)",IDC_INS_PKG,45,70,205,8,SS_ENDELLIPSIS + LTEXT "(FICHIER)",IDC_INS_FILE,45,85,205,10,SS_ENDELLIPSIS + CONTROL "Progress1",IDC_INS_DISKFULL,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,95,130,155,10 + CONTROL "Progress1",IDC_INS_IPROGRESS,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,95,115,155,10 + CONTROL "Progress1",IDC_INS_PPROGRESS,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,95,100,155,10 + LTEXT "Paquet :",IDC_INS_BL_PACKAGE,45,100,50,8,NOT WS_GROUP + LTEXT "Total  :",IDC_INS_BL_TOTAL,45,115,50,8,NOT WS_GROUP + LTEXT "Disque :",IDC_INS_BL_DISK,45,130,50,8,NOT WS_GROUP + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28, + SETUP_STANDARD_DIALOG_W,1 + LTEXT "Cette page affiche l'avancement du téléchargement ou de l'installation.", + IDC_STATIC,21,9,239,16,NOT WS_GROUP + LTEXT "Avancement",IDC_STATIC_HEADER_TITLE,7,0,258,8,NOT WS_GROUP +END + +IDD_PROXY_AUTH DIALOG 0, 0, SETUP_SMALL_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Authentification proxy requise" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDI_CYGWIN,IDC_HEADICON,5,5,21,20 + LTEXT "ID &Utilisateur",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_USER,65,28,145,12,ES_AUTOHSCROLL + LTEXT "&Mot de passe",IDC_STATIC,10,43,50,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_PASSWD,65,43,145,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Authentification proxy requise",IDC_STATIC,65,10,145,10 + DEFPUSHBUTTON "&OK",IDOK,100,75,45,15,WS_DISABLED + PUSHBUTTON "Annule",IDCANCEL,165,75,45,15 +END + +IDD_NET_AUTH DIALOG 0, 0, SETUP_SMALL_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Authentification serveur requise" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDI_CYGWIN,IDC_HEADICON,5,5,21,20 + LTEXT "&Identifiant",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_USER,65,28,145,12,ES_AUTOHSCROLL + LTEXT "&Mot de passe",IDC_STATIC,10,43,50,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_PASSWD,65,43,145,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Authentification serveur requise",IDC_STATIC,65,10,145,10 + DEFPUSHBUTTON "&OK",IDOK,100,75,45,15,WS_DISABLED + PUSHBUTTON "Annule",IDCANCEL,165,75,45,15 +END + +IDD_SPLASH DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Programme Assistant Cygwin", + IDC_STATIC_WELCOME_TITLE,115,1,195,24 + LTEXT "Cet assistant est utilisé pour l'installation initiale " + "de l'environnement Cygwin ainsi que pour ses mises à jour." + "Les pages suivantes vont vous guider durant l'installation. " + "\r\n\r\n" + "Notez que Cygwin inclus un grand nombre de paquets " + "destinés à de multiples usages. Nous ne pourrons installer " + "par défaut qu'un jeu de paquets de base." + "\r\n\r\n" + "Redémarrez ce programme ultérieurement pour ajouter, enlever ou " + "mettre à jour des paquets si nécessaire.",IDC_SPLASH_TEXT,115,25,195,90 + ICON IDI_CYGWIN,IDC_SPLASH_ICON,4,6,0,0,SS_ICON | SS_REALSIZEIMAGE + LTEXT "",IDC_VERSION,115,117,195,10 + LTEXT "",IDC_SPLASH_COPYR,115,130,195,8 + LTEXT "",IDC_SPLASH_URL,115,142,90,8 +END + +IDD_DESKTOP DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - État de l'installation et création des icônes" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Créer une icône sur le &bureau",IDC_ROOT_DESKTOP,"Button", + BS_AUTOCHECKBOX,108,78,110,8 + CONTROL "Ajouter une icône au menu &Démarrer",IDC_ROOT_MENU,"Button", + BS_AUTOCHECKBOX,108,93,140,8 + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28, + SETUP_STANDARD_DIALOG_W,1 + LTEXT "Indiquez à l'assistant si vous voulez créer des icônes pour un accès aisé à Cygwin.", + IDC_DESKTOP_HEADER_INSTALL,21,9,239,16,NOT WS_GROUP + LTEXT "Création des icônes",IDC_DESKTOP_HEADER_TITLE_INSTALL,7,0,258,8,NOT WS_GROUP + LTEXT "Montre l'état de l'installation en mode téléchargement seulement.", + IDC_DESKTOP_HEADER_DOWNLOAD,21,9,239,16,NOT WS_GROUP + LTEXT "Installation terminée",IDC_DESKTOP_HEADER_TITLE_DOWNLOAD,7,0,258,8,NOT WS_GROUP + CONTROL "",IDC_DESKTOP_SEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN, + 0,155,SETUP_STANDARD_DIALOG_W,1 + LTEXT "État de l'installation",IDC_STATUS_HEADER,7,160,258,8,NOT WS_GROUP + LTEXT "Installation de Cygwin terminée avec succès.",IDC_STATUS, + 21,169,239,16,NOT WS_GROUP +END + +IDD_FTP_AUTH DIALOG 0, 0, SETUP_SMALL_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Authentification FTP requise" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDI_CYGWIN,IDC_HEADICON,5,5,21,20 + LTEXT "ID &Utilisateur",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_USER,65,28,145,12,ES_AUTOHSCROLL + LTEXT "&Mot de passe",IDC_STATIC,10,43,50,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_PASSWD,65,43,145,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Authentification FTP requise",IDC_STATIC,65,10,145,10 + DEFPUSHBUTTON "&OK",IDOK,100,75,45,15,WS_DISABLED + PUSHBUTTON "Annule",IDCANCEL,165,75,45,15 +END + +IDD_CHOOSE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Assistant Cygwin - Sélection des paquets" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Voir", IDC_CHOOSE_VIEWCAPTION, SETUP_VIEW_X, 33, + SETUP_VIEW_W, 10 + COMBOBOX IDC_CHOOSE_VIEW, SETUP_VIEWLIST_X, 30, SETUP_VIEWLIST_W, 84, + CBS_DROPDOWNLIST | WS_TABSTOP + RTEXT "&Chercher", IDC_STATIC, SETUP_SEARCH_X, 33, SETUP_SEARCH_W, + 10, SS_CENTERIMAGE, WS_EX_RIGHT + CONTROL "Chercher ", IDC_CHOOSE_DO_SEARCH, "Button", BS_PUSHBUTTON | NOT + WS_VISIBLE, SETUP_SEARCH_X, 33, SETUP_SEARCH_W, 14 + EDITTEXT IDC_CHOOSE_SEARCH_EDIT, SETUP_SEARCHTEXT_X, 30, + SETUP_SEARCHTEXT_W, 14, ES_AUTOHSCROLL + PUSHBUTTON "&Efface", IDC_CHOOSE_CLEAR_SEARCH, SETUP_CLEAR_X, 30, + SETUP_CLEAR_W, 14 + CONTROL "&Garde",IDC_CHOOSE_KEEP,"Button",BS_AUTORADIOBUTTON + | WS_GROUP | WS_TABSTOP, SETUP_KEEP_X, 30, SETUP_KPCE_W, 14 + CONTROL "&Mieux", IDC_CHOOSE_BEST, "Button", BS_AUTORADIOBUTTON, + SETUP_BEST_X, 30, SETUP_KPCE_W, 14 + CONTROL "&Sync", IDC_CHOOSE_SYNC, "Button", BS_AUTORADIOBUTTON, + SETUP_SYNC_X, 30, SETUP_KPCE_W, 14 + CONTROL "&Test", IDC_CHOOSE_EXP, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, + SETUP_EXP_X, 30, SETUP_KPCE_W, 14 + CONTROL "", IDC_HEADSEPARATOR, "Static", SS_BLACKFRAME | SS_SUNKEN, + 0, 28, SETUP_STANDARD_DIALOG_W, 1 + CONTROL "", IDC_CHOOSE_LIST, WC_LISTVIEW, LVS_NOSORTHEADER | LVS_REPORT | LVS_SINGLESEL | WS_TABSTOP, + 7, 47, SETUP_STANDARD_DIALOG_W - 14, 120, WS_EX_CLIENTEDGE + CONTROL "&Cache les paquets obsolètes", IDC_CHOOSE_HIDE, + "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 167, 160, 14 + ICON IDI_CYGWIN, IDC_HEADICON, SETUP_HEADICON_X, 0, 21, 20 + LTEXT "Sélectionnez les paquets à télécharger", + IDC_CHOOSE_INST_TEXT_DOWNLOAD, 21, 9, 239, 16, NOT WS_GROUP + LTEXT "Sélectionnez les paquets à installer", + IDC_CHOOSE_INST_TEXT_INSTALL, 21, 9, 239, 16, NOT WS_GROUP + LTEXT "Sélection des paquets",IDC_STATIC_HEADER_TITLE,7,0,258,8, + NOT WS_GROUP +END + +IDD_PREREQ DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Assistant Cygwin - Résolution des dépendances" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN, + 0,28,SETUP_STANDARD_DIALOG_W,1 + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + LTEXT "Résolution des dépendances",IDC_STATIC_HEADER_TITLE + ,7,0,258,8,NOT WS_GROUP + LTEXT "Les problèmes suivants apparaissent lors de la résolution " + "des dépendances",IDC_STATIC,21,9,239,16,NOT WS_GROUP + CONTROL "&Accepter la solution par défaut" + ,IDC_PREREQ_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 7,167,225,14 + EDITTEXT IDC_PREREQ_EDIT,7,41,303,124,WS_VSCROLL | WS_HSCROLL | + ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL | + ES_AUTOVSCROLL + +END + +IDD_CONFIRM DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Assistant Cygwin - Revoir et confirmer les changements" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN, + 0,28,SETUP_STANDARD_DIALOG_W,1 + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + LTEXT "Revoir et confirmer les changements",IDC_STATIC_HEADER_TITLE + ,7,0,258,8,NOT WS_GROUP + EDITTEXT IDC_CONFIRM_EDIT,7,41,325,131,WS_VSCROLL | WS_HSCROLL | + ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL | + ES_AUTOVSCROLL +END + +IDD_DROPPED DIALOG 0, 0, SETUP_STANDARD_DIALOG_W, 142 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - Utiliser les sites miroirs éliminés ?" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Attention :",IDC_STATIC,7,8,40,8 + LTEXT "Un ou plusieurs miroirs sélectionnés ne sont plus " + "dans la liste officielle des miroirs Cygwin. " + "Certains paquets peuvent manquer ou ne pas être à jour.\n" + "Ceci concerne le(s) miroir(s) suivant(s) :", + IDC_STATIC,47,8,263,32 + EDITTEXT IDC_DROP_MIRRORS,7,40,303,40,WS_VSCROLL | WS_HSCROLL | + ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL | + ES_AUTOVSCROLL + LTEXT "Si vous avez des problèmes à l'installation pensez à " + "n'utiliser que les miroirs officiels.\n\n" + "Voulez-vous continuer avec ce(s) miroir(s) ?", + IDC_STATIC,7,88,303,24 + CONTROL "&Ne plus me prévenir pour ce(s) miroir(s)", + IDC_DROP_NOWARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 7,120,213,15 + PUSHBUTTON "&Oui",IDYES,220,120,45,15 + DEFPUSHBUTTON "&Non",IDNO,265,120,45,15 + +END + +IDD_DOWNLOAD_ERROR DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +CAPTION "Téléchargement Incomplet" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDI_WARNING,IDC_HEADICON,10,10 + LTEXT "Les paquets suivants ont eu des erreurs de téléchargement :", + IDC_STATIC,7,8,320,16 + EDITTEXT IDC_DOWNLOAD_EDIT,7,24,320,88,WS_VSCROLL | + ES_LEFT | ES_MULTILINE | ES_READONLY | + ES_AUTOVSCROLL + LTEXT "Choisissez 'Recommencer' pour relancer le téléchargement, " + "'Précédent' pour revenir à la page de selection des paquets, " + "'Continuer' pour forcer la suite (NON RECOMMANDÉ), ou " + "'Annuler' pour quitter.", + IDC_STATIC,7,120,320,24 + DEFPUSHBUTTON "&Recommencer",IDRETRY,45,150,50,15 + PUSHBUTTON "&Précédent",IDC_BACK,110,150,50,15 + PUSHBUTTON "&Continuer",IDIGNORE,175,150,50,15 + PUSHBUTTON "Annuler",IDABORT,240,150,50,15 +END + +IDD_POSTINSTALL DIALOG 0, 0, SETUP_STANDARD_DIALOG_W, 142 +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Assistant Cygwin - Lancement des scripts post-installation" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN, + 0,28,SETUP_STANDARD_DIALOG_W,1 + ICON IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20 + LTEXT "Erreurs dans les scripts",IDC_STATIC_HEADER_TITLE + ,7,0,258,8,NOT WS_GROUP + LTEXT "Ceci n'indique pas forcément que les paquets concernés" + "ne fonctionneront pas, mais consultez " + "/var/log/setup.log.full avant de reporter un problème.", + IDC_STATIC,21,9,239,16,NOT WS_GROUP + EDITTEXT IDC_POSTINSTALL_EDIT,7,41,303,112,WS_VSCROLL | WS_HSCROLL | + ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL | + ES_AUTOVSCROLL +END + +IDD_FILE_INUSE DIALOG 0, 0, SETUP_MEDIUM_DIALOG_DIMS +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +CAPTION "Détection d'un fichier en cours d'utilisation" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDI_WARNING,IDC_HEADICON,10,10 + LTEXT "Impossible d'extraire %s", + IDC_FILE_INUSE_MSG,33,10,234,8,SS_PATHELLIPSIS + LTEXT "Ce fichier est en cours d'utilisation par : ", + IDC_STATIC,33,28,234,8 + EDITTEXT IDC_FILE_INUSE_EDIT,33,40,234,32,WS_VSCROLL | + ES_LEFT | ES_MULTILINE | ES_READONLY | + ES_AUTOVSCROLL | NOT WS_TABSTOP + LTEXT "Choisir 'Recommencer' pour recommencer, " + "Choisir 'Stop' pour arrêter les process et recommencer, ou " + "Choisir 'Continuer' pour procéder (un reboot sera nécessaire).", + IDC_FILE_INUSE_HELP,33,80,234,24,NOT WS_GROUP + PUSHBUTTON "&Recommencer",IDIGNORE,45,112,55,15 + DEFPUSHBUTTON "&Stop",IDRETRY,111,112,55,15 + PUSHBUTTON "&Continuer",IDCONTINUE,177,112,55,15 +END + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_ROOT_SLASH "Attention : nous recommandons de ne PAS utiliser la racine du disque dur comme racine de Cygwin pour éviter des conflits avec d'autres programmes. Continuer quand même ?" + IDS_ROOT_SPACE "Vous ne devriez pas utiliser un chemin racine qui inclus des espaces dans les noms de dossiers. Continuer quand même ?" + IDS_ERR_OPEN_WRITE "Impossible d'ouvrir %s en écriture : %s" + IDS_SETUPINI_MISSING "Impossible de récupérer %s depuis « %s »" + IDS_OLD_SETUPINI "Ce fichier setup.ini est plus ancien que celui utilisé lors de la dernière installation de Cygwin. Continuer quand même ?" + IDS_NOTHING_INSTALLED "Rien à installer" + IDS_INSTALL_COMPLETE "Installation terminée" + IDS_REBOOT_REQUIRED "Les fichiers en cours d'utilisation ont été remplacés. Vous devriez redémarrer dès que possible pour activer ces versions. Cygwin pourrait fonctionner de façon incorrecte jusqu'au redémarrage." + IDS_ERR_OPEN_READ "Impossible d'ouvrir %s en lecture : %s" + IDS_ROOT_ABSOLUTE "Le dossier d'installation doit être absolu, avec à la fois un identificateur de lecteur et une barre oblique au début : C:\\Cygwin" + IDS_DOWNLOAD_COMPLETE "Téléchargement terminé" + IDS_NOLOGFILE "Impossible d'ouvrir le fichier de trace %s en écriture" + IDS_UNINSTALL_COMPLETE "Désinstallation terminée" + IDS_ERR_CHDIR "Impossible de changer le dossier vers %s : %s [%.8x]" + IDS_OLD_SETUP_VERSION "Cet assistant est en version %s, mais setup.ini indique que la version %s est disponible.\nVous devriez le mettre à jour pour avoir les dernière fonctionnalités et corrections de bogues." + IDS_DOWNLOAD_INCOMPLETE "Téléchargement incomplet. Recommencer ?" + IDS_DOWNLOAD_INCOMPLETE_EXIT "Téléchargement incomplet. Vérifiez %s pour avoir des détails" + IDS_INSTALL_ERROR "Erreur d'installation (%s), Continuer avec les autres paquets ?" + IDS_INSTALL_INCOMPLETE "Installation incomplète. Vérifiez %s pour les détails" + IDS_CORRUPT_PACKAGE "Le fichier du paquet %s a une copie locale altérée, supprimez la et recommencez." + IDS_QUERY_CORRUPT "Le fichier %s est corrompu. Effacer et re-télécharger ?" + IDS_SKIP_PACKAGE "%s\nVoulez-vous passer ce paquet ?" + IDS_UNCAUGHT_EXCEPTION "Erreur Fatale : exception non traitée\nThread : %s\nType : %s\nMessage : %s" + IDS_UNCAUGHT_EXCEPTION_WITH_ERRNO "Erreur Fatale : exception non traitée\nThread : %s\nType : %s\nMessage: %s\nAppErrNo : %d" + IDS_TRUSTKEEP_TOOLTIP "Garde tous les paquets à la version installée. " + "Ceci est équivalent à demander à l'assistant de ne faire aucun " + "changement aux paquets." + IDS_TRUSTCURR_TOOLTIP "Sélectionne globalement la version qui est actuellement " + "considérée comme la meilleure (RECOMMANDÉ)." + IDS_TRUSTSYNC_TOOLTIP "Sélectionne globalement la version qui est disponible " + "dans le site, éventuellement une version plus ancienne." + IDS_TRUSTEXP_TOOLTIP "Autoriser les versions de test." + IDS_VIEWBUTTON_TOOLTIP "Itérer les différentes vues des paquets. Ceci détermine" + " quels paquets seront montrés dans la vue ci-dessous.\r\n" + "\r\n" + "Catégorie : regroupe par catégorie de paquets. Cliquez sur '+' pour étendre.\r\n" + "\r\n" + "Tout : montre tous les paquets.\r\n" + "\r\n" + "En attente : montre uniquement les paquets à ajouter, enlever ou mettre à jour. " + "Ceci montre ce que l'assistant est sur le point de modifier " + "lors de l'appui sur 'Suivant'.\r\n" + "\r\n" + "À jour : montre les paquets installés qui ne nécessitent pas d'action.\r\n" + "\r\n" + "Non installé : montre les paquets non installés ou qui ne sont pas " + "sélectionnés pour installation.\r\n" + "\r\n" + "Choisi : montre les paquets installés qui ont été sélectionnés, et non installés " + "pour résoudre une dépendance." + IDS_HIDEOBS_TOOLTIP "L'assistant cachera les paquets des catégories dont " + "le nom commence par '_'. Ces paquets sont vides et sont des emplacements " + "pour des paquets éliminés ou renommés, ou encore des paquets " + "d'infrastructure gérés automatiquement." + IDS_SIG_INVALID "Erreur pour le miroir : la signature de Setup.ini %s de %s est impossible à vérifier.\nLe miroir est peut-être corrompu ? Setup.ini rejeté." + IDS_CRYPTO_ERROR "Erreur interne : erreur %d %s de la librairie gcrypt" + IDS_SEARCH_TOOLTIP "Chercher cette valeur dans les noms des paquets." + IDS_LOCAL_DIR_DOWNLOAD "Choisir un dossier pour enregistrer les fichiers " + "téléchargés. Ce dossier sera créé s'il n'existe pas." + IDS_LOCAL_DIR_INSTALL "Choisir un dossier où l'assistant ira chercher les " + "fichiers téléchargés." + IDS_MAYBE_MKDIR "Dossier %s absent, voulez-vous le créer ?" + IDS_CANT_MKDIR "Impossible de créer le dossier %s, désolé. (Disque plein ou uniquement en lecture ?)" + IDS_NO_LOCALDIR "Dossier local des paquets %s absent.\nVoulez-vous efface les paquets, \n" + "mais il n'y aura rien à installer\n\nChoisir OK si c'est ce que vous voulez\nou Annuler pour choisir un autre dossier." + IDS_ELEVATED "Passer l'installation au process Administrateur." + IDS_INSTALLEDB_VERSION "Version de INSTALLED.DB inconnue" + IDS_NO_MIRROR_LST "Impossible de télécharger la liste des sites miroirs" + IDS_PROGRESS_PROGRESS "Progression :" + IDS_PROGRESS_PACKAGE "Paquet :" + IDS_PROGRESS_CONNECTING "Connection..." + IDS_PROGRESS_CHECKING "Recherche de paquets à télécharger..." + IDS_PROGRESS_DOWNLOADING "Télécharge..." + IDS_PROGRESS_PARSING "Analyse..." + IDS_PROGRESS_PREREMOVE "Lancement du script de pré-désinstallation..." + IDS_PROGRESS_UNINSTALL "Désinstalle..." + IDS_PROGRESS_INSTALL "Installe..." + IDS_PROGRESS_CALCULATING "Calcul..." + IDS_PROGRESS_POSTINSTALL "Exécution..." + IDS_PROGRESS_SOLVING "Résolution des dépendences..." + IDS_ACTION_DEFAULT "Default" + IDS_ACTION_INSTALL "Installe" + IDS_ACTION_UNINSTALL "Désinstalle" + IDS_ACTION_SKIP "Passe" + IDS_ACTION_KEEP "Garde" + IDS_ACTION_REINSTALL "Réinstalle" + IDS_ACTION_RETRIEVE "Récupère" + IDS_ACTION_UNKNOWN "Inconnu" + IDS_ACTION_SOURCE "Source" + IDS_VIEW_FULL "Tout" + IDS_VIEW_PENDING "En attente" + IDS_VIEW_UPTODATE "À jour" + IDS_VIEW_NOTINSTALLED "Non installé" + IDS_VIEW_PICKED "Choisi" + IDS_VIEW_CATEGORY "Catégorie" + IDS_COLUMN_PACKAGE "Paquet" + IDS_COLUMN_CURRENT "Actuel" + IDS_COLUMN_NEW "Nouveau" + IDS_COLUMN_SOURCE "Src?" + IDS_COLUMN_CATEGORIES "Catégories" + IDS_COLUMN_SIZE "Taille" + IDS_COLUMN_DESCR "Description" + IDS_MBOX_CAPTION "Assistant Cygwin" + IDS_EXTRACTION_FAILED "Impossible d'extraire /%s -- paquet corrompu ?\r\n" + IDS_EXTRACTION_INUSE + "Incapable d'extraire /%s -- erreur à l'écriture du fichier\r\n" + "Le fichier est utilisé ou une autre erreur est survenue.\r\n" + "Arrêtez tous les processus Cygwin et sélectionnez «Recommencer», ou\r\n" + "«Continuer» pour poursuivre (il faudra redémarrer).\r\n" + IDS_INSTALL_OLD_CYGWIN "Une ancienne version de cygwin1.dll a été trouvée ici :\r\n%s\r\nEffacer ?" + IDS_INSTALL_DELETE_OLD_CYGWIN_FAILED "Impossible de supprimer le fichier %s.\r\n" + "La DLL est peut être utilisée par une autre application ?\r\n" + "Vous devriez effacer la vieille version de cygwin1.dll " + "dès que possible." + IDS_SHELLLINK_FAILED + "CoCreateInstance : échec avec erreur 0x%x.\n" + "L'assistant ne sera pas capable de créer les icônes " + "Cygwin dans le menu Démarrer ou sur le bureau." + IDS_UNSUPPORTED_WINDOWS_VERSION "Cygwin n'est pas supporté pour cette version de Windows" + IDS_MOUNT_REGISTRY_KEY_FAILED "Impossible de créer la clé de registre pour enregistrer le chemin d'installation" + IDS_NIO_ERROR "Erreur Internet: %s" + IDS_PREREQ_UNSOLVED_PROBLEMS + "ATTENTION - Problèmes non résolus" + "\r\n\r\n" + "Certains paquets ne fonctionneront pas correctement si vous continuez." + "\r\n\r\n" + "Voulez vous continuer (NON RECOMMANDÉ) ?" + IDS_MIXED_BITNESS_ERROR + "Erreur CPU cible" + "\r\n\r\n" + "Vous essayez d'installer une version %s bits de Cygwin dans un dossier " + "qui contient une version %s bits de Cygwin. Si vous insistez, vous aller " + "casser l'installation existante." + "\r\n\r\n" + "Utilisez setup-%s.exe pour mettre à jour votre installation %s bits de Cygwin, " + "ou choisissez un autre dossier pour votre installation %s bits." + IDS_GET_SITELIST_ERROR + "Impossible d'avoir la liste des sites de téléchargement.\r\n" + "Vérifiez que vos paramètres réseau sont corrects et réessayez." + IDS_CONFIRM_EXIT "Voulez-vous vraiment quitter l'assistant ? Les téléchargements ou installations en cours seront annulés." + IDS_CONTINUE "Continuer" +END diff --git a/resource.h b/resource.h index 4f1c3cf8..7b46a2ab 100644 --- a/resource.h +++ b/resource.h @@ -2,7 +2,6 @@ #define IDS_ROOT_SLASH 100 #define IDS_ROOT_SPACE 101 -#define IDS_MIRROR_LST 102 #define IDS_ERR_OPEN_WRITE 103 #define IDS_SETUPINI_MISSING 104 #define IDS_OLD_SETUPINI 105 @@ -76,6 +75,20 @@ #define IDS_COLUMN_CATEGORIES 176 #define IDS_COLUMN_SIZE 177 #define IDS_COLUMN_DESCR 178 +#define IDS_MBOX_CAPTION 179 +#define IDS_EXTRACTION_FAILED 180 +#define IDS_INSTALL_DELETE_OLD_CYGWIN_FAILED 181 +#define IDS_INSTALL_OLD_CYGWIN 182 +#define IDS_SHELLLINK_FAILED 183 +#define IDS_UNSUPPORTED_WINDOWS_VERSION 184 +#define IDS_MOUNT_REGISTRY_KEY_FAILED 185 +#define IDS_NIO_ERROR 186 +#define IDS_PREREQ_UNSOLVED_PROBLEMS 187 +#define IDS_MIXED_BITNESS_ERROR 188 +#define IDS_GET_SITELIST_ERROR 189 +#define IDS_CONFIRM_EXIT 190 +#define IDS_EXTRACTION_INUSE 191 +#define IDS_CONTINUE 192 // Dialogs diff --git a/root.cc b/root.cc index cf2bc320..6fc25b9e 100644 --- a/root.cc +++ b/root.cc @@ -152,7 +152,6 @@ static int directory_contains_wrong_version (HWND h) { HANDLE fh; - char text[512]; std::string cygwin_dll = get_root_dir() + "\\bin\\cygwin1.dll"; /* Check if we have a cygwin1.dll. If not, this is a new install. @@ -211,17 +210,8 @@ directory_contains_wrong_version (HWND h) /* Forestall mixing. */ const char *setup_ver = is_64bit ? "64" : "32"; const char *inst_ver = is_64bit ? "32" : "64"; - snprintf (text, sizeof text, - "You're trying to install a %s bit version of Cygwin into a directory\n" - "containing a %s bit version of Cygwin. Continuing to do so would\n" - "break the existing installation.\n\n" - "Either run http://cygwin.com/setup-%s.exe to update your\n" - "existing %s bit installation of Cygwin, or choose another directory\n" - "for your %s bit installation.", - setup_ver, inst_ver, - is_64bit ? "x86" : "x86_64", - inst_ver, setup_ver); - mbox (h, text, "Target CPU mismatch", MB_OK); + mbox (h, IDS_MIXED_BITNESS_ERROR, MB_OK, + setup_ver, inst_ver, is_64bit ? "x86" : "x86_64", inst_ver, setup_ver); return 1; } diff --git a/site.cc b/site.cc index ed3b95f2..57f54dde 100644 --- a/site.cc +++ b/site.cc @@ -41,6 +41,8 @@ #include "Exception.h" #include "String++.h" +#define MIRROR_LIST_URL "https://cygwin.com/mirrors.lst" + extern ThreeBarProgressPage Progress; /* @@ -352,8 +354,6 @@ migrate_selected_site_list() static int get_site_list (HINSTANCE h, HWND owner) { - char mirror_url[1000]; - char *theMirrorString, *theCachedString; if (UnsupportedOption) @@ -372,10 +372,7 @@ get_site_list (HINSTANCE h, HWND owner) cached_mirrors = ""; } - if (LoadString (h, IDS_MIRROR_LST, mirror_url, sizeof (mirror_url)) <= 0) - return 1; - - std::string mirrors = OnlySiteOption ? std::string ("") : get_url_to_string (mirror_url, owner); + std::string mirrors = OnlySiteOption ? std::string ("") : get_url_to_string (MIRROR_LIST_URL, owner); if (mirrors.size()) cache_needs_writing = true; else @@ -453,6 +450,8 @@ do_download_site_info_thread (void *p) HWND h; context = (HANDLE *) p; + SetThreadUILanguage(langid); + try { hinst = (HINSTANCE) (context[0]); @@ -462,9 +461,7 @@ do_download_site_info_thread (void *p) { // Error: Couldn't download the site info. // Go back to the Net setup page. - mbox (h, TEXT ("Can't get list of download sites.\n") - TEXT("Make sure your network settings are correct and try again."), - NULL, MB_OK); + mbox (h, IDS_GET_SITELIST_ERROR, MB_OK); // Tell the progress page that we're done downloading Progress.PostMessageNow (WM_APP_SITE_INFO_DOWNLOAD_COMPLETE, 0, IDD_NET); diff --git a/splash.cc b/splash.cc index 73cdd9c7..450ccc04 100644 --- a/splash.cc +++ b/splash.cc @@ -21,6 +21,9 @@ #include "splash.h" #include "ini.h" +#define SPLASH_URL "https://cygwin.com" +#define SPLASH_COPYRIGHT "Copyright 2000-2021" + static ControlAdjuster::ControlInfo SplashControlsInfo[] = { { IDC_SPLASH_TEXT, CP_STRETCH, CP_STRETCH }, { IDC_SPLASH_ICON, CP_LEFT, CP_TOP }, @@ -49,5 +52,7 @@ SplashPage::OnInit () ver += is_64bit ? " (64 bit)" : " (32 bit)"; SetDlgItemFont(IDC_VERSION, "Arial", 10, FW_BOLD); ::SetWindowText (GetDlgItem (IDC_VERSION), ver.c_str()); - makeClickable (IDC_SPLASH_URL, "https://cygwin.com"); + ::SetWindowText (GetDlgItem (IDC_SPLASH_COPYR), SPLASH_COPYRIGHT); + ::SetWindowText (GetDlgItem (IDC_SPLASH_URL), SPLASH_URL); + makeClickable (IDC_SPLASH_URL, SPLASH_URL); } diff --git a/state.cc b/state.cc index 8b926037..111b890a 100644 --- a/state.cc +++ b/state.cc @@ -27,3 +27,5 @@ std::string local_dir; int root_scope; int root_menu; int root_desktop; + +LANGID langid; diff --git a/state.h b/state.h index 6632d67a..b211de38 100644 --- a/state.h +++ b/state.h @@ -16,6 +16,8 @@ #ifndef SETUP_STATE_H #define SETUP_STATE_H +#include "win32.h" + /* The purpose of this file is to contain all the global variables that define the "state" of the install, that is, all the information that the user has provided so far. These are set by @@ -44,4 +46,6 @@ extern int root_scope; extern int root_menu; extern int root_desktop; +extern LANGID langid; + #endif /* SETUP_STATE_H */ diff --git a/threebar.cc b/threebar.cc index f0f7473e..739ca524 100644 --- a/threebar.cc +++ b/threebar.cc @@ -221,7 +221,7 @@ ThreeBarProgressPage::OnMessageApp (UINT uMsg, WPARAM wParam, LPARAM lParam) } else { - fatal("Unexpected fallthrough from the download thread", NO_ERROR); + Log (LOG_PLAIN) << "Unexpected fallthrough from the download thread" << endLog; } break; }