From 26b8e06374c71e42be86694f5d5c4ee920ae4d26 Mon Sep 17 00:00:00 2001 From: Alex Bennee Date: Wed, 14 Jul 2010 16:01:16 +0100 Subject: EasyTag 2.1.4 --- src/win32/nsis/easytag-header.bmp | Bin 0 -> 25818 bytes src/win32/nsis/easytag-install.bmp | Bin 0 -> 154542 bytes src/win32/nsis/easytag-install.ico | Bin 0 -> 16958 bytes src/win32/nsis/easytag-uninstall.bmp | Bin 0 -> 154542 bytes src/win32/win32dep.c | 64 ++++++++++++++++++++--------------- src/win32/win32dep.h | 9 +++-- src/win32/win_easytag.c | 5 +-- 7 files changed, 46 insertions(+), 32 deletions(-) create mode 100755 src/win32/nsis/easytag-header.bmp create mode 100755 src/win32/nsis/easytag-install.bmp create mode 100755 src/win32/nsis/easytag-install.ico create mode 100755 src/win32/nsis/easytag-uninstall.bmp mode change 100644 => 100755 src/win32/win32dep.c mode change 100644 => 100755 src/win32/win32dep.h (limited to 'src/win32') diff --git a/src/win32/nsis/easytag-header.bmp b/src/win32/nsis/easytag-header.bmp new file mode 100755 index 0000000..85aaeb1 Binary files /dev/null and b/src/win32/nsis/easytag-header.bmp differ diff --git a/src/win32/nsis/easytag-install.bmp b/src/win32/nsis/easytag-install.bmp new file mode 100755 index 0000000..5bfd99b Binary files /dev/null and b/src/win32/nsis/easytag-install.bmp differ diff --git a/src/win32/nsis/easytag-install.ico b/src/win32/nsis/easytag-install.ico new file mode 100755 index 0000000..0e8673e Binary files /dev/null and b/src/win32/nsis/easytag-install.ico differ diff --git a/src/win32/nsis/easytag-uninstall.bmp b/src/win32/nsis/easytag-uninstall.bmp new file mode 100755 index 0000000..5cf16db Binary files /dev/null and b/src/win32/nsis/easytag-uninstall.bmp differ diff --git a/src/win32/win32dep.c b/src/win32/win32dep.c old mode 100644 new mode 100755 index 9e400af..cccde13 --- a/src/win32/win32dep.c +++ b/src/win32/win32dep.c @@ -76,6 +76,7 @@ typedef enum */ static char app_data_dir[MAX_PATH + 1] = "C:"; static char install_dir[MAXPATHLEN]; +static char lib_dir[MAXPATHLEN]; static char locale_dir[MAXPATHLEN]; static void str_replace_char (gchar *str, gchar in_char, gchar out_char); @@ -109,30 +110,30 @@ HINSTANCE ET_Win32_Hinstance (void) and on being read back have their '\' chars used as an escape char. Returns an allocated string which needs to be freed. */ -char* ET_Win32_Escape_Dirsep (char* filename ) +char *ET_Win32_Escape_Dirsep (const char *filename) { - int sepcount=0; - char* ret=NULL; - int cnt=0; - - ret = filename; - while(*ret) - { - if(*ret == '\\') - sepcount++; - ret++; - } - ret = g_malloc0(strlen(filename) + sepcount + 1); - while(*filename) - { - ret[cnt] = *filename; - if(*filename == '\\') - ret[++cnt] = '\\'; - filename++; - cnt++; - } - ret[cnt] = '\0'; - return ret; + int sepcount = 0; + const char *tmp = filename; + char *ret; + int cnt = 0; + + g_return_val_if_fail(filename != NULL, NULL); + + while(*tmp) { + if(*tmp == '\\') + sepcount++; + tmp++; + } + ret = g_malloc0(strlen(filename) + sepcount + 1); + while(*filename) { + ret[cnt] = *filename; + if(*filename == '\\') + ret[++cnt] = '\\'; + filename++; + cnt++; + } + ret[cnt] = '\0'; + return ret; } /* this is used by libmp4v2 : what is it doing here you think ? well...search! */ @@ -165,10 +166,10 @@ int mkstemp (char *template) /* Determine whether the specified dll contains the specified procedure. If so, load it (if not already loaded). */ -FARPROC ET_Win32_Find_And_Loadproc ( char* dllname, char* procedure ) +FARPROC ET_Win32_Find_And_Loadproc (char *dllname, char *procedure) { HMODULE hmod; - int did_load=0; + BOOL did_load = FALSE; FARPROC proc = 0; if(!(hmod=GetModuleHandle(dllname))) @@ -240,14 +241,21 @@ char* ET_Win32_Install_Dir (void) } -char* ET_Win32_Locale_Dir (void) +char *ET_Win32_Lib_Dir (void) +{ + strcpy(lib_dir, ET_Win32_Install_Dir()); + g_strlcat(lib_dir, G_DIR_SEPARATOR_S "library", sizeof(lib_dir)); + return (char*)&lib_dir; +} + +char *ET_Win32_Locale_Dir (void) { strcpy(locale_dir, ET_Win32_Install_Dir()); g_strlcat(locale_dir, G_DIR_SEPARATOR_S "locale", sizeof(locale_dir)); return (char*)&locale_dir; } -char* ET_Win32_Data_Dir (void) +char *ET_Win32_Data_Dir (void) { return (char*)&app_data_dir; } @@ -448,6 +456,8 @@ void ET_Win32_Cleanup (void) { /* winsock cleanup */ WSACleanup(); + + ET_dll_hInstance = NULL; } /* DLL initializer */ diff --git a/src/win32/win32dep.h b/src/win32/win32dep.h old mode 100644 new mode 100755 index 9107852..302ba0a --- a/src/win32/win32dep.h +++ b/src/win32/win32dep.h @@ -49,10 +49,11 @@ extern int mkstemp(char *template); extern HINSTANCE ET_Win32_Hinstance (void); extern gboolean ET_Win32_Read_Reg_String (HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len); -extern char* ET_Win32_Escape_Dirsep (char*); +extern char *ET_Win32_Escape_Dirsep (const char *filename); /* Determine ET paths */ extern char* ET_Win32_Install_Dir (void); +extern char* ET_Win32_Lib_Dir (void); extern char* ET_Win32_Locale_Dir (void); extern char* ET_Win32_Data_Dir (void); @@ -76,7 +77,9 @@ extern void ET_Win32_Path_Replace_Slashes (gchar *path); /* * ET specific */ -#define DATADIR ET_Win32_Install_Dir() -#define LOCALE ET_Win32_Locale_Dir() +#define DATADIR ET_Win32_Install_Dir() +#define LIBDIR ET_Win32_Lib_Dir() +#define LOCALEDIR ET_Win32_Locale_Dir() +//#define PACKAGE_DATA_DIR DATADIR #endif /* _WIN32DEP_H_ */ diff --git a/src/win32/win_easytag.c b/src/win32/win_easytag.c index cd6628d..21f4bac 100755 --- a/src/win32/win_easytag.c +++ b/src/win32/win_easytag.c @@ -360,7 +360,7 @@ static char* lcid_to_posix(LCID lcid) { */ static const char *get_locale() { const char *locale = NULL; - LCID lcid; + LCID lcid = 0; char data[10]; DWORD datalen = 10; @@ -377,6 +377,7 @@ static const char *get_locale() { return locale; } + // List of LCID : http://www.microsoft.com/globaldev/reference/lcid-all.mspx lcid = GetUserDefaultLCID(); if ((locale = lcid_to_posix(lcid))) return locale; @@ -546,7 +547,7 @@ WinMain (struct HINSTANCE__ *hInstance, struct HINSTANCE__ *hPrevInstance, snprintf(errbuf, 512, "Error loading 'easytag.dll'. Error: (%u) %s%s%s", (UINT) dw, err_msg, mod_not_found ? "\n" : "", - mod_not_found ? "This probably means that GTK+ can't be found." : ""); + mod_not_found ? "This probably means that a dependency (like GTK+, libogg or libvorbis) can't be found." : ""); printf(errbuf); MessageBox(NULL, errbuf, TEXT("Error"), MB_OK | MB_TOPMOST); -- cgit v1.2.3