parent
896678a508
commit
8cb79a350f
File diff suppressed because it is too large
Load Diff
@ -1,41 +1,41 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"plugins/*",
|
"plugins/*",
|
||||||
"plugins/*/tests/*",
|
"plugins/*/tests/*",
|
||||||
"plugins/updater/tests/updater-migration/v2-app",
|
"plugins/updater/tests/updater-migration/v2-app",
|
||||||
"plugins/*/examples/*/src-tauri",
|
"plugins/*/examples/*/src-tauri",
|
||||||
"examples/*/src-tauri",
|
"examples/*/src-tauri",
|
||||||
]
|
]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
tauri = { version = "2", default-features = false }
|
tauri = { path = "../tauri/crates/tauri", default-features = false }
|
||||||
tauri-build = "2"
|
tauri-build = "2"
|
||||||
tauri-plugin = "2"
|
tauri-plugin = "2"
|
||||||
tauri-utils = "2"
|
tauri-utils = "2"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
thiserror = "2"
|
thiserror = "2"
|
||||||
url = "2"
|
url = "2"
|
||||||
schemars = "0.8"
|
schemars = "0.8"
|
||||||
dunce = "1"
|
dunce = "1"
|
||||||
specta = "^2.0.0-rc.16"
|
specta = "^2.0.0-rc.16"
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
zbus = "5"
|
zbus = "5"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Tauri Programme within The Commons Conservancy"]
|
authors = ["Tauri Programme within The Commons Conservancy"]
|
||||||
license = "Apache-2.0 OR MIT"
|
license = "Apache-2.0 OR MIT"
|
||||||
rust-version = "1.77.2"
|
rust-version = "1.77.2"
|
||||||
repository = "https://github.com/tauri-apps/plugins-workspace"
|
repository = "https://github.com/tauri-apps/plugins-workspace"
|
||||||
|
|
||||||
# default to small, optimized release binaries
|
# default to small, optimized release binaries
|
||||||
[profile.release]
|
[profile.release]
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
lto = true
|
lto = true
|
||||||
incremental = false
|
incremental = false
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,56 +1,57 @@
|
|||||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
use tauri_plugin_updater::UpdaterExt;
|
use tauri_plugin_updater::UpdaterExt;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[allow(unused_mut)]
|
#[allow(unused_mut)]
|
||||||
let mut context = tauri::generate_context!();
|
let mut context = tauri::generate_context!();
|
||||||
tauri::Builder::default()
|
println!("{}", tauri::__TAURI_BUNDLE_TYPE);
|
||||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
tauri::Builder::default()
|
||||||
.setup(|app| {
|
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||||
let handle = app.handle().clone();
|
.setup(|app| {
|
||||||
tauri::async_runtime::spawn(async move {
|
let handle = app.handle().clone();
|
||||||
let mut builder = handle.updater_builder();
|
tauri::async_runtime::spawn(async move {
|
||||||
if std::env::var("TARGET").unwrap_or_default() == "nsis" {
|
let mut builder = handle.updater_builder();
|
||||||
// /D sets the default installation directory ($INSTDIR),
|
if std::env::var("TARGET").unwrap_or_default() == "nsis" {
|
||||||
// overriding InstallDir and InstallDirRegKey.
|
// /D sets the default installation directory ($INSTDIR),
|
||||||
// It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
|
// overriding InstallDir and InstallDirRegKey.
|
||||||
// Only absolute paths are supported.
|
// It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
|
||||||
// NOTE: we only need this because this is an integration test and we don't want to install the app in the programs folder
|
// Only absolute paths are supported.
|
||||||
builder = builder.installer_args(vec![format!(
|
// NOTE: we only need this because this is an integration test and we don't want to install the app in the programs folder
|
||||||
"/D={}",
|
builder = builder.installer_args(vec![format!(
|
||||||
tauri::utils::platform::current_exe()
|
"/D={}",
|
||||||
.unwrap()
|
tauri::utils::platform::current_exe()
|
||||||
.parent()
|
.unwrap()
|
||||||
.unwrap()
|
.parent()
|
||||||
.display()
|
.unwrap()
|
||||||
)]);
|
.display()
|
||||||
}
|
)]);
|
||||||
let updater = builder.build().unwrap();
|
}
|
||||||
|
let updater = builder.build().unwrap();
|
||||||
match updater.check().await {
|
|
||||||
Ok(Some(update)) => {
|
match updater.check().await {
|
||||||
if let Err(e) = update.download_and_install(|_, _| {}, || {}).await {
|
Ok(Some(update)) => {
|
||||||
println!("{e}");
|
if let Err(e) = update.download_and_install(|_, _| {}, || {}).await {
|
||||||
std::process::exit(1);
|
println!("{e}");
|
||||||
}
|
std::process::exit(1);
|
||||||
std::process::exit(0);
|
}
|
||||||
}
|
std::process::exit(0);
|
||||||
Ok(None) => {
|
}
|
||||||
std::process::exit(2);
|
Ok(None) => {
|
||||||
}
|
std::process::exit(2);
|
||||||
Err(e) => {
|
}
|
||||||
println!("{e}");
|
Err(e) => {
|
||||||
std::process::exit(1);
|
println!("{e}");
|
||||||
}
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
Ok(())
|
});
|
||||||
})
|
Ok(())
|
||||||
.run(context)
|
})
|
||||||
.expect("error while running tauri application");
|
.run(context)
|
||||||
}
|
.expect("error while running tauri application");
|
||||||
|
}
|
||||||
|
Loading…
Reference in new issue