pidgin/win32/winpidgin.c

Sun, 01 Nov 2009 04:56:45 +0000

author
Daniel Atallah <datallah@pidgin.im>
date
Sun, 01 Nov 2009 04:56:45 +0000
branch
next.minor
changeset 29635
e30bf262a1f2
parent 29634
80dbf6f777c4
child 29636
cfd62d35ff49
permissions
-rw-r--r--

Use an updated exchndl.dll that supports setting the log file path manually and
external debug symbols (looks in the specified debug symbols dir and also for a
<modulename>.dbgsym alongside <modulename>).

15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
1 /*
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
2 * winpidgin.c
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
3 *
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
4 * Date: June, 2002
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
5 * Description: Entry point for win32 pidgin, and various win32 dependant
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
6 * routines.
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
7 *
15931
716b5fac1895 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
8 * Pidgin is the legal property of its developers, whose names are too numerous
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
10 * source distribution.
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
11 *
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
16 *
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
21 *
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19081
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
25 *
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
26 */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
27
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
28 /* This is for ATTACH_PARENT_PROCESS */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
29 #ifndef _WIN32_WINNT
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
30 #define _WIN32_WINNT 0x501
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
31 #endif
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
32 #include <windows.h>
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
33 #include <fcntl.h>
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
34 #include <stdlib.h>
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
35 #include <string.h>
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
36 #include <stdio.h>
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
37 #include <sys/types.h>
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
38 #include <sys/stat.h>
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
39 #include "config.h"
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
40
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
41 /* These will hopefully be in the win32api next time it is updated - at which point, we'll remove them */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
42 #ifndef LANG_PERSIAN
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
43 #define LANG_PERSIAN 0x29
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
44 #endif
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
45 #ifndef LANG_BOSNIAN
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
46 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
47 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
48 #endif
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
49 #ifndef SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
50 #define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
51 #endif
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
52 #ifndef LANG_XHOSA
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
53 #define LANG_XHOSA 0x34
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
54 #endif
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
55
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
56
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
57 typedef int (CALLBACK* LPFNPIDGINMAIN)(HINSTANCE, int, char**);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
58 typedef void (CALLBACK* LPFNSETDLLDIRECTORY)(LPCTSTR);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
59 typedef BOOL (CALLBACK* LPFNATTACHCONSOLE)(DWORD);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
60
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
61 static BOOL portable_mode = FALSE;
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
62
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
63 /*
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
64 * PROTOTYPES
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
65 */
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
66 static LPFNPIDGINMAIN pidgin_main = NULL;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
67 static LPFNSETDLLDIRECTORY MySetDllDirectory = NULL;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
68
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
69 static const char *get_win32_error_message(DWORD err) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
70 static char err_msg[512];
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
71
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
72 FormatMessage(
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
73 FORMAT_MESSAGE_FROM_SYSTEM,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
74 NULL, err,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
75 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
76 (LPTSTR) &err_msg, sizeof(err_msg), NULL);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
77
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
78 return err_msg;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
79 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
80
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
81 static BOOL read_reg_string(HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
82 HKEY hkey;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
83 BOOL ret = FALSE;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
84 LONG retv;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
85
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
86 if (ERROR_SUCCESS == (retv = RegOpenKeyEx(key, sub_key, 0,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
87 KEY_QUERY_VALUE, &hkey))) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
88 if (ERROR_SUCCESS == (retv = RegQueryValueEx(hkey, val_name,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
89 NULL, NULL, data, data_len)))
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
90 ret = TRUE;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
91 else {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
92 const char *err_msg = get_win32_error_message(retv);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
93
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
94 printf("Could not read reg key '%s' subkey '%s' value: '%s'.\nMessage: (%ld) %s\n",
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
95 (key == HKEY_LOCAL_MACHINE) ? "HKLM"
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
96 : ((key == HKEY_CURRENT_USER) ? "HKCU" : "???"),
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
97 sub_key, val_name, retv, err_msg);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
98 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
99 RegCloseKey(hkey);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
100 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
101 else {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
102 TCHAR szBuf[80];
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
103
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
104 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, retv, 0,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
105 (LPTSTR) &szBuf, sizeof(szBuf), NULL);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
106 printf("Could not open reg subkey: %s\nError: (%ld) %s\n",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
107 sub_key, retv, szBuf);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
108 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
109
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
110 return ret;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
111 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
112
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
113 static void common_dll_prep(const char *path) {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
114 HMODULE hmod;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
115 HKEY hkey;
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
116 struct _stat stat_buf;
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
117 char test_path[MAX_PATH + 1];
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
118
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
119 _snprintf(test_path, sizeof(test_path), "%s\\libgtk-win32-2.0-0.dll",
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
120 path);
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
121 test_path[sizeof(test_path) - 1] = '\0';
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
122
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
123 if (_stat(test_path, &stat_buf) != 0) {
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
124 printf("Unable to determine GTK+ path. \n"
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
125 "Assuming GTK+ is in the PATH.\n");
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
126 return;
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
127 }
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
128
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
129
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
130 printf("GTK+ path found: %s\n", path);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
131
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
132 if ((hmod = GetModuleHandle("kernel32.dll"))) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
133 MySetDllDirectory = (LPFNSETDLLDIRECTORY) GetProcAddress(
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
134 hmod, "SetDllDirectoryA");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
135 if (!MySetDllDirectory)
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
136 printf("SetDllDirectory not supported\n");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
137 } else
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
138 printf("Error getting kernel32.dll module handle\n");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
139
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
140 /* For Windows XP SP1+ / Server 2003 we use SetDllDirectory to avoid dll hell */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
141 if (MySetDllDirectory) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
142 printf("Using SetDllDirectory\n");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
143 MySetDllDirectory(path);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
144 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
145
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
146 /* For the rest, we set the current directory and make sure
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
147 * SafeDllSearch is set to 0 where needed. */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
148 else {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
149 OSVERSIONINFO osinfo;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
150
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
151 printf("Setting current directory to GTK+ dll directory\n");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
152 SetCurrentDirectory(path);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
153 /* For Windows 2000 (SP3+) / WinXP (No SP):
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
154 * If SafeDllSearchMode is set to 1, Windows system directories are
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
155 * searched for dlls before the current directory. Therefore we set it
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
156 * to 0.
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
157 */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
158 osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
159 GetVersionEx(&osinfo);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
160 if ((osinfo.dwMajorVersion == 5 &&
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
161 osinfo.dwMinorVersion == 0 &&
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
162 strcmp(osinfo.szCSDVersion, "Service Pack 3") >= 0) ||
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
163 (osinfo.dwMajorVersion == 5 &&
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
164 osinfo.dwMinorVersion == 1 &&
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
165 strcmp(osinfo.szCSDVersion, "") >= 0)
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
166 ) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
167 DWORD regval = 1;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
168 DWORD reglen = sizeof(DWORD);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
169
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
170 printf("Using Win2k (SP3+) / WinXP (No SP)... Checking SafeDllSearch\n");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
171 read_reg_string(HKEY_LOCAL_MACHINE,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
172 "System\\CurrentControlSet\\Control\\Session Manager",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
173 "SafeDllSearchMode",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
174 (LPBYTE) &regval,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
175 &reglen);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
176
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
177 if (regval != 0) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
178 printf("Trying to set SafeDllSearchMode to 0\n");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
179 regval = 0;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
180 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
181 "System\\CurrentControlSet\\Control\\Session Manager",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
182 0, KEY_SET_VALUE, &hkey
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
183 ) == ERROR_SUCCESS) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
184 if (RegSetValueEx(hkey,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
185 "SafeDllSearchMode", 0,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
186 REG_DWORD, (LPBYTE) &regval,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
187 sizeof(DWORD)
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
188 ) != ERROR_SUCCESS)
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
189 printf("Error writing SafeDllSearchMode. Error: %u\n",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
190 (UINT) GetLastError());
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
191 RegCloseKey(hkey);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
192 } else
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
193 printf("Error opening Session Manager key for writing. Error: %u\n",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
194 (UINT) GetLastError());
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
195 } else
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
196 printf("SafeDllSearchMode is set to 0\n");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
197 }/*end else*/
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
198 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
199 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
200
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
201 static void portable_mode_dll_prep(const char *pidgin_dir) {
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
202 /* need to be able to fit MAX_PATH + "PIDGIN_ASPELL_DIR=\\Aspell\\bin" in path2 */
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
203 char path[MAX_PATH + 1];
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
204 char path2[MAX_PATH + 33];
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
205 const char *prev = NULL;
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
206
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
207 /* We assume that GTK+ is installed under \\path\to\Pidgin\..\GTK
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
208 * First we find \\path\to
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
209 */
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
210 if (*pidgin_dir) {
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
211 /* pidgin_dir points to \\path\to\Pidgin */
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
212 const char *tmp = pidgin_dir;
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
213
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
214 while ((tmp = strchr(tmp, '\\'))) {
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
215 prev = tmp;
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
216 tmp++;
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
217 }
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
218 }
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
219
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
220 if (prev) {
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
221 int cnt = (prev - pidgin_dir);
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
222 strncpy(path, pidgin_dir, cnt);
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
223 path[cnt] = '\0';
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
224 } else {
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
225 printf("Unable to determine current executable path. \n"
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
226 "This will prevent the settings dir from being set.\n"
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
227 "Assuming GTK+ is in the PATH.\n");
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
228 return;
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
229 }
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
230
24433
a5213aeff14c Set %HOME% when running in portable mode so that GTK+'s files get stored in the
Daniel Atallah <datallah@pidgin.im>
parents: 23936
diff changeset
231 /* Set $HOME so that the GTK+ settings get stored in the right place */
a5213aeff14c Set %HOME% when running in portable mode so that GTK+'s files get stored in the
Daniel Atallah <datallah@pidgin.im>
parents: 23936
diff changeset
232 _snprintf(path2, sizeof(path2), "HOME=%s", path);
a5213aeff14c Set %HOME% when running in portable mode so that GTK+'s files get stored in the
Daniel Atallah <datallah@pidgin.im>
parents: 23936
diff changeset
233 _putenv(path2);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
234
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
235 /* Set up the settings dir base to be \\path\to
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
236 * The actual settings dir will be \\path\to\.purple */
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
237 _snprintf(path2, sizeof(path2), "PURPLEHOME=%s", path);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
238 printf("Setting settings dir: %s\n", path2);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
239 _putenv(path2);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
240
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
241 _snprintf(path2, sizeof(path2), "PIDGIN_ASPELL_DIR=%s\\Aspell\\bin", path);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
242 printf("%s\n", path2);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
243 _putenv(path2);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
244
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
245 /* set the GTK+ path to be \\path\to\GTK\bin */
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
246 strcat(path, "\\GTK\\bin");
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
247
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
248 common_dll_prep(path);
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
249 }
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
250
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
251 static void dll_prep(const char *pidgin_dir) {
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
252 char gtk_path[MAX_PATH + 1];
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
253 gtk_path[0] = '\0';
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
254
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
255 if (*pidgin_dir) {
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
256 _snprintf(gtk_path, sizeof(gtk_path), "%s\\Gtk\\bin", pidgin_dir);
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
257 gtk_path[sizeof(gtk_path)] = '\0';
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
258 }
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
259
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
260 common_dll_prep(gtk_path);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
261 }
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
262
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
263 static char* winpidgin_lcid_to_posix(LCID lcid) {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
264 char *posix = NULL;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
265 int lang_id = PRIMARYLANGID(lcid);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
266 int sub_id = SUBLANGID(lcid);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
267
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
268 switch (lang_id) {
18771
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
269 case LANG_AFRIKAANS: posix = "af"; break;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
270 case LANG_ARABIC: posix = "ar"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
271 case LANG_AZERI: posix = "az"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
272 case LANG_BENGALI: posix = "bn"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
273 case LANG_BULGARIAN: posix = "bg"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
274 case LANG_CATALAN: posix = "ca"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
275 case LANG_CZECH: posix = "cs"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
276 case LANG_DANISH: posix = "da"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
277 case LANG_ESTONIAN: posix = "et"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
278 case LANG_PERSIAN: posix = "fa"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
279 case LANG_GERMAN: posix = "de"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
280 case LANG_GREEK: posix = "el"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
281 case LANG_ENGLISH:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
282 switch (sub_id) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
283 case SUBLANG_ENGLISH_UK:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
284 posix = "en_GB"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
285 case SUBLANG_ENGLISH_AUS:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
286 posix = "en_AU"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
287 case SUBLANG_ENGLISH_CAN:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
288 posix = "en_CA"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
289 default:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
290 posix = "en"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
291 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
292 break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
293 case LANG_SPANISH: posix = "es"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
294 case LANG_BASQUE: posix = "eu"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
295 case LANG_FINNISH: posix = "fi"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
296 case LANG_FRENCH: posix = "fr"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
297 case LANG_GALICIAN: posix = "gl"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
298 case LANG_GUJARATI: posix = "gu"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
299 case LANG_HEBREW: posix = "he"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
300 case LANG_HINDI: posix = "hi"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
301 case LANG_HUNGARIAN: posix = "hu"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
302 case LANG_ICELANDIC: break;
18771
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
303 case LANG_INDONESIAN: posix = "id"; break;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
304 case LANG_ITALIAN: posix = "it"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
305 case LANG_JAPANESE: posix = "ja"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
306 case LANG_GEORGIAN: posix = "ka"; break;
18771
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
307 case LANG_KANNADA: posix = "kn"; break;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
308 case LANG_KOREAN: posix = "ko"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
309 case LANG_LITHUANIAN: posix = "lt"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
310 case LANG_MACEDONIAN: posix = "mk"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
311 case LANG_DUTCH: posix = "nl"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
312 case LANG_NEPALI: posix = "ne"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
313 case LANG_NORWEGIAN:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
314 switch (sub_id) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
315 case SUBLANG_NORWEGIAN_BOKMAL:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
316 posix = "nb"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
317 case SUBLANG_NORWEGIAN_NYNORSK:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
318 posix = "nn"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
319 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
320 break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
321 case LANG_PUNJABI: posix = "pa"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
322 case LANG_POLISH: posix = "pl"; break;
18771
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
323 case LANG_PASHTO: posix = "ps"; break;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
324 case LANG_PORTUGUESE:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
325 switch (sub_id) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
326 case SUBLANG_PORTUGUESE_BRAZILIAN:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
327 posix = "pt_BR"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
328 default:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
329 posix = "pt"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
330 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
331 break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
332 case LANG_ROMANIAN: posix = "ro"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
333 case LANG_RUSSIAN: posix = "ru"; break;
18771
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
334 case LANG_SLOVAK: posix = "sk"; break;
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
335 case LANG_SLOVENIAN: posix = "sl"; break;
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
336 case LANG_ALBANIAN: posix = "sq"; break;
19081
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
337 /* LANG_CROATIAN == LANG_SERBIAN == LANG_BOSNIAN */
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
338 case LANG_SERBIAN:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
339 switch (sub_id) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
340 case SUBLANG_SERBIAN_LATIN:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
341 posix = "sr@Latn"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
342 case SUBLANG_SERBIAN_CYRILLIC:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
343 posix = "sr"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
344 case SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
345 case SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
346 posix = "bs"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
347 case SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN:
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
348 posix = "hr"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
349 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
350 break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
351 case LANG_SWEDISH: posix = "sv"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
352 case LANG_TAMIL: posix = "ta"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
353 case LANG_TELUGU: posix = "te"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
354 case LANG_THAI: posix = "th"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
355 case LANG_TURKISH: posix = "tr"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
356 case LANG_UKRAINIAN: posix = "uk"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
357 case LANG_VIETNAMESE: posix = "vi"; break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
358 case LANG_XHOSA: posix = "xh"; break;
18771
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
359 case LANG_CHINESE:
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
360 switch (sub_id) {
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
361 case SUBLANG_CHINESE_SIMPLIFIED:
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
362 posix = "zh_CN"; break;
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
363 case SUBLANG_CHINESE_TRADITIONAL:
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
364 posix = "zh_TW"; break;
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
365 default:
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
366 posix = "zh"; break;
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
367 }
6278b40a207f Add win32 LCID lookup mappings for Afrikaans, Indonesian, Kannada, Pashto.
Daniel Atallah <datallah@pidgin.im>
parents: 18770
diff changeset
368 break;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
369 case LANG_URDU: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
370 case LANG_BELARUSIAN: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
371 case LANG_LATVIAN: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
372 case LANG_ARMENIAN: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
373 case LANG_FAEROESE: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
374 case LANG_MALAY: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
375 case LANG_KAZAK: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
376 case LANG_KYRGYZ: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
377 case LANG_SWAHILI: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
378 case LANG_UZBEK: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
379 case LANG_TATAR: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
380 case LANG_ORIYA: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
381 case LANG_MALAYALAM: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
382 case LANG_ASSAMESE: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
383 case LANG_MARATHI: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
384 case LANG_SANSKRIT: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
385 case LANG_MONGOLIAN: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
386 case LANG_KONKANI: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
387 case LANG_MANIPURI: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
388 case LANG_SINDHI: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
389 case LANG_SYRIAC: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
390 case LANG_KASHMIRI: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
391 case LANG_DIVEHI: break;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
392 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
393
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
394 /* Deal with exceptions */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
395 if (posix == NULL) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
396 switch (lcid) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
397 case 0x0455: posix = "my_MM"; break; /* Myanmar (Burmese) */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
398 case 9999: posix = "ku"; break; /* Kurdish (from NSIS) */
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
399 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
400 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
401
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
402 return posix;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
403 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
404
16080
5668a44f275c Fix some overzealous s/gaim/purple/ stuff.
Daniel Atallah <datallah@pidgin.im>
parents: 15931
diff changeset
405 /* Determine and set Pidgin locale as follows (in order of priority):
5668a44f275c Fix some overzealous s/gaim/purple/ stuff.
Daniel Atallah <datallah@pidgin.im>
parents: 15931
diff changeset
406 - Check PIDGINLANG env var
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
407 - Check NSIS Installer Language reg value
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
408 - Use default user locale
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
409 */
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
410 static const char *winpidgin_get_locale() {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
411 const char *locale = NULL;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
412 LCID lcid;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
413 char data[10];
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
414 DWORD datalen = 10;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
415
16080
5668a44f275c Fix some overzealous s/gaim/purple/ stuff.
Daniel Atallah <datallah@pidgin.im>
parents: 15931
diff changeset
416 /* Check if user set PIDGINLANG env var */
5668a44f275c Fix some overzealous s/gaim/purple/ stuff.
Daniel Atallah <datallah@pidgin.im>
parents: 15931
diff changeset
417 if ((locale = getenv("PIDGINLANG")))
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
418 return locale;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
419
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
420 if (!portable_mode && read_reg_string(HKEY_CURRENT_USER, "SOFTWARE\\pidgin",
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
421 "Installer Language", (LPBYTE) &data, &datalen)) {
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
422 if ((locale = winpidgin_lcid_to_posix(atoi(data))))
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
423 return locale;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
424 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
425
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
426 lcid = GetUserDefaultLCID();
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
427 if ((locale = winpidgin_lcid_to_posix(lcid)))
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
428 return locale;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
429
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
430 return "en";
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
431 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
432
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
433 static void winpidgin_set_locale() {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
434 const char *locale = NULL;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
435 char envstr[25];
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
436
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
437 locale = winpidgin_get_locale();
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
438
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
439 _snprintf(envstr, 25, "LANG=%s", locale);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
440 printf("Setting locale: %s\n", envstr);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
441 _putenv(envstr);
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
442 }
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
443
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
444
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
445 static void winpidgin_add_stuff_to_path() {
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
446 char perl_path[MAX_PATH + 1];
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
447 char *ppath = NULL;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
448 char mit_kerberos_path[MAX_PATH + 1];
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
449 char *mpath = NULL;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
450 DWORD plen;
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
451
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
452 printf("%s", "Looking for Perl... ");
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
453
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
454 plen = sizeof(perl_path);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
455 if (read_reg_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Perl", "",
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
456 (LPBYTE) &perl_path, &plen)) {
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
457 /* We *could* check for perl510.dll, but it seems unnecessary. */
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
458 printf("found in '%s'.\n", perl_path);
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
459
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
460 if (perl_path[strlen(perl_path) - 1] != '\\')
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
461 strcat(perl_path, "\\");
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
462 strcat(perl_path, "bin");
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
463
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
464 ppath = perl_path;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
465 } else
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
466 printf("%s", "not found.\n");
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
467
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
468 printf("%s", "Looking for MIT Kerberos... ");
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
469
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
470 plen = sizeof(mit_kerberos_path);
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
471 if (read_reg_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\MIT\\Kerberos", "InstallDir",
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
472 (LPBYTE) &mit_kerberos_path, &plen)) {
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
473 /* We *could* check for gssapi32.dll */
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
474 printf("found in '%s'.\n", mit_kerberos_path);
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
475
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
476 if (mit_kerberos_path[strlen(mit_kerberos_path) - 1] != '\\')
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
477 strcat(mit_kerberos_path, "\\");
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
478 strcat(mit_kerberos_path, "bin");
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
479
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
480 mpath = mit_kerberos_path;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
481 } else
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
482 printf("%s", "not found.\n");
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
483
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
484 if (ppath != NULL || mpath != NULL) {
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
485 const char *path = getenv("PATH");
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
486 BOOL add_ppath = ppath != NULL && (path == NULL || !strstr(path, ppath));
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
487 BOOL add_mpath = mpath != NULL && (path == NULL || !strstr(path, mpath));
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
488 char *newpath;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
489 int newlen;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
490
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
491 if (add_ppath || add_mpath) {
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
492 /* Enough to add "PATH=" + path + ";" + ppath + ";" + mpath + \0 */
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
493 newlen = 6 + (path ? strlen(path) + 1 : 0);
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
494 if (add_ppath)
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
495 newlen += strlen(ppath) + 1;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
496 if (add_mpath)
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
497 newlen += strlen(mpath) + 1;
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
498 newpath = malloc(newlen);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
499 *newpath = '\0';
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
500
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
501 _snprintf(newpath, newlen, "PATH=%s%s%s%s%s%s",
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
502 path ? path : "",
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
503 path ? ";" : "",
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
504 add_ppath ? ppath : "",
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
505 add_ppath ? ";" : "",
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
506 add_mpath ? mpath : "",
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
507 add_mpath ? ";" : "");
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
508
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
509 printf("New PATH: %s\n", newpath);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
510
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
511 _putenv(newpath);
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
512 free(newpath);
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
513 }
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
514 }
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
515 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
516
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
517 #define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13)
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
518 #define PIDGIN_WM_PROTOCOL_HANDLE (WM_APP + 14)
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
519
21971
e00e0d55d129 Allow the user to Retry if Pidgin is running when they start the installer. Fixes #4355
Daniel Atallah <datallah@pidgin.im>
parents: 21613
diff changeset
520 static BOOL winpidgin_set_running(BOOL fail_if_running) {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
521 HANDLE h;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
522
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
523 if ((h = CreateMutex(NULL, FALSE, "pidgin_is_running"))) {
21971
e00e0d55d129 Allow the user to Retry if Pidgin is running when they start the installer. Fixes #4355
Daniel Atallah <datallah@pidgin.im>
parents: 21613
diff changeset
524 DWORD err = GetLastError();
22114
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
525 if (err == ERROR_ALREADY_EXISTS) {
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
526 if (fail_if_running) {
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
527 HWND msg_win;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
528
22114
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
529 printf("An instance of Pidgin is already running.\n");
20257
e52756e57259 applied changes from d6da6a7a5ad01f170f0fd78424183f73200dc78c
Luke Schierer <lschiere@pidgin.im>
parents: 20221
diff changeset
530
22545
71aef7b17ee4 Fix a regression in presenting the existing instance of Pidgin on Windows when the executable is launched a subsequent time. Fixes #5041.
Daniel Atallah <datallah@pidgin.im>
parents: 22114
diff changeset
531 if((msg_win = FindWindowEx(NULL, NULL, TEXT("WinpidginMsgWinCls"), NULL)))
22114
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
532 if(SendMessage(msg_win, PIDGIN_WM_FOCUS_REQUEST, (WPARAM) NULL, (LPARAM) NULL))
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
533 return FALSE;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
534
22114
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
535 /* If we get here, the focus request wasn't successful */
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
536
22114
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
537 MessageBox(NULL,
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
538 "An instance of Pidgin is already running",
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
539 NULL, MB_OK | MB_TOPMOST);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
540
22114
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
541 return FALSE;
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
542 }
272116fabba9 This is how the error handling for the win32 single instance mutex is supposed to work.
Daniel Atallah <datallah@pidgin.im>
parents: 22036
diff changeset
543 } else if (err != ERROR_SUCCESS)
22036
50c4b5826c97 Warning fixes.
Daniel Atallah <datallah@pidgin.im>
parents: 21971
diff changeset
544 printf("Error (%u) accessing \"pidgin_is_running\" mutex.\n", (UINT) err);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
545 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
546 return TRUE;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
547 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
548
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
549 #define PROTO_HANDLER_SWITCH "--protocolhandler="
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
550
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
551 static void handle_protocol(char *cmd) {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
552 char *remote_msg, *tmp1, *tmp2;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
553 int len;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
554 SIZE_T len_written;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
555 HWND msg_win;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
556 DWORD pid;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
557 HANDLE process;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
558
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
559 /* The start of the message */
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
560 tmp1 = cmd + strlen(PROTO_HANDLER_SWITCH);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
561
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
562 /* The end of the message */
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
563 if ((tmp2 = strchr(tmp1, ' ')))
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
564 len = (tmp2 - tmp1);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
565 else
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
566 len = strlen(tmp1);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
567
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
568 if (len == 0) {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
569 printf("No protocol message specified.\n");
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
570 return;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
571 }
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
572
22644
e31ca6858752 Fix protocolhandler invocation. Fixes #5248
Daniel Atallah <datallah@pidgin.im>
parents: 22545
diff changeset
573 if (!(msg_win = FindWindowEx(NULL, NULL, TEXT("WinpidginMsgWinCls"), NULL))) {
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
574 printf("Unable to find an instance of Pidgin to handle protocol message.\n");
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
575 return;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
576 }
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
577
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
578 GetWindowThreadProcessId(msg_win, &pid);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
579 if (!(process = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE, FALSE, pid))) {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
580 DWORD dw = GetLastError();
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
581 const char *err_msg = get_win32_error_message(dw);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
582 printf("Unable to open Pidgin process. (%u) %s\n", (UINT) dw, err_msg);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
583 return;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
584 }
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
585
26999
59b2a8e21382 This is supposed to be a precision formatter.
Daniel Atallah <datallah@pidgin.im>
parents: 24795
diff changeset
586 printf("Trying to handle protocol message:\n'%.*s'\n", len, tmp1);
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
587
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
588 /* MEM_COMMIT initializes the memory to zero,
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
589 * so we don't need to worry that our section of tmp1 isn't nul-terminated */
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
590 if ((remote_msg = (char*) VirtualAllocEx(process, NULL, len + 1, MEM_COMMIT, PAGE_READWRITE))) {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
591 if (WriteProcessMemory(process, remote_msg, tmp1, len, &len_written)) {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
592 if (!SendMessage(msg_win, PIDGIN_WM_PROTOCOL_HANDLE, len_written, (LPARAM) remote_msg))
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
593 printf("Unable to send protocol message to Pidgin instance.\n");
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
594 } else {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
595 DWORD dw = GetLastError();
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
596 const char *err_msg = get_win32_error_message(dw);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
597 printf("Unable to write to remote memory. (%u) %s\n", (UINT) dw, err_msg);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
598 }
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
599
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
600 VirtualFreeEx(process, remote_msg, 0, MEM_RELEASE);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
601 } else {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
602 DWORD dw = GetLastError();
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
603 const char *err_msg = get_win32_error_message(dw);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
604 printf("Unable to allocate remote memory. (%u) %s\n", (UINT) dw, err_msg);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
605 }
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
606
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
607 CloseHandle(process);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
608 }
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
609
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
610
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
611 int _stdcall
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
612 WinMain (struct HINSTANCE__ *hInstance, struct HINSTANCE__ *hPrevInstance,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
613 char *lpszCmdLine, int nCmdShow) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
614 char errbuf[512];
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
615 char pidgin_dir[MAX_PATH];
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
616 char exe_name[MAX_PATH];
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
617 HMODULE hmod;
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
618 char *tmp;
19081
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
619 int pidgin_argc = __argc;
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
620 char **pidgin_argv = __argv;
24795
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
621 int i;
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
622 BOOL debug = FALSE, help = FALSE, version = FALSE, multiple = FALSE;
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
623
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
624 /* If debug or help or version flag used, create console for output */
24795
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
625 for (i = 1; i < __argc; i++) {
28536
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
626 if (strlen(__argv[i]) > 1 && __argv[i][0] == '-') {
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
627 /* check if we're looking at -- or - option */
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
628 if (__argv[i][1] == '-') {
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
629 if (strstr(__argv[i], "--debug") == __argv[i])
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
630 debug = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
631 else if (strstr(__argv[i], "--help") == __argv[i])
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
632 help = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
633 else if (strstr(__argv[i], "--version") == __argv[i])
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
634 version = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
635 else if (strstr(__argv[i], "--multiple") == __argv[i])
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
636 multiple = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
637 } else {
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
638 if (strchr(__argv[i], 'd'))
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
639 debug = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
640 else if (strchr(__argv[i], 'h'))
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
641 help = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
642 else if (strchr(__argv[i], 'v'))
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
643 version = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
644 else if (strchr(__argv[i], 'm'))
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
645 multiple = TRUE;
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
646 }
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
647 }
24795
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
648 }
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
649
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
650 if (debug || help || version) {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
651 /* If stdout hasn't been redirected to a file, alloc a console
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
652 * (_istty() doesn't work for stuff using the GUI subsystem) */
20221
28e31ee832cd applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents: 19859
diff changeset
653 if (_fileno(stdout) == -1 || _fileno(stdout) == -2) {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
654 LPFNATTACHCONSOLE MyAttachConsole = NULL;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
655 if ((hmod = GetModuleHandle("kernel32.dll"))) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
656 MyAttachConsole =
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
657 (LPFNATTACHCONSOLE)
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
658 GetProcAddress(hmod, "AttachConsole");
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
659 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
660 if ((MyAttachConsole && MyAttachConsole(ATTACH_PARENT_PROCESS))
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
661 || AllocConsole()) {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
662 freopen("CONOUT$", "w", stdout);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
663 freopen("CONOUT$", "w", stderr);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
664 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
665 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
666 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
667
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
668 /* If this is a protocol handler invocation, deal with it accordingly */
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
669 if ((tmp = strstr(lpszCmdLine, PROTO_HANDLER_SWITCH)) != NULL) {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
670 handle_protocol(tmp);
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
671 return 0;
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
672 }
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15574
diff changeset
673
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
674 /* Load exception handler if we have it */
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
675 if (GetModuleFileName(NULL, pidgin_dir, MAX_PATH) != 0) {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
676
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
677 /* primitive dirname() */
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
678 tmp = strrchr(pidgin_dir, '\\');
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
679
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
680 if (tmp) {
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
681 HMODULE hmod;
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
682 tmp[0] = '\0';
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
683
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
684 /* tmp++ will now point to the executable file name */
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
685 strcpy(exe_name, tmp + 1);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
686
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
687 strcat(pidgin_dir, "\\exchndl.dll");
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
688 if ((hmod = LoadLibrary(pidgin_dir))) {
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
689 FARPROC proc;
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
690 char debug_dir[MAX_PATH];
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
691 printf("Loaded exchndl.dll\n");
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
692 /* Temporarily override exchndl.dll's logfile
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
693 * to something sane (Pidgin will override it
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
694 * again when it initializes) */
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
695 proc = GetProcAddress(hmod, "SetLogFile");
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
696 if (proc) {
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
697 if (GetTempPath(sizeof(debug_dir), debug_dir) != 0) {
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
698 strcat(debug_dir, "pidgin.RPT");
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
699 printf(" Setting exchndl.dll LogFile to %s\n",
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
700 debug_dir);
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
701 (proc)(debug_dir);
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
702 }
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
703 }
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
704 proc = GetProcAddress(hmod, "SetDebugInfoDir");
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
705 if (proc) {
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
706 tmp[0] = '\0';
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
707 _snprintf(debug_dir, sizeof(debug_dir),
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
708 "%s\\pidgin-%s-dbgsym",
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
709 pidgin_dir, VERSION);
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
710 debug_dir[sizeof(debug_dir) - 1] = '\0';
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
711 printf(" Setting exchndl.dll DebugInfoDir to %s\n",
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
712 debug_dir);
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
713 (proc)(debug_dir);
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
714 }
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
715
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
716 }
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
717
29635
e30bf262a1f2 Use an updated exchndl.dll that supports setting the log file path manually and
Daniel Atallah <datallah@pidgin.im>
parents: 29634
diff changeset
718 tmp[0] = '\0';
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
719 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
720 } else {
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
721 DWORD dw = GetLastError();
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
722 const char *err_msg = get_win32_error_message(dw);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
723 _snprintf(errbuf, 512,
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
724 "Error getting module filename.\nError: (%u) %s",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
725 (UINT) dw, err_msg);
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
726 printf("%s\n", errbuf);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
727 MessageBox(NULL, errbuf, NULL, MB_OK | MB_TOPMOST);
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
728 pidgin_dir[0] = '\0';
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
729 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
730
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
731 /* Determine if we're running in portable mode */
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
732 if (strstr(lpszCmdLine, "--portable-mode")
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
733 || (exe_name != NULL && strstr(exe_name, "-portable.exe"))) {
19081
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
734 int i = 0, c = 0;
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
735
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
736 printf("Running in PORTABLE mode.\n");
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
737 portable_mode = TRUE;
19081
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
738
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
739 /* Remove the --portable-mode arg from the args passed to pidgin so it doesn't choke */
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
740 pidgin_argv = malloc(sizeof(char*) * pidgin_argc);
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
741 for (; i < __argc; i++) {
28536
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
742 if (strstr(__argv[i], "--portable-mode") == NULL)
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
743 pidgin_argv[c++] = __argv[i];
742223a6306a Patch from Johnson Earls to improve the win32 launcher detection of whether we
Daniel Atallah <datallah@pidgin.im>
parents: 26999
diff changeset
744 else
19081
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
745 pidgin_argc--;
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
746 }
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
747 }
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
748
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
749 if (portable_mode)
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
750 portable_mode_dll_prep(pidgin_dir);
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
751 else if (!getenv("PIDGIN_NO_DLL_CHECK"))
29634
80dbf6f777c4 Use a private GTK+ Runtime copy on Windows.
Daniel Atallah <datallah@pidgin.im>
parents: 28536
diff changeset
752 dll_prep(pidgin_dir);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
753
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
754 winpidgin_set_locale();
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
755
23936
67df298c2b9b This should have been part of the previous commit related to no longer
Daniel Atallah <datallah@pidgin.im>
parents: 23934
diff changeset
756 winpidgin_add_stuff_to_path();
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
757
18769
366db54481aa Make the win32 launcher support "--multiple" as well as %PIDGIN_MULTI_INST%
Daniel Atallah <datallah@pidgin.im>
parents: 17186
diff changeset
758 /* If help, version or multiple flag used, do not check Mutex */
24795
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
759 if (!help && !version)
48d838a2e580 Fix the initial parsing of args in the win32 launcher to be more robust.
Daniel Atallah <datallah@pidgin.im>
parents: 24433
diff changeset
760 if (!winpidgin_set_running(getenv("PIDGIN_MULTI_INST") == NULL && !multiple))
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
761 return 0;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
762
16080
5668a44f275c Fix some overzealous s/gaim/purple/ stuff.
Daniel Atallah <datallah@pidgin.im>
parents: 15931
diff changeset
763 /* Now we are ready for Pidgin .. */
18770
19fd340ce715 Convert portable winpidgin launcher executable to be the same binary as pidgin.exe and determine which behavior to use at runtime. Running "pidgin.exe --portable-mode" or renaming "pidgin.exe" to "pidgin-portable.exe" will cause the portable mode to be used.
Daniel Atallah <datallah@pidgin.im>
parents: 18769
diff changeset
764 if ((hmod = LoadLibrary("pidgin.dll")))
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
765 pidgin_main = (LPFNPIDGINMAIN) GetProcAddress(hmod, "pidgin_main");
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
766
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15450
diff changeset
767 if (!pidgin_main) {
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
768 DWORD dw = GetLastError();
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
769 BOOL mod_not_found = (dw == ERROR_MOD_NOT_FOUND || dw == ERROR_DLL_NOT_FOUND);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
770 const char *err_msg = get_win32_error_message(dw);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
771
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
772 _snprintf(errbuf, 512, "Error loading pidgin.dll.\nError: (%u) %s%s%s",
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
773 (UINT) dw, err_msg,
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
774 mod_not_found ? "\n" : "",
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
775 mod_not_found ? "This probably means that GTK+ can't be found." : "");
23915
b62601fd6e7d Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents: 22644
diff changeset
776 printf("%s\n", errbuf);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
777 MessageBox(NULL, errbuf, TEXT("Error"), MB_OK | MB_TOPMOST);
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
778
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
779 return 0;
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
780 }
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
781
19081
744d42ac088d Fix "pidgin.exe --portable-mode" not to pass the flag to pidgin's init, so getopt doesn't choke on it. Fixes #2392.
Daniel Atallah <datallah@pidgin.im>
parents: 18771
diff changeset
782 return pidgin_main(hInstance, pidgin_argc, pidgin_argv);
15450
09e913390266 Restoring win32 stuff that was (I assume accidentally) dropped. I took advantage of the opportunity to try the daggy fix stuff.
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
783 }

mercurial