UI: Restore portable mode on Windows

master
jpark37 2022-05-07 21:17:39 -07:00 committed by Rodney
parent 4405072e29
commit e646eb4828
1 changed files with 9 additions and 3 deletions

View File

@ -2347,9 +2347,15 @@ static void load_debug_privilege(void)
#define CONFIG_PATH BASE_PATH "/config"
#if defined(LINUX_PORTABLE) || defined(_WIN32)
#define ALLOW_PORTABLE_MODE 1
#else
#define ALLOW_PORTABLE_MODE 0
#endif
int GetConfigPath(char *path, size_t size, const char *name)
{
#ifdef LINUX_PORTABLE
#if ALLOW_PORTABLE_MODE
if (portable_mode) {
if (name && *name) {
return snprintf(path, size, CONFIG_PATH "/%s", name);
@ -2366,7 +2372,7 @@ int GetConfigPath(char *path, size_t size, const char *name)
char *GetConfigPathPtr(const char *name)
{
#ifdef LINUX_PORTABLE
#if ALLOW_PORTABLE_MODE
if (portable_mode) {
char path[512];
@ -2882,7 +2888,7 @@ int main(int argc, char *argv[])
}
}
#if defined(LINUX_PORTABLE)
#if ALLOW_PORTABLE_MODE
if (!portable_mode) {
portable_mode =
os_file_exists(BASE_PATH "/portable_mode") ||