1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Linux: Correct handling of documentation in case of AppImage. Code refactoring.

This commit is contained in:
Mounir IDRASSI
2025-05-10 19:09:31 +09:00
parent 01cfc169c6
commit 3edae48717
4 changed files with 56 additions and 20 deletions

View File

@@ -1354,6 +1354,21 @@ namespace VeraCrypt
htmlPath += L"/../Resources/doc/HTML/";
#elif defined (TC_UNIX)
htmlPath = L"/usr/share/doc/veracrypt/HTML/";
#if defined(TC_LINUX)
// AppImage specific handling:
// if we are running from an AppImage, we need to use the path inside the AppImage
// instead of the path on the host system
std::string appPath= StringConverter::ToSingle (wstring(Application::GetExecutablePath()));
if (Process::IsRunningUnderAppImage(appPath))
{
const char* appDirEnv = getenv("APPDIR");
if (appDirEnv)
{
htmlPath = wxString::FromUTF8(appDirEnv);
htmlPath += "/usr/share/doc/veracrypt/HTML/";
}
}
#endif
#else
localFile = false;
#endif