Index: trunk/Server/config.c
===================================================================
--- trunk/Server/config.c	(revision 255)
+++ trunk/Server/config.c	(revision 257)
@@ -10,4 +10,5 @@
 #include <stdlib.h>
 #include <string.h>
+#include <sys/stat.h>
 
 #if !defined(_MSC_VER) && !defined(__BORLANDC__)
@@ -405,4 +406,82 @@
 							e->mime = cm_strdup(r[2]);
 						}
+					} else if(cm_strcaseequ(r[0], "MIMEFile")) {
+						if(r[1] == NULL) {
+							cm_log("Config", "Missing path at line %d", ln);
+							stop = 1;
+						} else {
+							FILE* mimefile = fopen(r[1], "r");
+							if(mimefile == NULL) {
+								cm_log("Config", "Could not load the file at line %d", ln);
+								stop = 1;
+							} else {
+								char* line = malloc(1);
+								int i;
+								struct stat st;
+								char* buf;
+								int incr = 0;
+								stat(r[1], &st);
+
+								buf = malloc(st.st_size + 1);
+								fread(buf, st.st_size, 1, mimefile);
+
+								for(i = 0;; i++) {
+									if(buf[i] == '\n' || buf[i] == 0) {
+										char oldc = buf[i];
+										char* line;
+										buf[i] = 0;
+
+										line = buf + incr;
+
+										if(strlen(line) > 0 && line[0] != '#') {
+											int j;
+											for(j = 0; line[j] != 0; j++) {
+												if(line[j] == ' ' || line[j] == '\t') {
+													line[j] = 0;
+													j++;
+													for(; line[j] != 0; j++) {
+														if(line[j] != ' ' && line[j] != '\t') {
+															char* name = line;
+															char* mimes = line + j;
+															int k = 0;
+															int incr2 = 0;
+															for(k = 0;; k++) {
+																if(mimes[k] == ' ' || mimes[k] == 0) {
+																	char oldc2 = mimes[k];
+																	struct tw_mime_entry* e;
+																	mimes[k] = 0;
+
+																	e = &current->mimes[current->mime_count++];
+																	e->ext = cm_strcat(".", mimes + incr2);
+																	e->mime = cm_strdup(name);
+																	if(current->mime_count == MAX_MIME) {
+																		cm_log("Config", "Too many MIME types, cannot handle");
+																		stop = 1;
+																		break;
+																	}
+
+																	incr2 = k + 1;
+																	if(oldc2 == 0) break;
+																}
+															}
+															break;
+														}
+													}
+													break;
+												}
+												if(stop) break;
+											}
+										}
+
+										incr = i + 1;
+										if(oldc == 0) break;
+									}
+								}
+
+								free(buf);
+
+								fclose(mimefile);
+							}
+						}
 					} else if(cm_strcaseequ(r[0], "Icon")) {
 						if(r[1] == NULL) {
Index: trunk/Server/gui.rc
===================================================================
--- trunk/Server/gui.rc	(revision 255)
+++ trunk/Server/gui.rc	(revision 257)
@@ -14,4 +14,5 @@
 	LTEXT TW_VERSION_TEXT, GUI_TEWI_NAME, 42, 5, 192, 50
 	LTEXT "Original by Nishi <nishi@nishi.boats>", GUI_TEWI_ORIGINAL, 42, 5 + 8, 192, 50
+	LTEXT "Website: http://nishi.boats/tewi", GUI_TEWI_ORIGINAL, 42, 5 + 8 * 2, 192, 50
 	DEFPUSHBUTTON "&OK", IDOK, 75, 35, 50, 10
 }
Index: trunk/Server/install.nsi
===================================================================
--- trunk/Server/install.nsi	(revision 255)
+++ trunk/Server/install.nsi	(revision 257)
@@ -54,10 +54,14 @@
 	File /oname=pbtewi.gif "pbtewi.gif"
 	!cd ..
+	!cd Icons
 	SetOutPath "$INSTDIR\www\icons"
-	!cd Icons
 	File "*.png"
 	!cd ..
 	!cd Server
 	SetOverWrite on
+	!cd ..
+	SetOutPath "$INSTDIR"
+	File "mime.types"
+	!cd Server
 
 	CreateDirectory "$SMPROGRAMS\Tewi HTTPd"
Index: trunk/Server/main.c
===================================================================
--- trunk/Server/main.c	(revision 255)
+++ trunk/Server/main.c	(revision 257)
@@ -87,5 +87,5 @@
 int startup(int argc, char** argv);
 
-#if defined(__MINGW32__) || defined(_MSC_VER)
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
 char* get_registry(const char* main, const char* sub) {
 	DWORD bufsize = 512;
@@ -711,5 +711,5 @@
 	int i;
 	char* r;
-#if defined(__MINGW32__) || defined(_MSC_VER)
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
 	char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
 	char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
Index: trunk/Server/server.c
===================================================================
--- trunk/Server/server.c	(revision 255)
+++ trunk/Server/server.c	(revision 257)
@@ -498,8 +498,9 @@
 	struct sockaddr* sa = (struct sockaddr*)&addr;
 	getnameinfo(sa, sizeof(addr), address, 512, NULL, 0, NI_NUMERICHOST);
-#endif
-	addrstr = inet_ntoa(addr.sin_addr);
-	strcpy(address, addrstr);
-	address[strlen(addrstr)] = 0;
+#else
+		addrstr = inet_ntoa(addr.sin_addr);
+		strcpy(address, addrstr);
+		address[strlen(addrstr)] = 0;
+#endif
 #ifdef FREE_PTR
 	free(ptr);
Index: trunk/Server/tw_config.h
===================================================================
--- trunk/Server/tw_config.h	(revision 255)
+++ trunk/Server/tw_config.h	(revision 257)
@@ -42,5 +42,5 @@
 #define MAX_MODULES 1024
 #define MAX_DIRS 1024
-#define MAX_MIME 1024
+#define MAX_MIME 4096
 #define MAX_ICON 1024
 #define MAX_INDEX 1024
@@ -85,7 +85,7 @@
 	struct tw_dir_entry dirs[MAX_DIRS];
 	int dir_count;
-	struct tw_mime_entry mimes[MAX_DIRS];
+	struct tw_mime_entry mimes[MAX_MIME];
 	int mime_count;
-	struct tw_icon_entry icons[MAX_DIRS];
+	struct tw_icon_entry icons[MAX_ICON];
 	int icon_count;
 	char* indexes[MAX_INDEX];
Index: trunk/Server/tw_version.h
===================================================================
--- trunk/Server/tw_version.h	(revision 255)
+++ trunk/Server/tw_version.h	(revision 257)
@@ -8,6 +8,6 @@
 #endif
 
-#define TW_VERSION "2.03E\0"
-#define TW_VERSION_TEXT "Tewi HTTPd version 2.03E"
+#define TW_VERSION "2.04\0"
+#define TW_VERSION_TEXT "Tewi HTTPd version 2.04"
 
 const char* tw_get_version(void);
