Skip to content

Commit

Permalink
fix(macOS): Tauri V2 Update Permission Denied Error (#2067)
Browse files Browse the repository at this point in the history
* WIP

* Fixed linting

* WIP

* Fixed linting

* use osakit to show actual app name on dialog

* sync versions

* lint

---------

Co-authored-by: Lucas Nogueira <[email protected]>
  • Loading branch information
jLynx and lucasfernog authored Feb 2, 2025
1 parent a7497b0 commit 5369898
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 52 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-macos-user-install-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"updater": patch
"updater-js": patch
---

Fix update installation on macOS when using an user without admin privileges.
6 changes: 6 additions & 0 deletions .changes/updater-new-fn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"updater": minor
"updater-js": minor
---

Remove the `UpdaterBuilder::new` function, use `UpdaterExt::updater_builder` instead.
88 changes: 72 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugins/updater/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ flate2 = { version = "1", optional = true }
[target."cfg(target_os = \"macos\")".dependencies]
tar = "0.4"
flate2 = "1"
osakit = { version = "0.3", features = ["full"] }

[features]
default = ["rustls-tls", "zip"]
Expand Down
8 changes: 1 addition & 7 deletions plugins/updater/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,14 @@ pub trait UpdaterExt<R: Runtime> {
impl<R: Runtime, T: Manager<R>> UpdaterExt<R> for T {
fn updater_builder(&self) -> UpdaterBuilder {
let app = self.app_handle();
let package_info = app.package_info();
let UpdaterState {
config,
target,
version_comparator,
headers,
} = self.state::<UpdaterState>().inner();

let mut builder = UpdaterBuilder::new(
package_info.name.clone(),
package_info.version.clone(),
config.clone(),
)
.headers(headers.clone());
let mut builder = UpdaterBuilder::new(app, config.clone()).headers(headers.clone());

if let Some(target) = target {
builder = builder.target(target);
Expand Down
Loading

0 comments on commit 5369898

Please sign in to comment.