# Self-update application

**URL:** https://forum.legato.io/t/self-update-application/2433
**Category:** Legato Application Framework
**Created:** [May 4, 2017, 8:45am UTC](https://forum.legato.io/t/self-update-application/2433 "2017-05-04T08:45:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![unhit](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/unhit/32/130_2.png) [@unhit](https://forum.legato.io/u/unhit)
#### Post date: [May 4, 2017, 8:45am UTC](https://forum.legato.io/t/self-update-application/2433/1 "2017-05-04T08:45:37Z")

</div>

Can I use Software Update API to update application itself? This is the code I’m trying to use for testing purposes:  
``

```

try {
Path updPath = Paths.get(“/home/appfx30/fx30.upd”);
File pack = new File(updPath.toUri());
logger.log(Level.INFO, “Opening…”);
FileInputStream fis = new FileInputStream(pack);
update.AddProgressHandler(new Update.ProgressHandler() {
@Override
public void handle(Update.State updateState, int percentDone) {
switch (updateState) {
case STATE_APPLYING:
logger.log(Level.INFO, “Applying…” + percentDone);
break;
case STATE_FAILED:
logger.log(Level.INFO, “Failed…” + percentDone);
break;
case STATE_SUCCESS:
logger.log(Level.INFO, “Success…” + percentDone);
break;
case STATE_UNPACKING:
logger.log(Level.INFO, “Unpacking…” + percentDone);
break;
}
}
});
logger.log(Level.INFO, “Starting…”);
update.Start(fis.getFD());
logger.log(Level.INFO, "Started: " + update.GetErrorCode());
} catch (IOException e) {
logger.log(Level.INFO, "Error: " + e, e);
}

```

It hangs on update.Start().

```
# sdir list
...
WAITING CLIENTS

        [pid 7671] fx30.Update UNBOUND (protocol ID = 'aa0702b2ee62b2e6b86f1b71708b329e')
```

Part of cdef:

```
requires:
{
	api:
	{
		Update = le_update.api
	}
}
```

Part of adef:

```
bindings:
{
    fx30.App.Update -> .le_update
}
```

So two questions:

- why it is unbound?
- is it even possible to self-update?

Thanks.

---

<div class="post-metadata">

### Author: ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)
#### Post date: [May 15, 2017, 11:55pm UTC](https://forum.legato.io/t/self-update-application/2433/2 "2017-05-15T23:55:12Z")

</div>

Hi @unhit,

any chance you could provide the rest of the `sdir list | grep -i update` ?

I’m not sure it’s possible to self-update. It’s an edge case and I’m not sure if we ever tested this.

Regarding the binding issue, I wonder if the protocol `aa0702b2ee62b2e6b86f1b71708b329e` is provided by anybody.  
Can you eventually try with:

```auto
bindings
    fx30.Update -> <root>.le_update

```
