Index: trunk/ab5.0/jenga/include/common/Environment.h
===================================================================
--- trunk/ab5.0/jenga/include/common/Environment.h	(revision 474)
+++ trunk/ab5.0/jenga/include/common/Environment.h	(revision 477)
@@ -37,4 +37,34 @@
 		return appDir;
 	}
+
+	static const std::string &GetAppFileName()
+	{
+		static std::string appFileName;
+		if( appFileName.size() == 0 )
+		{
+			char temporary[MAX_PATH];
+			char temp2[MAX_PATH];
+			char temp3[MAX_PATH];
+			GetModuleFileName(GetModuleHandle(0),temporary,MAX_PATH);
+			_splitpath(temporary,NULL,NULL,temp2,temp3);
+			lstrcat(temp2,temp3);
+
+			appFileName = temp2;
+		}
+		return appFileName;
+	}
+
+	static const std::string &GetAppFilePath()
+	{
+		static std::string appFilePath;
+		if( appFilePath.size() == 0 )
+		{
+			char temporary[MAX_PATH];
+			GetModuleFileName(GetModuleHandle(0),temporary,MAX_PATH);
+
+			appFilePath = temporary;
+		}
+		return appFilePath;
+	}
 };
 
Index: trunk/ab5.0/jenga/src/common/Path.cpp
===================================================================
--- trunk/ab5.0/jenga/src/common/Path.cpp	(revision 474)
+++ trunk/ab5.0/jenga/src/common/Path.cpp	(revision 477)
@@ -50,8 +50,14 @@
 	}
 
-	i3=(int)baseDirPath.size();i4=0;
+	std::string tempBaseDirPath = baseDirPath;
+	if( tempBaseDirPath[tempBaseDirPath.size()-1] != '\\' )
+	{
+		tempBaseDirPath += "\\";
+	}
+
+	i3=(int)tempBaseDirPath.size();i4=0;
 	while(i4<i2){
 		for(i3--;;i3--){
-			if(baseDirPath[i3-1]=='\\'){
+			if(tempBaseDirPath[i3-1]=='\\'){
 				i4++;
 				break;
@@ -59,9 +65,14 @@
 		}
 	}
-	memcpy(temporary,baseDirPath.c_str(),i3);
+	memcpy(temporary,tempBaseDirPath.c_str(),i3);
 	temporary[i3]=0;
 	lstrcat(temporary,resultPath+i);
 	lstrcpy(resultPath,temporary);
 
+	if( resultPath[lstrlen(resultPath)-1] == '\\' )
+	{
+		resultPath[lstrlen(resultPath)-1] = 0;
+	}
+
 	return resultPath;
 }
