diff --git a/premake4.lua b/premake4.lua
index 0d760ae85e15bc5f0963bc5eb004cccd50a8c511..e5af86233667018114eb7ff27e1880ca49c851d5 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -91,18 +91,19 @@ project "TEngineRunner"
 	kind "WindowedApp"
 	language "C"
 	targetname "t-engine"
-	files { "src/runner/*.c", }
-	links { "dl" }
-configuration {"linux", "Debug"}
-	postbuildcommands { "cp bin/Debug/t-engine t-engine", }
-configuration {"linux", "Release"}
-	postbuildcommands { "cp bin/Release/t-engine t-engine", }
+	files { "src/runner/*.c", "src/getself.c" }
+	links { "physfs", "lua".._OPTIONS.lua }
 configuration "linux"
+	links { "dl" }
         defines { 'SELFEXE_LINUX'  }
 configuration "windows"
         defines { 'SELFEXE_WINDOWS'  }
 configuration "macosx"
         defines { "USE_TENGINE_MAIN", 'SELFEXE_MACOSX'  }
+configuration {"Debug"}
+	postbuildcommands { "cp bin/Debug/t-engine t-engine", }
+configuration {"Release"}
+	postbuildcommands { "cp bin/Release/t-engine t-engine", }
 
 project "TEngine"
 	targetprefix ""
diff --git a/src/runner/main.c b/src/runner/main.c
index 2374d0ec0ef2e2de29abc2c9f74170ab2fd0437f..f19ba5ccffc57b9f2f406ac88505253afbbf8895 100644
--- a/src/runner/main.c
+++ b/src/runner/main.c
@@ -1,3 +1,24 @@
+/*
+    TE4 - T-Engine 4
+    Copyright (C) 2009, 2010 Nicolas Casalini
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+    Nicolas Casalini "DarkGod"
+    darkgod@te4.org
+*/
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -7,6 +28,8 @@
 #include <dlfcn.h>
 #endif
 
+#include "physfs.h"
+
 // Load the shared lib containing the core and calls te4main inside it, passing control to that core
 int run_core(int corenum, int argc, char **argv)
 {
@@ -83,6 +106,22 @@ int main(int argc, char **argv)
 {
 	int core = 12;
 
+	/***************** Physfs Init *****************/
+	PHYSFS_init(argv[0]);
+
+	const char *selfexe = get_self_executable(argc, argv);
+	if (selfexe)
+	{
+		PHYSFS_mount(selfexe, "/", 1);
+	}
+	else
+	{
+		printf("NO SELFEXE: bootstrapping from CWD\n");
+		PHYSFS_mount("bootstrap", "/bootstrap", 1);
+	}
+
+	PHYSFS_deinit();
+
 	// Run the requested cores until we want no more
 	while (core) core = run_core(core, argc, argv);