The Good Life... a weblog about life, technology, and the Opera Web browser

Running Multiple Versions of Opera on OS X

Unlike its brethren on Windows and UNIX/Linux, it has not been possible to specify the profile directory for Opera on OS X, making it difficult to maintain multiple installations. This is particularly problematic if snapshots are not set to use the correct profile directories (which happens from time to time) or when trying to migrate from a snapshot to a final release. Discussed below are two ways to circumvent these problems.

The PrefsSuffix File

To force snapshots to use a different profile for snapshots, a single file is added to the Opera.app package: PrefsSuffix (with no file extension). This file should be located in the Opera.app/Contents/Resources/ directory and contains a string to append to the default profile directories. For instance, the Opera 10.0 snapshots' PrefsSuffix file contains "10" (sans quotes), which makes the profile directory ~/Library/Preferences/Opera Preferences 10/ instead of the default ~/Library/Preferences/Opera Preferences/. The PrefsSuffix is also appended to the default Application Support and Cache directories, making Opera use a completely unique profile.

Here's a step-by-step method for using a PrefsSuffix file:

  1. Create a text file named "PrefsSuffix" with no extension.
  2. Add the desired profile directories suffix in the text file. For instance, if you want Opera to use "Opera Preferences Peregrine Beta" for preferences, you'll put "Peregrine Beta" (sans quotes) in the text file.
  3. Right-click on the Opera.app and choose "Show Package Contents".
  4. Navigate to Contents/Resources/ and copy the "PrefsSuffix" file there.
  5. Optionally rename Opera.app.

The PrefsSuffix can contain alphanumeric characters (A-Za-z), spaces (" "), and/or dashes ("-").

It's important to remember to update the PrefsSuffix file any time the Opera.app package is changed, such as when installing a new snapshot or when auto-updating. If the PrefsSuffix file is missing, the default profile directories will be used.

All paths in Opera's preferences files must be updated before a profile can be copied from the default location to a new directory for use with a PrefsSuffix.

Setting the PrefsSuffix from the Command-Line

Since it's not always easy to remember to update the PrefsSuffix file, there's another method to set the PrefsSuffix from the command-line. Opera can be run from the command-line with the "-pd" switch followed by a string to append to the default profile directory locations. For instance, if Opera.app is in /Applications/, you would type "/Applications/Opera.app/Contents/MacOS/Opera -pd 10" to use the ~/Library/Preferences/Opera Preferences 10/ preferences directory. If the desired PrefsSuffix contains whitespace, the string should be quoted (e.g. '/Applications/Opera.app/Contents/MacOS/Opera -pd "Peregrine Beta"'.

Running Opera from the command-line using "-pd" will not override a PrefsSuffix file in Opera.app.

Tips and Tricks

Using the PrefsSuffix file, it's easy to have multiple versions of Opera running side-by-side. For instance, a user could have "Opera Kestrel.app" with a PrefsSuffix file containing "Kestrel" and "Opera Snapshot.app" with a PrefsSuffix containing "Snapshot" to keep the latest stable and snapshot versions separated. Using QuickSilver, you can easily run each version of Opera simultaneously.

Since running a snapshot without a PrefsSuffix can have unintended consequences, it's a good idea to always use a PrefsSuffix file with Opera. Thus, if an unstable build inadvertently doesn't use a PrefsSuffix, it can't cause problems with a users' primary Opera installation.

Comments

Note: Comments with a light blue background were made by the site owner.

Re: Running Multiple Versions of Opera on OS X

Tahnk you very much for this info.
:)

Re: Running Multiple Versions of Opera on OS X

This is your solution ? You got to be kidding, no need to mess with command line, just place the beta version inside user/Applications, geesh why do people make it so complicated, not everybody uses commandline.

Re: Running Multiple Versions of Opera on OS X

If you use the PrefsSuffix file, you don't have to use the command-line. Plus, won't an application in /Users/<user>/Applications/ use the same profile directory as an application in /Applications/?