updater
@tauri-apps/api / updater
Module: updater
Customize the auto updater flow.
This package is also accessible with window.__TAURI__.updater
when tauri.conf.json > build > withGlobalTauri
is set to true.
Interfaces​
Type Aliases​
UpdateStatus​
Ƭ UpdateStatus: "PENDING"
| "ERROR"
| "DONE"
| "UPTODATE"
Defined in​
Functions​
checkUpdate​
â–¸ checkUpdate(): Promise
<UpdateResult
>
Checks if an update is available.
example
import { checkUpdate } from '@tauri-apps/api/updater';
const update = await checkUpdate();
// now run installUpdate() if needed
Returns​
Promise
<UpdateResult
>
Promise resolving to the update status.
Defined in​
installUpdate​
â–¸ installUpdate(): Promise
<void
>
Install the update if there's one available.
example
import { checkUpdate, installUpdate } from '@tauri-apps/api/updater';
const update = await checkUpdate();
if (update.shouldUpdate) {
console.log(`Installing update ${update.manifest?.version}, ${update.manifest?.date}, ${update.manifest.body}`);
await installUpdate();
}
Returns​
Promise
<void
>
A promise indicating the success or failure of the operation.