瀏覽代碼

UI: Restore portable mode on Windows

jpark37 3 年之前
父節點
當前提交
e646eb4828
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      UI/obs-app.cpp

+ 9 - 3
UI/obs-app.cpp

@@ -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") ||