diff options
Diffstat (limited to 'src/win32')
-rwxr-xr-x | src/win32/nsis/easytag-header.bmp | bin | 0 -> 25818 bytes | |||
-rwxr-xr-x | src/win32/nsis/easytag-install.bmp | bin | 0 -> 154542 bytes | |||
-rwxr-xr-x | src/win32/nsis/easytag-install.ico | bin | 0 -> 16958 bytes | |||
-rwxr-xr-x | src/win32/nsis/easytag-uninstall.bmp | bin | 0 -> 154542 bytes | |||
-rwxr-xr-x[-rw-r--r--] | src/win32/win32dep.c | 64 | ||||
-rwxr-xr-x[-rw-r--r--] | src/win32/win32dep.h | 9 | ||||
-rwxr-xr-x | src/win32/win_easytag.c | 5 |
7 files changed, 46 insertions, 32 deletions
diff --git a/src/win32/nsis/easytag-header.bmp b/src/win32/nsis/easytag-header.bmp Binary files differnew file mode 100755 index 0000000..85aaeb1 --- /dev/null +++ b/src/win32/nsis/easytag-header.bmp diff --git a/src/win32/nsis/easytag-install.bmp b/src/win32/nsis/easytag-install.bmp Binary files differnew file mode 100755 index 0000000..5bfd99b --- /dev/null +++ b/src/win32/nsis/easytag-install.bmp diff --git a/src/win32/nsis/easytag-install.ico b/src/win32/nsis/easytag-install.ico Binary files differnew file mode 100755 index 0000000..0e8673e --- /dev/null +++ b/src/win32/nsis/easytag-install.ico diff --git a/src/win32/nsis/easytag-uninstall.bmp b/src/win32/nsis/easytag-uninstall.bmp Binary files differnew file mode 100755 index 0000000..5cf16db --- /dev/null +++ b/src/win32/nsis/easytag-uninstall.bmp diff --git a/src/win32/win32dep.c b/src/win32/win32dep.c index 9e400af..cccde13 100644..100755 --- 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 index 9107852..302ba0a 100644..100755 --- 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); |