docs: update README.md and remove allowlist information (#381)

This commit is contained in:
Lucas Fernandes Nogueira
2023-05-20 20:28:27 -03:00
committed by GitHub
parent d677f73495
commit f4069f5588
43 changed files with 386 additions and 282 deletions
+26 -4
View File
@@ -1,7 +1,9 @@
# Updater plugin
# Updater
In-app updates for Tauri applications.
- Supported platforms: Windows, Linux and macOS.
## Install
_This plugin requires a Rust version of at least **1.65**_
@@ -17,7 +19,10 @@ Install the Core plugin by adding the following to your `Cargo.toml` file:
`src-tauri/Cargo.toml`
```toml
[dependencies]
# you can add the dependencies on the `[dependencies]` section if you do not target mobile
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-updater = "2.0.0-alpha"
# alternatively with Git:
tauri-plugin-updater = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
```
@@ -26,6 +31,13 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh
pnpm add @tauri-apps/plugin-updater
# or
npm add @tauri-apps/plugin-updater
# or
yarn add @tauri-apps/plugin-updater
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-updater#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-updater#v2
@@ -42,7 +54,11 @@ First you need to register the core plugin with Tauri:
```rust
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_updater::Builder::new().build())
.setup(|app| {
#[cfg(desktop)]
app.handle().plugin(tauri_plugin_updater::Builder::new().build())?;
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
@@ -51,7 +67,13 @@ fn main() {
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
```javascript
import * as updater from "@tauri-apps/plugin-updater";
import { check } from "@tauri-apps/plugin-updater";
import { relaunch } from "@tauri-apps/plugin-process";
const update = await check();
if (update.response.available) {
await update.downloadAndInstall();
await relaunch();
}
```
## Contributing