Package Files: Difference between revisions

From wiki.jriver.com
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


'''MJP Files can be dangerous.''' In particular, the RUN action gives the package creator full power (as the logged in user)
'''MJP Files can be dangerous.''' In particular, the RUN action gives the package creator full power (as the logged in user)
on your machine. Make sure your plug-ins come from trusted sources, such as the [http://accessories.jrmediacenter.com/mediacenter/accessories.php J. River Skins and Plug-ins page]
on your machine. Make sure your plug-ins come from trusted sources, such as the [http://accessories.jriver.com/mediacenter/accessories.php J. River Skins and Plug-ins page]


==Version 2==
==Version 2==
Line 23: Line 23:
<Name>Package Example plug-in</Name>
<Name>Package Example plug-in</Name>
<Action>UNZIPDIR</Action>
<Action>UNZIPDIR</Action>
<URL>http://www.jrmediacenter.com/PackageExample.zip</URL>
<URL>http://www.jriver.com/PackageExample.zip</URL>
<Version>1.0.10</Version>
<Version>1.0.10</Version>
<HasActions>1</HasActions>
<HasActions>1</HasActions>

Revision as of 21:12, 27 September 2011

An MJP file is just a simple script file which is used to install plug-ins to Media Center (and Media Jukebox). There are two versions of package files, version 1 has package files resembling Windows INI files, and version 2 package files are based on XML.

MJP Files can be dangerous. In particular, the RUN action gives the package creator full power (as the logged in user) on your machine. Make sure your plug-ins come from trusted sources, such as the J. River Skins and Plug-ins page

Version 2

Version 2 package files are based on XML. They begin with

<?xml version="1.0" standalone="yes" ?>

The contents are wrapped in a MJPF atom:

<MJPF version="2.0">
...
</MJPF>

There are two children: Package and Actions:

<Package>
...
</Package>
<Actions>
...
</Actions>

The Package section contains Name, Action, URL, Version, and HasActions:

<Name>Package Example plug-in</Name>
<Action>UNZIPDIR</Action>
<URL>http://www.jriver.com/PackageExample.zip</URL>
<Version>1.0.10</Version>
<HasActions>1</HasActions>

And the Actions section contains a FileEntry for each file. The FileEntry contains a File and as many Action elements as needed:

<FileEntry>
  <File>server_upnp.dll</File>
  <Action>
    <Command>COPY_PLUGINDIR</Command>
  </Action>
  <Action>
    <Command>REGISTER</Command>
  </Action>
</FileEntry>

Version 1

Version 1 package files look like Windows INI files with two sections: [Package] and [Action]. The [Package] section contains entries for Name, Action, Version, and URL. The [Action] section contains entries for files, and actions to be done on those files. For example:

File1=CoolFile.exe
File1Action1=RUN

The filename can be *.*. Multiple files are specified by using File1, File2 etc. Multiple actions are specified by numbering the actions: File1Action1, File1Action2 etc.

Actions

  • COPY_INSTALLDIR - copy files to installation directory
  • COPY_PLUGINDIR - copy files to plug-ins directory
  • COPY_HELPDIR - copy files to help directory
  • COPY_VISUALIZATIONS - copy files to visualization scripts directory with plug-in name appended.
  • COPY_TRACKINFOS - copy files to track infos directory with plug-in name appended.
  • COPY_VISSTUDIO - copy files to Vis Studio directory
  • COPY_SYSDIR - copy files to system directory
  • COPY_WINDIR - copy files to windows directory
  • REGISTER - registers specified COM or ActiveX file.
  • RUN - executes specified file
  • RUN DONTWAIT - executes specified file but does not wait until file file exits. Useful when running ReadMe files.
  • REG_PLUGIN - register Media Jukebox or Winamp plug-in


Example: including the MJP file insize the zip file that is distributed

Here's an example from scthom that shows how to package a plug-in and the MJP file in a single zip. It is required by the way SourceForge hosts files, though having the MJP outside the zip file and a real link for the URL is easier.

[Package]
Name=WavPack Plugin
Action=NONE
Version=2.1.0
URL=in_wavpack.dll
[Action]
File1=in_wavpack.dll
File1Action1=COPY_PLUGINDIR
File1Action2=REG_PLUGIN

Use Action=NONE when the mjp is inside the zip.