update core: signed release.json (Ed25519) per channel, ETag check, resumable download with sha256, Auto/Ask/Off policy, appliers for the install.sh layout, AppImage, NSIS installer (keeps the replaced setup.exe for Restore) and .app, trial run with rollback.
Editor and launcher: banner, status bar, Help commands, Task Center download, install on restart.
CLI: aego update, aego release keygen|manifest, aego export --release-json.
Games: modules/update with update { url publicKey }, settings and the aego/update script API.
release.sh refuses to publish without AEGO_RELEASE_KEY and AEGO_UPDATE_KEY; install.sh lays out versions; make test-update runs a real v1 -> v2 update.
44 lines
1.2 KiB
Markdown
44 lines
1.2 KiB
Markdown
---
|
|
id: aego/update
|
|
summary: Finds a newer version of the game on its update server, downloads it and restarts the game on it.
|
|
---
|
|
|
|
A game updates itself when `project.aego` names its update server and the key that signs its releases:
|
|
|
|
```
|
|
update {
|
|
url="https://example.com/mygame/updates"
|
|
publicKey="<the public key from aego release keygen>"
|
|
}
|
|
```
|
|
|
|
The server holds one folder per channel, `stable/release.json` and `nightly/release.json`, each with its `release.json.sig`. `aego export --release-json` writes both next to the exported archive. The game checks at start; in the Auto mode it downloads the new version in the background, and the Settings View gets **Updates** and **Update channel**. Nothing installs without a valid signature and checksum. The sandbox has no update server, so this example needs a project.
|
|
|
|
## Example
|
|
|
|
```aes check
|
|
package demo
|
|
|
|
import (
|
|
"aego/log"
|
|
"aego/update"
|
|
)
|
|
|
|
script UpdateBanner {
|
|
var shown bool
|
|
|
|
func Update(dt float) {
|
|
if !shown && update.State() == "ready" {
|
|
shown = true
|
|
log.Info("version " + update.Version() + " is ready: " + update.Notes())
|
|
}
|
|
}
|
|
|
|
func Restart() {
|
|
if update.State() == "ready" {
|
|
update.Apply()
|
|
}
|
|
}
|
|
}
|
|
```
|