--- etr-0.8.2/src/Makefile.am.orig	2022-06-16 05:33:56.000000000 +0200
+++ etr-0.8.2/src/Makefile.am	2023-04-11 23:04:00.723850600 +0200
@@ -12,6 +12,7 @@
 	event_select.cpp \
 	font.cpp	\
 	game_config.cpp	\
+	pathtools.c	\
 	game_ctrl.cpp	\
 	game_over.cpp	\
 	game_type_select.cpp \
@@ -63,6 +64,7 @@
 	event.h		\
 	event_select.h	\
 	font.h		\
+	pathtools.h	\
 	game_config.h	\
 	game_ctrl.h	\
 	game_over.h	\
--- etr-0.8.2/configure.ac.orig	2023-04-11 22:26:04.906057500 +0200
+++ etr-0.8.2/configure.ac	2023-04-11 22:22:11.174034000 +0200
@@ -102,7 +102,7 @@
   AC_MSG_ERROR([No OpenGL libraries found])
 fi
 
-CPPFLAGS="${CPPFLAGS} -DETR_DATA_DIR=\\\"$datadir\\\""
+CPPFLAGS="${CPPFLAGS} -DETR_DATA_DIR=\\\"$datadir\\\" -DETR_BIN_DIR=\\\"$bindir\\\""
 
 # Request c++14 compatibility
 CXXFLAGS="${CXXFLAGS} -std=c++14"
--- etr-0.8.3/src/game_config.cpp.orig	2023-06-19 21:53:25.000000000 +0200
+++ etr-0.8.3/src/game_config.cpp	2023-06-22 09:41:50.400527900 +0200
@@ -39,6 +39,7 @@
 #include <etr_config.h>
 #endif
 
+#include "pathtools.h"
 #include "game_config.h"
 #include "spx.h"
 #include "translation.h"
@@ -266,7 +269,7 @@
 void InitConfig() {
 	int config_exist = 0;
 
-#if defined (OS_WIN32_MINGW) || defined (OS_WIN32_MSC)
+#if defined (OS_WIN32_MSC)
 	// the progdir is always the current dir
 	param.config_dir = "config";
 	param.data_dir = "data";
@@ -293,10 +296,9 @@
 	param.prog_dir = buff;
 #endif /* 0 */
 
-	struct passwd *pwent = getpwuid(getuid());
 	std::string halfway_dir;
 
-	param.config_dir = pwent->pw_dir;
+	param.config_dir = getenv("USERPROFILE");
 	param.config_dir += SEP;
 	param.config_dir += ".etr";
 	if (!DirExists(param.config_dir.c_str())) {
@@ -306,7 +308,7 @@
 			param.config_dir = XDG_CONFIG_HOME;
 			halfway_dir = param.config_dir;
 		} else {
-			param.config_dir = pwent->pw_dir;
+			param.config_dir = getenv("USERPROFILE");
 			param.config_dir += SEP ".config";
 			halfway_dir = param.config_dir;
 		}
@@ -316,12 +318,12 @@
 	if (!DirExists(param.config_dir.c_str())) {
 		// TODO: Support generic multi-part path directory creation
 		if (!halfway_dir.empty()) {
-			mkdir(halfway_dir.c_str(), 0775);
+			mkdir(halfway_dir.c_str());
 		}
 
-		mkdir(param.config_dir.c_str(), 0775);
+		mkdir(param.config_dir.c_str());
 	}
-	param.data_dir = ETR_DATA_DIR;
+	param.data_dir = single_path_relocation(ETR_BIN_DIR, ETR_DATA_DIR);
 	param.data_dir += SEP;
 	param.data_dir += "etr";
 	param.save_dir = param.config_dir;
