Controlling the Global User Directory: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
(Restoring deleted instructions. Portable.txt especially must not be removed, and operating system instructions should remain as well as it differs significantly between OSes.)
(→‎Windows: a bit late, but updated the guide to reflect the new default folder on Windows)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''Global User Directory''' was brought to Windows in {{revision|3.5-2381}} and release {{revision|4.0}}. Now, like Linux and macOS before it, Windows builds have a central location where saves, settings, screenshots, themes, etc are kept. All builds will have the same settings and saves, and updating from one revision to another will be much easier.
The user directory is where Dolphin stores saves, settings, screenshots, and other data. Where the user directory is located depends on the Dolphin version, operating system, and your configuration. Some locations let the user directory be shared by different installations of Dolphin (a global user directory), and some locations are tied to a specific installation of Dolphin (a local user directory).


= Windows =
== Windows ==
== Moving Saves and Settings from Older Versions ==
Dolphin {{revision|3.5-2368}} and earlier always used a local user directory, stored in the same folder as <tt>Dolphin.exe</tt> and named <tt>User</tt>. Starting with {{revision|3.5-2381}}, the global user directory system was introduced on Windows and the default user directory changed to a subfolder inside the <tt>Documents</tt> folder, named <tt>Dolphin Emulator</tt>.  
Moving saves and settings from an older version of Dolphin to {{revision|4.0}}-era builds is easy. The default location of the Global User Directory is <var>%userprofile%\My Documents\Dolphin Emulator\</var>. To preserve game saves, copy over the <var>\GC\</var> and <var>\Wii\</var> folders which are under the old build's <var>\User\</var> folder to the directory currently specified by Global User Directory. The same can be done for settings by copying over the <var>\Config\</var> folder.
*It may be more convenient to copy all of the content from the old <var>\User\</var> folder to the Dolphin Emulator folder, however the <var>\GameConfig\</var> folder will be ignored.


== Choose the Default Location of the Dolphin Profile ==
The default folder changed again on {{revision|5.0-18242}}, which now defaults to <tt>%AppData%\Dolphin Emulator</tt>, however, for backwards compatibility, the previous location will remain in use if it exists when launching Dolphin {{revision|5.0-18242}} or newer for the first time. Additionally, it's possible to configure Dolphin to still use a local user directory or another custom location, as explained below.
*Open the registry. Simply type "regedit" in the search bar of the Start Menu and hit enter.
 
=== Disable the Global User Directory for a Specific Build with "portable.txt" ===
To make a build use a local user directory, create a text file named "portable" next to the executable files of the build. With the extension it should be named "portable.txt". Dolphin will check if that file exists in the same directory, then it will not use the global user directory, instead it will create and use the local user directory in the same directory.
 
=== Custom Command Line Path ===
If you are launching Dolphin from the command line, you can set a custom user directory path for the current session of Dolphin by using the <tt>-u</tt> option:
 
<pre>C:\Path\To\Dolphin\Build\Dolphin.exe -u E:\Path\To\User\Directory\</pre>
 
Dolphin will use the regular user directory path again the next time you launch Dolphin, unless you use <tt>-u</tt> again.
 
=== Registry Configuration ===
The user directory behavior can be changed for all Dolphin installations at once using the registry. Editing the registry is an advanced topic and is not recommended for most users!
 
==== Choose the Location of the Global User Directory ====
*Open the registry. Type "regedit" in the search bar of the Start Menu and hit enter.
*Expand <var>HKEY_CURRENT_USER</var>.
*Expand <var>HKEY_CURRENT_USER</var>.
*Right click <var>Software</var> and select <var>New &gt; Key</var>. Name the key <kbd>Dolphin Emulator</kbd>.
*Right click <var>Software</var> and select <var>New &gt; Key</var>. Name the key <kbd>Dolphin Emulator</kbd>.
Line 13: Line 26:
*Double click the "UserConfigPath" value and an Edit String dialog appears. Under "Value Data", enter the path to the custom User directory. Make sure that the "User" folder is explicitly specified, since Dolphin will assume whatever path it is directed to is the <var>\User\</var> folder. If it is pointed to Desktop for example, the Desktop will be flooded with folders unnecessarily.
*Double click the "UserConfigPath" value and an Edit String dialog appears. Under "Value Data", enter the path to the custom User directory. Make sure that the "User" folder is explicitly specified, since Dolphin will assume whatever path it is directed to is the <var>\User\</var> folder. If it is pointed to Desktop for example, the Desktop will be flooded with folders unnecessarily.


== Disable the Global User Directory for a Specific Build with "portable.txt" ==
==== Use Local User Directories ====
To make a build use a local user directory, create a text file named "portable" next to the executable files of the build. With the extension it should be named "portable.txt". Dolphin will check if that file exists in the same directory, then it will not use the global user directory, instead it will create and use the local user directory in the same directory.
*Open the registry. Type "regedit" in the search bar of the Start Menu and hit enter.
 
== Local User Directory for Any Build with "LocalUserConfig" registry key ==
The Global User Directory system can be disabled entirely with a registry key. The key is global, so it is a "once and for all" change.
 
When done editing the Windows Registry, and before launching Dolphin, be sure to move the <var>\User\</var> folder along with Dolphin executable files (or check if it's placed correctly). Otherwise, Dolphin will create a new one instead.
 
=== Manual Registry Editing ===
*Open the registry. Simply type "regedit" in the search bar of the Start Menu and hit enter.
*Expand <var>HKEY_CURRENT_USER</var>.
*Expand <var>HKEY_CURRENT_USER</var>.
*Right click <var>Software</var> and select <var>New > Key</var>. Name the key <kbd>Dolphin Emulator</kbd>.
*Right click <var>Software</var> and select <var>New > Key</var>. Name the key <kbd>Dolphin Emulator</kbd>.
Line 28: Line 33:
*Double click the "LocalUserConfig" value and an Edit String dialog appears. Under "Value Data", type the number <var>1</var>.
*Double click the "LocalUserConfig" value and an Edit String dialog appears. Under "Value Data", type the number <var>1</var>.


=== Automatic Process with .REG Files ===
== Linux ==
These registry keys can be created and removed with .reg files to make the process easier.
By default, Dolphin uses a global user directory and follows the [https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG Base Directory Specification] for determining its location. If the directory <tt>~/.dolphin-emu</tt> exists, or you are using a version of Dolphin older than {{revision|4.0-8143}}, <tt>~/.dolphin-emu</tt> will be used as the location of the global user directory instead.


To create the LocalUserConfig registry key, open notepad, paste the following in it and save it as a .reg file:
=== Disable the Global User Directory for a Specific Build with "portable.txt" ===
<pre>Windows Registry Editor Version 5.00
In Dolphin {{revision|5.0-148}} and later, it's possible to use the same <tt>portable.txt</tt> method as on Windows to set a local user directory for a Dolphin build.
[HKEY_CURRENT_USER\Software\Dolphin Emulator]
"LocalUserConfig"="1"</pre>


To remove the LocalUserConfig registry key and revert back to the Global User Directory system, open notepad, paste the following in it and save it as a .reg file:
To make a build use a local user directory, create a file named <tt>portable.txt</tt> in the same directory as the executable files of the build. Dolphin will check if that file exists in the same directory, then it will not use the global user directory, instead it will create and use the local user directory in the same directory.
<pre>Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Dolphin Emulator]
"LocalUserConfig"=-</pre>


The first key will set all Dolphin builds to use a Local User Directory, whereas the second will remove the Local User config and return to the Global User Directory system.
=== Custom Command Line Path ===
If you are launching Dolphin from the command line, you can set a custom user directory path for the current session of Dolphin by using the <tt>-u</tt> option:


== Use a Shortcut to Use a Specific User Directory for a Specific Build ==
<pre>/path/to/dolphin/build/dolphin-emu -u /path/to/user/directory</pre>
A shortcut can be customized to tell a specific build to use a specific user directory. This also overrides the portable.txt file.
*Create a shortcut to the Dolphin build you want to use.
*Open the shortcut's properties and edit the target field. After the path to dolphin, add an argument <var>-u</var> (case sensitive) then add the desired path to user folder. As such example:


<pre>Dolphin.exe -u "%userprofile%\Documents\Dolphin Emulator 2"</pre>
Dolphin will use the regular user directory path again the next time you launch Dolphin, unless you use <tt>-u</tt> again.


Anytime you want that build to use the specified user directory, just run the custom shortcut. If you launch Dolphin without the custom shortcut it will use the Global User Directory or portable.txt, as normal.
=== Environment Variable ===


= Linux and macOS =
If you set the <tt>DOLPHIN_EMU_USERPATH</tt> environment variable, Dolphin will use its value as the path to the user directory.
Linux and macOS always use a Global User Directory. One can choose the directory's location with the command:
 
== macOS ==
 
By default, Dolphin uses a global user directory located at <tt>~/Library/Application Support/Dolphin</tt>.
 
=== Custom Command Line Path ===
If you are launching Dolphin from the command line, you can set a custom user directory path for the current session of Dolphin by using the <tt>-u</tt> option:


<pre>/path/to/dolphin/build/dolphin-emu -u /path/to/user/directory</pre>
<pre>/path/to/dolphin/build/dolphin-emu -u /path/to/user/directory</pre>
Dolphin will use the regular user directory path again the next time you launch Dolphin, unless you use <tt>-u</tt> again.
=== Environment Variable ===
If you set the <tt>DOLPHIN_EMU_USERPATH</tt> environment variable, Dolphin will use its value as the path to the user directory.
== Android ==
Old versions of Dolphin always use the directory <tt>dolphin-emu</tt> on shared storage as the user directory. This directory is shared between different installations of Dolphin and is not automatically deleted when you uninstall Dolphin.
Dolphin {{revision|5.0-15348}} and newer comply with Google's scoped storage policy and normally use the directory <tt>Android/data/org.dolphinemu.dolphinemu/files</tt> on shared storage as the user directory. This directory is difficult to access in most file managers on Android 11 and newer, and by default all data in the directory will be deleted when you uninstall Dolphin. However, if <b>all</b> of the following applies, the old <tt>dolphin-emu</tt> location will be used as the user directory instead:
* Scoped storage is disabled
* <tt>Android/data/org.dolphinemu.dolphinemu/files</tt> does not exist or is empty
* <tt>dolphin-emu</tt> exists
* When Dolphin requests permission to access your files, you press Allow
Scoped storage is disabled if <b>at least one</b> of the following applies:
* You are using Android 10 or older <!-- TODO: What exactly happens when updating from Android 10 with Dolphin installed? Is scoped storage intended to stay disabled? Does the preserveLegacyExternalStorage bug affect it? -->
* You were using Dolphin {{revision|5.0-15341}} or older when you installed Dolphin, and you haven't uninstalled Dolphin since then, and you haven't triggered the preserveLegacyExternalStorage bug since then
* You have manually disabled scoped storage for Dolphin using the following command (only possible if you have a rooted device or a debug version of Dolphin), and you haven't triggered the preserveLegacyExternalStorage bug since then: <pre>cmd appops set org.dolphinemu.dolphinemu android:legacy_storage allow && am force-stop org.dolphinemu.dolphinemu</pre>
[https://cs.android.com/android/_/android/platform/frameworks/base/+/c57e3455ff29b0a15a8781a34c19c6ded196f69e The preserveLegacyExternalStorage bug] is triggered when <b>all</b> of the following applies at the same time:
* You are using Android 11 (not Android 12 or newer)
* The installed version of Dolphin is {{revision|5.0-15348}} or newer
* You restart your device


[[Category:Tutorials]]
[[Category:Tutorials]]

Latest revision as of 05:43, 31 March 2023

The user directory is where Dolphin stores saves, settings, screenshots, and other data. Where the user directory is located depends on the Dolphin version, operating system, and your configuration. Some locations let the user directory be shared by different installations of Dolphin (a global user directory), and some locations are tied to a specific installation of Dolphin (a local user directory).

Windows

Dolphin 3.5-2368 and earlier always used a local user directory, stored in the same folder as Dolphin.exe and named User. Starting with 3.5-2381, the global user directory system was introduced on Windows and the default user directory changed to a subfolder inside the Documents folder, named Dolphin Emulator.

The default folder changed again on 5.0-18242, which now defaults to %AppData%\Dolphin Emulator, however, for backwards compatibility, the previous location will remain in use if it exists when launching Dolphin 5.0-18242 or newer for the first time. Additionally, it's possible to configure Dolphin to still use a local user directory or another custom location, as explained below.

Disable the Global User Directory for a Specific Build with "portable.txt"

To make a build use a local user directory, create a text file named "portable" next to the executable files of the build. With the extension it should be named "portable.txt". Dolphin will check if that file exists in the same directory, then it will not use the global user directory, instead it will create and use the local user directory in the same directory.

Custom Command Line Path

If you are launching Dolphin from the command line, you can set a custom user directory path for the current session of Dolphin by using the -u option:

C:\Path\To\Dolphin\Build\Dolphin.exe -u E:\Path\To\User\Directory\

Dolphin will use the regular user directory path again the next time you launch Dolphin, unless you use -u again.

Registry Configuration

The user directory behavior can be changed for all Dolphin installations at once using the registry. Editing the registry is an advanced topic and is not recommended for most users!

Choose the Location of the Global User Directory

  • Open the registry. Type "regedit" in the search bar of the Start Menu and hit enter.
  • Expand HKEY_CURRENT_USER.
  • Right click Software and select New > Key. Name the key Dolphin Emulator.
  • Right click the new Dolphin Emulator key, and select New > String Value. Name the value UserConfigPath.
  • Double click the "UserConfigPath" value and an Edit String dialog appears. Under "Value Data", enter the path to the custom User directory. Make sure that the "User" folder is explicitly specified, since Dolphin will assume whatever path it is directed to is the \User\ folder. If it is pointed to Desktop for example, the Desktop will be flooded with folders unnecessarily.

Use Local User Directories

  • Open the registry. Type "regedit" in the search bar of the Start Menu and hit enter.
  • Expand HKEY_CURRENT_USER.
  • Right click Software and select New > Key. Name the key Dolphin Emulator.
  • Right click the new Dolphin Emulator key, and select New > String Value. Name the value LocalUserConfig.
  • Double click the "LocalUserConfig" value and an Edit String dialog appears. Under "Value Data", type the number 1.

Linux

By default, Dolphin uses a global user directory and follows the XDG Base Directory Specification for determining its location. If the directory ~/.dolphin-emu exists, or you are using a version of Dolphin older than 4.0-8143, ~/.dolphin-emu will be used as the location of the global user directory instead.

Disable the Global User Directory for a Specific Build with "portable.txt"

In Dolphin 5.0-148 and later, it's possible to use the same portable.txt method as on Windows to set a local user directory for a Dolphin build.

To make a build use a local user directory, create a file named portable.txt in the same directory as the executable files of the build. Dolphin will check if that file exists in the same directory, then it will not use the global user directory, instead it will create and use the local user directory in the same directory.

Custom Command Line Path

If you are launching Dolphin from the command line, you can set a custom user directory path for the current session of Dolphin by using the -u option:

/path/to/dolphin/build/dolphin-emu -u /path/to/user/directory

Dolphin will use the regular user directory path again the next time you launch Dolphin, unless you use -u again.

Environment Variable

If you set the DOLPHIN_EMU_USERPATH environment variable, Dolphin will use its value as the path to the user directory.

macOS

By default, Dolphin uses a global user directory located at ~/Library/Application Support/Dolphin.

Custom Command Line Path

If you are launching Dolphin from the command line, you can set a custom user directory path for the current session of Dolphin by using the -u option:

/path/to/dolphin/build/dolphin-emu -u /path/to/user/directory

Dolphin will use the regular user directory path again the next time you launch Dolphin, unless you use -u again.

Environment Variable

If you set the DOLPHIN_EMU_USERPATH environment variable, Dolphin will use its value as the path to the user directory.

Android

Old versions of Dolphin always use the directory dolphin-emu on shared storage as the user directory. This directory is shared between different installations of Dolphin and is not automatically deleted when you uninstall Dolphin.

Dolphin 5.0-15348 and newer comply with Google's scoped storage policy and normally use the directory Android/data/org.dolphinemu.dolphinemu/files on shared storage as the user directory. This directory is difficult to access in most file managers on Android 11 and newer, and by default all data in the directory will be deleted when you uninstall Dolphin. However, if all of the following applies, the old dolphin-emu location will be used as the user directory instead:

  • Scoped storage is disabled
  • Android/data/org.dolphinemu.dolphinemu/files does not exist or is empty
  • dolphin-emu exists
  • When Dolphin requests permission to access your files, you press Allow

Scoped storage is disabled if at least one of the following applies:

  • You are using Android 10 or older
  • You were using Dolphin 5.0-15341 or older when you installed Dolphin, and you haven't uninstalled Dolphin since then, and you haven't triggered the preserveLegacyExternalStorage bug since then
  • You have manually disabled scoped storage for Dolphin using the following command (only possible if you have a rooted device or a debug version of Dolphin), and you haven't triggered the preserveLegacyExternalStorage bug since then:
    cmd appops set org.dolphinemu.dolphinemu android:legacy_storage allow && am force-stop org.dolphinemu.dolphinemu

The preserveLegacyExternalStorage bug is triggered when all of the following applies at the same time:

  • You are using Android 11 (not Android 12 or newer)
  • The installed version of Dolphin is 5.0-15348 or newer
  • You restart your device