From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#8562: Emacs 23.1 and later don't work in windows 98 Date: Fri, 04 Nov 2011 13:42:11 +0200 Message-ID: <83k47gktbg.fsf@gnu.org> References: <83d3k88k6o.fsf@gnu.org> <83wri4kpwb.fsf@gnu.org> <83d3j9e2pn.fsf@gnu.org> <8339k3esws.fsf@gnu.org> <83wrhed91s.fsf@gnu.org> <838vtscbeu.fsf@gnu.org> <83vcwvc1eq.fsf@gnu.org> <83vcwsf2ra.fsf@gnu.org> <83k4d6fuph.fsf@gnu.org> <83pqmve2s2.fsf@gnu.org> <837h92dqai.fsf@gnu.org> <83r579c6wn.fsf@gnu.org> <8362ohcrht.fsf@gnu.org> <83ehyxc6ts.fsf@gnu.org> <83wrbpa02v.fsf@gnu.org> <83pqhh9uz7.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1320406960 17959 80.91.229.12 (4 Nov 2011 11:42:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Nov 2011 11:42:40 +0000 (UTC) Cc: 8562@debbugs.gnu.org To: oslsachem Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 04 12:42:36 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RMIAL-0001tu-Uu for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Nov 2011 12:42:34 +0100 Original-Received: from localhost ([::1]:59623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMIAL-0002EE-Bt for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Nov 2011 07:42:33 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMIAI-0002E3-Bw for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2011 07:42:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMIAG-0000xQ-PK for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2011 07:42:30 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMIAG-0000xM-Nd for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2011 07:42:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RMICk-00084S-Eq for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2011 07:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Nov 2011 11:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8562 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 8562-submit@debbugs.gnu.org id=B8562.132040709831000 (code B ref 8562); Fri, 04 Nov 2011 11:45:02 +0000 Original-Received: (at 8562) by debbugs.gnu.org; 4 Nov 2011 11:44:58 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMICf-00083x-TK for submit@debbugs.gnu.org; Fri, 04 Nov 2011 07:44:58 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMICc-00083n-Fn for 8562@debbugs.gnu.org; Fri, 04 Nov 2011 07:44:55 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LU400B00WF5N800@a-mtaout22.012.net.il> for 8562@debbugs.gnu.org; Fri, 04 Nov 2011 13:42:07 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.228.70.69]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LU400BHWWI5A040@a-mtaout22.012.net.il>; Fri, 04 Nov 2011 13:42:07 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 04 Nov 2011 07:45:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53510 Archived-At: > Date: Sun, 30 Oct 2011 00:24:31 +0200 > From: oslsachem > Cc: 8562@debbugs.gnu.org > > - I have commented out the message box code (w32font.c:197) and > replaced it with just 'exit(1)': > After this change, runemacs.exe launches emacs.exe and now this > process ends instead of staying in the background. > > - I have changed the value of start.wShowWindow to SW_SHOW (runemacs.c:148): > After this change, the unicows.dll error dialog window is shown (with > a console window behind it, which actually defeats the purpose of > runemacs.exe to begin with) > > > >From this I guess that: > - the messagebox is actually hidden even though it is waiting for > input from the user. > - the visibility of the messagebox is linked to the visibility of the > console window created for the process from which it is called ( Even > though this behaviour can't be reproduced in windows XP) Maybe. But since we are in a pretest, I opted for a safer solution: add a similar test to runemacs. The patch is below; please try applying it to the current trunk of Emacs 24. If it works, I will commit it. Thanks. === modified file 'nt/ChangeLog' --- a/nt/ChangeLog 2011-11-04 11:36:25 +0000 +++ b/nt/ChangeLog 2011-11-04 11:41:29 +0000 @@ -1,3 +1,11 @@ +2011-11-04 Eli Zaretskii + + * runemacs.c (ensure_unicows_dll): New function, tries to load + UNICOWS.DLL on Windows 9X. + (WinMain): If ensure_unicows_dll fails to find UNICOWS.DLL, + display a dialog to the effect that Emacs cannot be started. + (Bug#8562) + 2011-10-28 Eli Zaretskii * README.W32: Mention UNICOWS.DLL as prerequisite for running === modified file 'nt/runemacs.c' --- a/nt/runemacs.c 2011-11-04 11:36:25 +0000 +++ b/nt/runemacs.c 2011-11-04 11:41:29 +0000 @@ -45,6 +45,7 @@ #include static void set_user_model_id (void); +static int ensure_unicows_dll (void); int WINAPI WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) @@ -59,6 +60,9 @@ char *p; char modname[MAX_PATH]; + if (!ensure_unicows_dll ()) + goto error; + set_user_model_id (); if (!GetModuleFileName (NULL, modname, MAX_PATH)) @@ -203,3 +207,43 @@ } } +static int +ensure_unicows_dll (void) +{ + OSVERSIONINFO os_ver; + HMODULE h; + + ZeroMemory (&os_ver, sizeof (OSVERSIONINFO)); + os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + if (!GetVersionEx (&os_ver)) + return 0; + + if (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + { + h = LoadLibrary ("Unicows.dll"); + if (!h) + { + int button; + + button = MessageBox (NULL, + "Emacs cannot load the UNICOWS.DLL library.\n" + "This library is essential for using Emacs\n" + "on this system. You need to install it.\n\n" + "However, you can still use Emacs by invoking\n" + "it with the '-nw' command-line option.\n\n" + "Emacs will exit when you click OK.", + "Emacs cannot load UNICOWS.DLL", + MB_ICONERROR | MB_TASKMODAL + | MB_SETFOREGROUND | MB_OK); + switch (button) + { + case IDOK: + default: + return 0; + } + } + FreeLibrary (h); + return 1; + } + return 1; +}