mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
sys: Prevent portable Windows version from writing to AppData
Fixes #627
This commit is contained in:
@@ -72,6 +72,17 @@ namespace hex::init {
|
||||
fs::ImHexPath::Logs
|
||||
};
|
||||
|
||||
// Check if ImHex is installed in portable mode
|
||||
{
|
||||
if (const auto executablePath = fs::getExecutablePath(); executablePath.has_value()) {
|
||||
const auto flagFile = executablePath.value() / "PORTABLE";
|
||||
|
||||
if (fs::exists(flagFile) && fs::isRegularFile(flagFile))
|
||||
ImHexApi::System::impl::setPortableVersion(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Create all folders
|
||||
for (auto path : paths) {
|
||||
for (auto &folder : fs::getDefaultPaths(path, true)) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user