# How to install app with Legato update API?

**URL:** <https://mangoh.discourse.group/t/how-to-install-app-with-legato-update-api/2267>\
**Category:** Uncategorized\
**Created:** [December 25, 2018, 11:09am UTC](https://mangoh.discourse.group/t/how-to-install-app-with-legato-update-api/2267 "2018-12-25T11:09:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MilanVidic](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MilanVidic](https://mangoh.discourse.group/u/MilanVidic)\
**Post date:** [December 25, 2018, 11:09am UTC](https://mangoh.discourse.group/t/how-to-install-app-with-legato-update-api/2267/1 "2018-12-25T11:09:41Z")

</div>

Hello I am trying to install helloworld app on my wp76 module with Legato update API but with no luck. This is my sample code :

```
COMPONENT_INIT
{
    const char* filename = "/mnt/flash/updateFiles/HelloWorld.wp76xx.update";
    int fd = open(filename, O_RDONLY);

    if (fd == -1)
    {
    	LE_INFO("Can't open file");
    }

    le_result_t result = le_update_Start(fd);

    if (result != LE_OK)
    {
    	LE_INFO("FAIL");
        exit(EXIT_FAILURE);
    }
}

```

When I run this code I get this output:

> ```
> Dec 24 17:21:55 | avcControl[2068]/framework T=main | LE_FILENAME unixSocket_SendMsg() 441 | Sending fd 9.
> Dec 24 17:21:55 | updateDaemon[803]/updateDaemon T=main | updateDaemon.c le_update_Start() 2026 | Update request accepted.
> Dec 24 17:21:55 | updateDaemon[2069]/framework T=main | LE_FILENAME user_Create() 1370 | Created user 'SecurityUnpack' with uid 1002 and gid 1002.
> Dec 24 17:21:55 | updateDaemon[803]/updateDaemon T=main | updateUnpack.c JsonErrorHandler() 321 | Error reading update pack (Read error flags set: POLLHUP (at line 1))
> Dec 24 17:21:55 | updateDaemon[803]/updateDaemon T=main | updateDaemon.c UpdateFailed() 419 | Update failed!!
> 
> ```

I get the same error when I SSH to the board and execute:

> update /mnt/flash/updateFiles/HelloWorld.wp76xx.update

Any help is appreciated.  
Thank you

---

<div class="post-metadata">

**Author:** ![MilanVidic](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MilanVidic](https://mangoh.discourse.group/u/MilanVidic)\
**Post date:** [December 25, 2018, 12:45pm UTC](https://mangoh.discourse.group/t/how-to-install-app-with-legato-update-api/2267/2 "2018-12-25T12:45:49Z")

</div>

Update file was not good. Solution was to build update file with mkapp in console and not in Developer Studio
