# Portable OpenCPN

An updated version for OpenCPN 4.6.1 is also available

The OpenCPN portable option allows the program to run from an USB stick, or run independent from, and parallel to a normal installation.

Using Windows, it is not possible to run concurrent instances of OpenCPN, unless using the portable option.

- You can start the regular OpenCPN and a portable version later. The other way around will not work.
- You can run multiple portable instances at the same time. It makes sense to run these from different folders, to avoid possible data corruption.

To differ between various instances of the program, the titlebar on portable versions looks like this.

It is thus possible to run multiple portable instances and identify each version.

### To create a portable Windows version

1. Create a new directory dedicated to the portable OpenCPN.
2. In a separate window, navigate to C:\Program Files (x86)\OpenCPN (on 64-bit systems) or C:\Program Files\OpenCPN (on 32-bit systems), and copy (don't move) the following data directories (with containing files) into this new directory:
   - doc/
   - plugins/
   - s57data/
   - share/
   - sounds/
   - tcdata/
   - uidata/
   - wvsdata/ (only for OpenCPN 3.2.0 and earlier)
3. From the same OpenCPN folder, copy the following files into the new directory:
   - crashrpt_lang.ini
   - CrashRpt1401.dll
   - CrashSender1401.exe
   - license.txt
   - OpenCPN.exe (of course)
   - Eight wxWidgets dlls beginning with the name “wxbase” (This needs an expert's attention)
4. Now navigate to C:\Windows\SysWOW64 (on 64-bit systems) or C:\Windows\System32 (on 32-bit systems) and copy the following files into the new directory:
   - msvcp100.dll
   - msvcr100.dll
5. If running Windows, create MSDOS batch file “opencpn portable.bat” (or other name of user choice) containing the one line:

    <code>
    opencpn -p
    </code>

This file must be in the new directory. If you want your batch file to be in a different directory, you must edit the batch file to include “cd” commands to navigate into the new directory before the line containing the “opencpn -p” command.

To run OpenCPN portably within this directory, simply execute the “opencpn portable” batch file. There may be a way to build a click-able shortcut to OpenCPN, with the -p option specified in the shortcut. But I could not figure it out. Windows insists upon a drive letter in the command line of the shortcut, which would defeat the whole purpose of portability.Thus, the batch file….

If the charts are also in the current dir, then the entire installation is “portable”, meaning there are no hard-coded drive letter dependencies, and all write activities occur in the current dir only.

This setup works very well from a USB stick.

##### Additional Notes for OpenCPN v4.1.xx and 4.2

Use these files they are more current

- msvcp120.dll ←-better than msvcp100.dll
- msvcr120.dll ←-better than msvcr100.dll
- libcurl.dll ←-needed for chartdownloader and other features.
- 16 wxWidgets ←-Files in main directory, rather than the 8 mentioned, best to copy all.
- zlib1.dll ←-Also best to copy zlib1.dll

For a higher running priority see: Command Line

### A Linux version

On Linux, a similar functionality exists. The 32 and 64 bits issue is similar.

32 bits version can be made to work on a 64 bits Linux by installing ia32-libs or multiarch support packages. The opposite way, a 64 bit version on a 32 bit system, will not work.

Copy the opencpn executable binary and the data directories mentioned above to a local directory.

In that directory, do:

    $ ./opencpn -p

This will cause all user data files to be created and used from within that local directory. This can be useful for side-by-side testing…