@@ -88,12 +88,14 @@ void CemuApp::DeterminePaths(std::set<fs::path>& failedWriteAccess) // for Windo
88
88
fs::path exePath (wxHelper::MakeFSPath (standardPaths.GetExecutablePath ()));
89
89
fs::path portablePath = exePath.parent_path () / " portable" ;
90
90
data_path = exePath.parent_path (); // the data path is always the same as the exe path
91
- if (fs::exists (portablePath, ec))
91
+ #ifdef CEMU_ALLOW_PORTABLE
92
+ if (fs::is_directory (portablePath, ec))
92
93
{
93
94
isPortable = true ;
94
95
user_data_path = config_path = cache_path = portablePath;
95
96
}
96
97
else
98
+ #endif
97
99
{
98
100
fs::path roamingPath = GetAppDataRoamingPath () / " Cemu" ;
99
101
user_data_path = config_path = cache_path = roamingPath;
@@ -124,19 +126,21 @@ void CemuApp::DeterminePaths(std::set<fs::path>& failedWriteAccess) // for Linux
124
126
fs::path portablePath = exePath.parent_path () / " portable" ;
125
127
// GetExecutablePath returns the AppImage's temporary mount location
126
128
wxString appImagePath;
127
- if (wxGetEnv (( " APPIMAGE" ) , &appImagePath))
129
+ if (wxGetEnv (" APPIMAGE" , &appImagePath))
128
130
{
129
131
exePath = wxHelper::MakeFSPath (appImagePath);
130
132
portablePath = exePath.parent_path () / " portable" ;
131
133
}
132
- if (fs::exists (portablePath, ec))
134
+ #ifdef CEMU_ALLOW_PORTABLE
135
+ if (fs::is_directory (portablePath, ec))
133
136
{
134
137
isPortable = true ;
135
138
user_data_path = config_path = cache_path = portablePath;
136
139
// in portable mode assume the data directories (resources, gameProfiles/default/) are next to the executable
137
140
data_path = exePath.parent_path ();
138
141
}
139
142
else
143
+ #endif
140
144
{
141
145
SetAppName (" Cemu" );
142
146
wxString appName = GetAppName ();
@@ -167,16 +171,18 @@ void CemuApp::DeterminePaths(std::set<fs::path>& failedWriteAccess) // for MacOS
167
171
fs::path user_data_path, config_path, cache_path, data_path;
168
172
auto standardPaths = wxStandardPaths::Get ();
169
173
fs::path exePath (wxHelper::MakeFSPath (standardPaths.GetExecutablePath ()));
170
- // If run from an app bundle, use its parent directory
171
- fs::path appPath = exePath.parent_path ().parent_path ().parent_path ();
172
- fs::path portablePath = appPath.extension () == " .app" ? appPath.parent_path () / " portable" : exePath.parent_path () / " portable" ;
173
- if (fs::exists (portablePath, ec))
174
+ // If run from an app bundle, use its parent directory
175
+ fs::path appPath = exePath.parent_path ().parent_path ().parent_path ();
176
+ fs::path portablePath = appPath.extension () == " .app" ? appPath.parent_path () / " portable" : exePath.parent_path () / " portable" ;
177
+ #ifdef CEMU_ALLOW_PORTABLE
178
+ if (fs::is_directory (portablePath, ec))
174
179
{
175
180
isPortable = true ;
176
181
user_data_path = config_path = cache_path = portablePath;
177
182
data_path = exePath.parent_path ();
178
183
}
179
184
else
185
+ #endif
180
186
{
181
187
SetAppName (" Cemu" );
182
188
wxString appName = GetAppName ();
0 commit comments