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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user