Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/oversized.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1860 app/src-tauri/src/lib.rs
1817 crates/linkunbound-shell/src/main.rs
1848 app/src-tauri/src/lib.rs
1810 crates/linkunbound-shell/src/main.rs
8 changes: 6 additions & 2 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ download says whether the machine is Apple Silicon or Intel — as a download
made by hand from the releases page would.

A copy installed from the Microsoft Store takes its update from the Store
instead, and never reads the feed above. A copy installed with Homebrew updates
instead. To name the version on its way, it reads the Store's public listing of
LinkUnbound at `displaycatalog.mp.microsoft.com`, asked with a fixed market and
language so the request says nothing about you. Only when that listing cannot
be read does it read the feed above. Nothing is installed from either: only the
Store installs it. A copy installed with Homebrew updates
itself the same way as a downloaded one; `brew upgrade` works as well. A copy
installed with winget came from the same releases page and updates itself the
same way too.
Expand All @@ -227,7 +231,7 @@ same way too.
LinkUnbound is available through the Microsoft Store. The Store version:

- **Follows the same privacy principles** as the standalone version.
- **Asks the Store about updates**, not the feed above: a release reaches the Store when its certification lets it through, which is not when it reaches everyone else.
- **Asks the Store about updates**, and reads the Store's public listing of LinkUnbound to name the version on its way: a release reaches the Store when its certification lets it through, which is not when it reaches everyone else. The feed above only stands in when that listing cannot be read.
- **Uses MSIX packaging** — installs and uninstalls cleanly with standard Windows mechanisms.
- **Microsoft Store policies** apply to distribution, but LinkUnbound itself does not share any data with Microsoft beyond what the Store platform requires for installation and updates.

Expand Down
1 change: 1 addition & 0 deletions app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ linkunbound-win.workspace = true
windows-future = "0.3"
windows = { version = "0.62", features = [
"ApplicationModel",
"Management_Deployment",
"Services_Store",
"Win32_Foundation",
"Win32_System_Com",
Expand Down
4 changes: 3 additions & 1 deletion app/src-tauri/src/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use serde::Serialize;

use linkunbound_core::Language;

use crate::{HERE, catalogue, same_name, shown_origin, store, system, update};
use crate::{HERE, catalogue, same_name, shop, shown_origin, store, system, update};

const NOTICES: &str = include_str!("../../../THIRD-PARTY-BUNDLED.md");
const LICENCES: &str = include_str!("../../../THIRD-PARTY-LICENSES.md");
Expand All @@ -16,6 +16,7 @@ pub struct Build {
candidates: bool,
candidates_apply: bool,
kept_by_the_store: bool,
not_sold: bool,
}

#[tauri::command]
Expand All @@ -29,6 +30,7 @@ pub fn about() -> Build {
candidates: update::tracking(HERE, kept.candidates),
candidates_apply: !store_copy,
kept_by_the_store: store_copy,
not_sold: store_copy && !shop::sold(),
}
}

Expand Down
52 changes: 20 additions & 32 deletions app/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,41 +575,28 @@ const fn owner(_app: &AppHandle) -> Option<isize> {
#[tauri::command]
async fn update_ready(
app: AppHandle,
now_please: Option<bool>,
pressed: Option<bool>,
) -> Result<Option<update::Ready>, String> {
let dir = store().dir().to_path_buf();
let kept = update::route();
let mut looked = update::looked(&dir);
let now = update::now();
let asked = now_please.unwrap_or(false);
let asked = pressed.unwrap_or(false);

// A copy the Store keeps asks the Store, not the manifest: a release is out for everyone else
// while certification still has it. Silence falls through, though — the Store answers for
// nothing in a package it did not sell.
if kept.route == update::Route::Store
&& let Some(window) = owner(&app)
{
// Held to the manifest's interval too: a Store that never answers strands the thread.
if !asked && !update::due(looked.checked_at, now) {
return Ok(looked
.found_version
.as_deref()
.and_then(|version| update::from_the_shop(version, HERE)));
}
if let Ok(shelf) = tauri::async_runtime::spawn_blocking(move || shop::asked(window)).await
&& shelf != shop::Shelf::Silent
{
let seen = match shelf {
shop::Shelf::Waiting(version) => update::from_the_shop(&version, HERE),
_ => None,
};
looked.checked_at = Some(now);
looked.found_version = seen.as_ref().map(|one| one.version.clone());
looked.found_route = seen.as_ref().map(|one| one.route.name().to_owned());
looked.found_installs = seen.as_ref().map(|one| one.installs);
update::keep(&dir, &looked);
return Ok(seen);
}
// A release is out for everyone else while certification still has it from the Store.
if kept.route == update::Route::Store {
let was = shop::Memory::of(&looked);
let window = owner(&app).filter(|_| asked || update::shop_due(looked.checked_at, now));
let Some(window) = window else {
return Ok(shop::last_said(HERE, &was));
};
let verdict = tauri::async_runtime::spawn_blocking(move || shop::look(window, asked, was))
.await
.map_err(|why| why.to_string())?;
let told = verdict.settled_into(&mut looked, asked);
looked.checked_at = Some(now);
update::keep(&dir, &looked);
return told.map_err(str::to_owned);
}

if !asked && !update::due(looked.checked_at, now) {
Expand Down Expand Up @@ -890,8 +877,9 @@ fn relaunch_resident() {
};
let resident = linkunbound_core::link_handler(&here);
let _ = linkunbound_mac::retire(linkunbound_core::RESIDENT);
let _ =
linkunbound_core::spawn_and_forget(std::process::Command::new(resident).arg("--hushed"));
let _ = linkunbound_core::spawn_and_forget(
std::process::Command::new(resident).arg(linkunbound_core::HUSHED),
);
}

async fn moved_on(dir: &std::path::Path, kept: update::Kept, wants: Option<bool>) -> String {
Expand Down Expand Up @@ -996,7 +984,7 @@ fn run_errand(app: AppHandle, errand: Errand) {
// asked here, with no window, the manifest would answer for a package it did not sell.
Errand::Look if update::route().route == update::Route::Store => {}
Errand::Look => {
let _ = update_ready(app.clone(), Some(false)).await;
let _ = update_ready(app.clone(), None).await;
}
Errand::Update => {
let _ = install(app.clone(), false).await;
Expand Down
Loading
Loading