comparison libpurple/win32/win32dep.c @ 30898:31c2dd632ffa

Make wpurple_install_dir() (DATADIR) relative to the libpurple dll instead of the executable file that launched the process
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 31 Aug 2010 00:53:15 +0000
parents 7be961ff3fa2
children 35d8acf675e9
comparison
equal deleted inserted replaced
30897:7be961ff3fa2 30898:31c2dd632ffa
33 * LOCALS 33 * LOCALS
34 */ 34 */
35 static char *app_data_dir = NULL, *install_dir = NULL, 35 static char *app_data_dir = NULL, *install_dir = NULL,
36 *lib_dir = NULL, *locale_dir = NULL; 36 *lib_dir = NULL, *locale_dir = NULL;
37 37
38 static HINSTANCE libpurpledll_hInstance = 0; 38 static HINSTANCE libpurpledll_hInstance = NULL;
39 39
40 /* 40 /*
41 * PUBLIC CODE 41 * PUBLIC CODE
42 */ 42 */
43 43
128 static gboolean initialized = FALSE; 128 static gboolean initialized = FALSE;
129 129
130 if (!initialized) { 130 if (!initialized) {
131 char *tmp = NULL; 131 char *tmp = NULL;
132 wchar_t winstall_dir[MAXPATHLEN]; 132 wchar_t winstall_dir[MAXPATHLEN];
133 if (GetModuleFileNameW(NULL, winstall_dir, 133 if (GetModuleFileNameW(libpurpledll_hInstance, winstall_dir,
134 MAXPATHLEN) > 0) { 134 MAXPATHLEN) > 0) {
135 tmp = g_utf16_to_utf8(winstall_dir, -1, 135 tmp = g_utf16_to_utf8(winstall_dir, -1,
136 NULL, NULL, NULL); 136 NULL, NULL, NULL);
137 } 137 }
138 138