Apps Package is a small package management system that designed for the My Cloud EX Series products. We refer to Add-ons in the document as Apps. As you can see by the below image, the UI refers to Add-ons as Apps. The SDK v2.0 provides basic functions to control packages. These controls are: install, remove, start, and stop. You only need to use the templates that are contained in the SDK, which are just simple shell scripts to create an App quickly and easily without writing complex programs.

Apps Package SDK v2.0

Apps Package SDK v2.0 includes the below three components:

    mksapkg: wrapping application into an App package

    document: this file

    sample: an easy sample that guides on how to create your own App

Getting Started: Using mksapkg

mksapkg is a small tool to help users create their own App for My Cloud NAS and it is based on Apps Package SDK v2.0. We provide the executable binary that users can use to create their own Apps on our system. Users must install libxml2 and GNU “tar” in their Linux system to run mksapkg**

Usage: mksapkg -E -s -m [module_name]

Missing xml2 library? For Fedora:

$ yum -y install libxml2 libxml2-devel

Write your own apkg.rc file

All string characters cannot contain spaces except the description field.

Package: utelnetd (the max length is 64)
Section: Apps
Version: 1.00 (the max length is 32)
Packager: WD (the max length is 32)
Email: (the max length is 64)
Homepage: (the max length is 64)
Description: This is a simple demonstration to wrapped telnet daemon. (the max length is 256)
AddonShowName: utelnetd (the max length is 64)
Icon: utelnetd.png


Here are the definitions of variables in apkg.rc:


About UserControl

UserControl is used to control the App visibility. Based on the parameter, the App could be visible on admin account only or both admin and user accounts.

If the UserControl value is “1”, only the admin can see the app.


Dropbox is set to “1”, and normal user can’t see the app.

Login by Admin:

Login by User:

About CenterType

If the CenterType value is “1”, and the setting page will build-in.

The CentherType value is “0”, and the setting page will pop-out.

Setting page build-in:

Setting page pop-out:

About MinFWVer & MaxFWVer

MinFWVerCurrent firmwareMaxFWVer

Format: 1.xx.xx.xx (support 6 token) 

If the MaxFWVer or MinFWVer is empty and it won’t check the min version or max version. The version limitation will check the current firmware version when installing apps.


MinFWVer: 1.03.00
MaxFWVer: 1.04.00

If the current firmware version is 1.02.00 or 1.05.00, App installation will return a failure.

About IndividualFlag

WebUI will show some notice information for Apps. If the App is completed by ALPHA, we will hide the information.

Note: Support for each App should be obtained through the developer directly. The App's description in the WebUI shows support contact information.

About AddonIndexPage

If the “AddonIndexPage” is empty, the App will not provide a setting page.

The WebUI will still show the “configure” button, but it will not work.

Dependency & conflict rules defined by the App SDK v2.0:


Package:       A
InstDepend:    B
InstConflict:  C
StartDepend:   D
StartConflict: E, F

_   App A can't install when App B is not installed
_   App A can't install when App C is installed
_   App A can't enable when App D is not enabled
_   App A can't enable when App E or F is enabled

About Version

It must conform to the following format: xx.xx (ex: 1.2, 1.02, or 10.1, x is for numeric number only) 

When running mksapkg **, it will parse apkg.rc to create apkg.xml, and apkg.xml will be used by the App Server to get information about the installed App.



<?xml version="1.0" encoding="UTF-8"?>
      <description> This is a simple demonstration to wrapped telnet daemon.</description>


- The name of the directory where mksapkg is run from must match the app name. If not, app installation will fail.

- The app name is from “package name” in the apkg.rc file.

- Because mksapkg will compress the current directory when making the app, apkg will get app name which is from apkg.rc and use the name to check. If the app name doesn’t match with the directory name, app installation will fail.

Shell script files This script is used to pre-run some commands if needed, or for user to back up their configuration files to other places such as: /tamp, /var/tmp or any directory on your hard drive before installing an App. Will copy files and install App to an appropriate folder. Will remove the installed App from hard drive. Will create necessary symbolic links of installed App before being executed (we suggest creating the symbolic link to /usr/bin or /usr/sbin). If necessary, restore the configuration files backed up through back to the App installation directory. Will remove all links or files that created by Will start App daemon. Will stop App daemon.

Apps Package Naming Rules and Header Definition


Ex: WDMyCloudEX4 utelnetd Package v1.00_03012013



        apkg header       
      Module tar file     

Header structure definition

typedef struct _APKG_HEADER_
   char           ah_magic_num[MAGIC_NUM_LEN];
   char           ah_module_name[APKG_64_LEN];
   char           ah_version[APKG_32_LEN];
   int            ah_apkg_version;
   int            ah_product_id;
   int            ah_custom_id;
   int            ah_model_id;
   char           ah_reserve[64];
   unsigned long  ah_checksum;
   unsigned long  ah_length;

Header magic number definition: the last byte of magic number must be 0x5a in App SDK v2.0

WDMyCloudEX4: {0x4c,0x69,0x67,0x68,0x74,0x6e,0x69,0x5a}


When the Web UI uploads an App package, it is installed to:

Example : module name is (MNAME) = utelnetd
default install path: (INST_PATH) = /mnt/HD/HD_a2/Nas_Prog/$MNAME
default upload path: (UPLOAD_PATH) = /mnt/HD/HD_a2/Nas_Prog/_install

The install and upload path is scanned dynamically by the App server when daemon is initiated.


When installing a new App, the following shell script will be called:



When removing an App, the following shell script will be called:



When enabling an App, the following shell script will be called:



When disabling an App, the following shell script will be called:



When re-installing an App, the following shell script will be called:


When your app has its own configure file settings, you need to backup these files to other place in script file and copy files back in Because will remove all configuration files of this App on the hard disk and reinstall it in Beware of incorrect shell script files which may cause the system to crash. For example, without the remove link from hard drive correctly, it may cause the system to format hard drive failure due to hard drive can't be un-mounted.

App Server

  • The App Server will scan all volume to find out the installed Apps and enable it, if necessary
  • The App Server will control and maintain installed database of Apps
  • Apps Server will provide interface to run shell script file from Web GUI

The main purpose of Apps SDK v2.0 is implemented the App dependencies and configuration check.

Sample App Package Without a Web UI

Prepare the necessary binaries of your application, and create a folder name that is the same name as the Package field in the apkg.rc file.

$ ls -R
apkg.rc  bin



Create your own apkg.rc file

Package:            utelnetd
Version:            1.00
Packager:           WD
Homepage:           http://
Description:        This is a simple demonstration to wrapped telnet daemon.
Icon:               utelnetd.png
AddonShowName:      utelnetd




#we do nothing here for utelnetd


Write (most apps will use this example)


mv $path_src $path_des


Write (most apps will use this example)


rm -f /usr/bin/utelnetd 2> /dev/null
rm -f /var/www/utelnetd >/dev/null
rm -rf $path





#create link
ln -s $path/sbin/utelnetd /usr/bin/utelnetd
ln -s $path/var/www/utelnetd /var/www

#cmd on pre-install
while [ $idx -lt 7 ]; do
     mknod /dev/ptyp$idx c 2 $idx 2>/dev/null
     mknod /dev/ttyp$idx c 3 $idx 2>/dev/null
     idx=`expr $idx + 1`




#remove link
rm -f /usr/bin/utelnetd  2> /dev/null
rm -f /var/www/utelnetd >/dev/null
rm -f /dev/ttyp*
rm -f /dev/ptyp*




#start daemon
utelnetd -d




#stop daemon
killall utelnetd


Create Apps package using mksapkg

[hostname ~ /mksapkg/utelnetd]$ ls
apkg.rc  bin
[hostname ~ /mksapkg/utelnetd]$ mksapkg -E -s -m WDMyCloudEX4
        mksapkg version: v1.1

NAS type:               WDMyCloudEX4
module name:            utelnetd
module versioin:        1.00
packager:               WD

header length:          26659
header checksum:        E40297BE

Add-ons "../WDMyCloudEX4_utelnetd_1.00.bin(06192013)" create!


What happens when the installed App doesn’t work?

If an App is not installed correctly, then the package will not install, remove, enable, or disable due to improper shell script files creation. It is easy to solve this error by removing the installed package folder and sending a rescan command to the APKG daemon.

# rm -rf /mnt/HD/HD_a2/Nas_Prog/utelnetd
# kill -USR1 `pidof apkg`

When you are at the stage of development, it is recommended not to install other Apps. This is because a clean environment will help you to reduce development time for debugging.

Create web page

Check these items in the apkg.rc file:

Package:            hello
Icon:               hello.png
AddonShowName:      hello
AddonIndexPage:     index.html

Note: If your package does not require a GUI, make sure the AddonIndexPage field is empty.

In the Application page, we need to have an App icon and the recommended icon size is 128xn or nx128 (n > 128).

Icon naming rules: Package_name.png.

When package name is hello, you should rename icon file as hello.png. And make sure the icon can be found in the /var/www/hello/hello.png. 
Put your html, jpg, css files in the webpage directory. You should link webpage to /var/www/hello, because the root path of web server is /var/www. 
When you implement cgi functions, you should link to /var/www/cgi-bin. Just write it down on script file. And remember to add remove link command on script file.

ln -s $path/webpage /var/www/hello
ln -s $path/cgi/* /var/www/cgi-bin/

Make sure the path of index file is correct. ex:

AddonIndexPage:     index.html  -> you should have this file in /var/www/hello/index.html
AddonIndexPage:     /web/index.html -> you should have this file in /var/www/hello/web/index.html

Multi-language Support

We support multiple languages in the app’s description. Please put language xml file to Addon_Name/web/desc.xml and link the language file to /var/www/Addon_Name in when creating the addon package.

1. Put language xml file to the add-on folder. 

2. Add link command for the desc.xml file to

Path=” /mnt/HD/HD_a2/Nas_Prog/aMule”

ln -s $path/web/desc.xml  $WEBPATH

You can put “desc.xml” to anywhere in add-on package, but you must link the page to its folder.

The Web UI will check the “desc.xml” file to show the indicated language.

The desc.xml example for Icecast:

<?xml version="1.0" encoding="utf-8"?>
  <en-US>A free server software for streaming multimedia.</en-US>
  <cs-CZ>Bezplatný serverový software pro vysílání multimediálního obsahu.</cs-CZ>
  <de-DE>Eine kostenlose Serversoftware für das Streaming von Multimedia-Inhalten.</de-DE>
  <es-ES>Software gratuito de servidor para transmitir contenido multimedia.</es-ES>
  <fr-FR>logiciel serveur gratuit de diffusion de contenus multimédias.</fr-FR>
  <hu-HU>Ingyenes kiszolgálószoftver a multimédiás tartalmak adatfolyam útján történ_ továbbításához.</hu-HU>
  <it-IT>software server gratuito per lo streaming dei contenuti multimediali.</it-IT>
  <ja-JP>マルチメディア ストリーミング用の無料サーバー ソフトウェア。</ja-JP>
  <ko-KR>멀티미디어 스트리밍을 위한 무료 서버 소프트웨어.</ko-KR>
  <no-NO>Et gratis serverprogram for direkteavspilling av multimedia.</no-NO>
  <nl-NL>Een gratis serversoftware voor het streamen van multimedia.</nl-NL>
  <pl-PL>Bezp_atne oprogramowanie serwerowe do strumieniowych transmisji danych multimedialnych.</pl-PL>
  <pt-BR>Um software de servidor gratuito para fazer transmissão multimídia.</pt-BR>
  <ru-RU>Бесплатное серверное программное обеспечение для потокового воспроизведения мультимедиа.</ru-RU>
  <sv-SE>En gratis serverprogramvara för strömning av multimedia.</sv-SE>
  <tr-TR>Multimedya akı_ına yönelik ücretsiz bir yazılım.</tr-TR>

Update Apps

If the installed app has a new update available from the server, the system will automatically prompt the user that an update is available to download. The user can then click on the notice to check for apps with available updates.


Apkg wil remove the old app, then install the new app.

The "" script will back up the app's configuration, then "" will recover the configuration.

Re-install flow: -> -> -> -> ->




cp -R $path_des/iceconf /mnt/HD/HD_a2/.systemfile/




echo "Addon Icecast ( installing ..."
mv $path_src $path_des

if [ -d /mnt/HD/HD_a2/.systemfile/iceconf ]; then
        echo "Addon Icecast ( restore configs ..."
        cp -R /mnt/HD/HD_a2/.systemfile/iceconf "${path_des}/Icecast/"
        rm -rf /mnt/HD/HD_a2/.systemfile/iceconf
echo "Addon Icecast ( Done ..."

Support Project

Usage: mksapkg -E -s -m [module_name]
Module name Project name
WDMyCloudEX2 KingsCanyon
WDMyCloud Glacier
WDMyCloudEX4100 YellowStone
WDMyCloudDL4100 Sprite
WDMyCloudEX2100 Yosemite
WDMyCloudDL2100 Aurora
WDMyCloudMirror Zion
WDMyCloudMirrorGen2 GrandTeton
MyCloudEX2Ultra RangerPeak
MyCloudPR4100 BlackCanyon
MyCloudPR2100 BryceCanyon


Click here to visit the My Cloud OS3 NAS Downloads page  **

** Requires a free Developer Portal account - click here to register

Do more with the
My Cloud OS3 NAS SDK

Click the buttons below to visit the My Cloud OS3 NAS Developer Home & Workflow pages



Get started, access the SDK, build your apps, & learn more

View Home


Register & submit your app for review and contact support

View Workflow