How to make OpenMPT portable?

Started by LPChip, August 31, 2007, 12:17:14

Previous topic - Next topic


Note: This information is outdated and won't work with OpenMPT 1.18
For this reason, this topic has been moved from the technical docs to the general chatter area.
Please read this article if you want to know how to enable the portable mode in OpenMPT 1.18+

Lets say, you have this nice USB Stick or Removable HardDrive, and you want to use this to make OpenMPT portable?

You could copy OpenMPT to the drive and be done with it.

It will work, but it will disable a few features, such as VST Plugins, because they have the path hardcoded in the database.

I hereby present you a solution to make OpenMPT fully portable so you can put it on a stick, and it doesn't matter where you are, you'll always can make music (unless that computer doesn't have a soundcard :P)

Installation steps to make OpenMPT portable

  • Copy OpenMPT. The first step is to copy OpenMPT to your stick (or other destination). You can even download a fresh install to use it.
  • Create/Copy your VST directory to the stick. The directory can be anywhere, and doesn't have to be inside the OpenMPT directory. However, it can be simpler to put everything in the OpenMPT directory, but thats entirelly up to you.
  • Do the same as above for your songs and instruments. Also for these it counts that you can put it in or outside your OpenMPT directory.
  • Second last step. Make a startup file. Its this step that will make your OpenMPT portable.

    In the directory of where you have OpenMPT installed, create a new file and call it OpenMPT.bat. Right click your newly created file, and choose "edit".

    In there, enter the following code:

subst O: .
subst P: "\music\VST Plugins"
subst R: "\music\Samples & Instruments"
subst S: "\music\Songs"
subst /d o:
subst /d p:
subst /d r:
subst /d s:

Note that the paths are relative paths from the location where you start OpenMPT.bat. I used the . for O: to use the current path. If you want to put the OpenMPT.bat outside the openMPT folder, make sure you adjust that path too. Also edit the other paths to your needs. If you made all the other directories inside the OpenMPT dir, you only need this:

subst O: .
subst /d o:

If you have a music folder with all subfolders in it, you can do it like this:

subst O: \music
subst /d o:

    As you can see, its all quite flexible.

  • Final step. Now you only need to launch OpenMPT and set all the paths to the new driveletter(s). Note that in order to load your VST effects/instruments, you need to completelly remove them from OpenMPT before you can add them again, or they simply won't work.
I hope this made sense to you. If you have a problem with your install, feel free to ask. If you ask, please provide as much information on what you currently have, and what you want to make.


I have my usb stick at E:\.
I have my OpenMPT folder at E:\PortableApps\Music\OpenMPT.
I have my VST folder at E:\PortableApps\Music\VST.
I have my Samples folder at E:\PortableApps\Music\Samples.

And I want to use driveletter Q: to start all.

Response is:

subst Q: \PortableApps\Music
subst /d Q:

And settings in OpenMPT are all using Q:
Note, that when you close OpenMPT, it will automatically remove the O: or Q: drive association.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs


Another option is to make Plugins, Songs, Samples etc directories in OpenMPT directory, copy there plugins and everything you want to be on USB stick, register all plugins/soundbanks from these directories and remove all other plugins from OpenMPT Plugin setup. Then exit OpenMPT and edit "mptrack.ini" and "plugin.cache" files by hand  :lol:  -  remove all absolute paths from there - you may just auto-replace string "C:\Program Files\OpenMPT" or wherever you have your OpenMPT installed to empty string in your favorite text editor. Note that if you'll add another plugin the ini files will contain absolute path to it - you'll need to edit them again - other than that described method works fine.