diff --git a/README.md b/README.md
index abf1a3d..eb329ee 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,17 @@
+> [!WARNING]
+> This repository is a fork of the Unleashed Recompiled project, specifically designed to support binary Arch Linux packaging through the AUR and the PKGBUILD system. For Windows builds, please refer to the upstream repository.
+> **Do not attempt to compile the content of this repository with Windows targets**.
+> Please be also aware this package, unlike the Flatpak version provided upstream, may not be compatible with the Hedgemod Manager differently from the Flatpak version provided upstream.
+
+Binaries from this repository are built using:
+
+```
+$ cmake -DCMAKE_AR=/usr/bin/llvm-ar -DCMAKE_RANLIB=/usr/bin/llvm-ranlib . --preset linux-release
+$ cmake --build ./out/build/linux-release --target UnleashedRecomp
+```
+
+---
+
diff --git a/UnleashedRecomp/app.cpp b/UnleashedRecomp/app.cpp
index b298ebc..e6c2414 100644
--- a/UnleashedRecomp/app.cpp
+++ b/UnleashedRecomp/app.cpp
@@ -33,7 +33,7 @@ PPC_FUNC_IMPL(__imp__sub_824EB490);
PPC_FUNC(sub_824EB490)
{
App::s_isInit = true;
- App::s_isMissingDLC = !Installer::checkAllDLC(GetGamePath());
+ App::s_isMissingDLC = !Installer::checkAllDLC(g_gamepath);
App::s_language = Config::Language;
SWA::SGlobals::Init();
diff --git a/UnleashedRecomp/kernel/xam.cpp b/UnleashedRecomp/kernel/xam.cpp
index 3d7ca77..05f34d5 100644
--- a/UnleashedRecomp/kernel/xam.cpp
+++ b/UnleashedRecomp/kernel/xam.cpp
@@ -315,11 +315,11 @@ uint32_t XamContentCreateEx(uint32_t dwUserIndex, const char* szRootName, const
}
else if (pContentData->dwContentType == XCONTENTTYPE_DLC)
{
- root = GAME_INSTALL_DIRECTORY "/dlc";
+ root = g_gamepath + "/dlc";
}
else
{
- root = GAME_INSTALL_DIRECTORY;
+ root = g_gamepath;
}
XamRegisterContent(*pContentData, root);
diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp
index a55c018..fe4b303 100644
--- a/UnleashedRecomp/main.cpp
+++ b/UnleashedRecomp/main.cpp
@@ -61,8 +61,8 @@ void KiSystemStartup()
{
const auto gameContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Game");
const auto updateContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Update");
- XamRegisterContent(gameContent, GAME_INSTALL_DIRECTORY "/game");
- XamRegisterContent(updateContent, GAME_INSTALL_DIRECTORY "/update");
+ XamRegisterContent(gameContent, g_gamepath + "/game");
+ XamRegisterContent(updateContent, g_gamepath + "/update");
const auto saveFilePath = GetSaveFilePath(true);
bool saveFileExists = std::filesystem::exists(saveFilePath);
@@ -94,7 +94,7 @@ void KiSystemStartup()
XamContentCreateEx(0, "D", &gameContent, OPEN_EXISTING, nullptr, nullptr, 0, 0, nullptr);
std::error_code ec;
- for (auto& file : std::filesystem::directory_iterator(GAME_INSTALL_DIRECTORY "/dlc", ec))
+ for (auto& file : std::filesystem::directory_iterator(g_gamepath + "/dlc", ec))
{
if (file.is_directory())
{
@@ -244,7 +244,7 @@ int main(int argc, char *argv[])
HostStartup();
std::filesystem::path modulePath;
- bool isGameInstalled = Installer::checkGameInstall(GAME_INSTALL_DIRECTORY, modulePath);
+ bool isGameInstalled = Installer::checkGameInstall(g_gamepath, modulePath);
bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled;
if (runInstallerWizard)
{
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
std::_Exit(1);
}
- if (!InstallerWizard::Run(GAME_INSTALL_DIRECTORY, isGameInstalled && forceDLCInstaller))
+ if (!InstallerWizard::Run(g_gamepath, isGameInstalled && forceDLCInstaller))
{
std::_Exit(0);
}
diff --git a/UnleashedRecomp/mod/mod_loader.cpp b/UnleashedRecomp/mod/mod_loader.cpp
index dd33c56..282238d 100644
--- a/UnleashedRecomp/mod/mod_loader.cpp
+++ b/UnleashedRecomp/mod/mod_loader.cpp
@@ -100,7 +100,7 @@ void ModLoader::Init()
{
configIni = {};
- if (!configIni.read(GAME_INSTALL_DIRECTORY "/cpkredir.ini"))
+ if (!configIni.read(g_gamepath + "/cpkredir.ini"))
return;
}
diff --git a/UnleashedRecomp/user/paths.cpp b/UnleashedRecomp/user/paths.cpp
index 13a8588..633d97c 100644
--- a/UnleashedRecomp/user/paths.cpp
+++ b/UnleashedRecomp/user/paths.cpp
@@ -3,6 +3,7 @@
std::filesystem::path g_executableRoot = os::process::GetExecutablePath().remove_filename();
std::filesystem::path g_userPath = BuildUserPath();
+extern const std::string g_gamepath = GetGamePath();
bool CheckPortable()
{
diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h
index c083520..118b570 100644
--- a/UnleashedRecomp/user/paths.h
+++ b/UnleashedRecomp/user/paths.h
@@ -10,14 +10,20 @@
extern std::filesystem::path g_executableRoot;
-inline std::filesystem::path GetGamePath()
+inline std::string GetGamePath()
{
- return GAME_INSTALL_DIRECTORY;
+ const char* homeDir = getenv("HOME");
+ if (homeDir == nullptr)
+ return g_executableRoot.string();
+ std::filesystem::path homePath = homeDir;
+ std::filesystem::path gamePath = homePath / ".local/share" / USER_DIRECTORY;
+ return gamePath.string();
}
bool CheckPortable();
std::filesystem::path BuildUserPath();
const std::filesystem::path& GetUserPath();
+extern const std::string g_gamepath;
inline std::filesystem::path GetSavePath(bool checkForMods)
{