mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-28 17:38:53 +02:00
fix(updater): check ShellExecuteW results (#3516)
* fix(updater): check `ShellExecuteW` results * document the exit on windows
This commit is contained in:
@@ -84,7 +84,7 @@ class Update extends Resource {
|
||||
this.rawJson = metadata.rawJson
|
||||
}
|
||||
|
||||
/** Download the updater package */
|
||||
/** Download the updater package. Call {@linkcode install} later to install it */
|
||||
async download(
|
||||
onEvent?: (progress: DownloadEvent) => void,
|
||||
options?: DownloadOptions
|
||||
@@ -102,7 +102,14 @@ class Update extends Resource {
|
||||
this.downloadedBytes = new Resource(downloadedBytesRid)
|
||||
}
|
||||
|
||||
/** Install downloaded updater package */
|
||||
/**
|
||||
* Install downloaded updater package. Must be called after {@linkcode download}.
|
||||
*
|
||||
* ## Platform-specific:
|
||||
*
|
||||
* - **Windows:** This function exits the app after launching the updater installer successfully
|
||||
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
||||
*/
|
||||
async install(options?: InstallOptions): Promise<void> {
|
||||
if (!this.downloadedBytes) {
|
||||
throw new Error('Update.install called before Update.download')
|
||||
@@ -118,7 +125,14 @@ class Update extends Resource {
|
||||
this.downloadedBytes = undefined
|
||||
}
|
||||
|
||||
/** Downloads the updater package and installs it */
|
||||
/**
|
||||
* Downloads the updater package and installs it
|
||||
*
|
||||
* ## Platform-specific:
|
||||
*
|
||||
* - **Windows:** This function exits the app after launching the updater installer successfully
|
||||
* - **macOS / Linux:** You need to relaunch the app to run the newly install version
|
||||
*/
|
||||
async downloadAndInstall(
|
||||
onEvent?: (progress: DownloadEvent) => void,
|
||||
options?: DownloadOptions & InstallOptions
|
||||
|
||||
Reference in New Issue
Block a user