Skip to content

Commit 0764ebe

Browse files
committed
fix(mas): ASC 2.2+2.4.5 — clean numeric version in Help menu (package_info), update checks removed from menu/registry/palette in app-store builds; MAS 2.1.17
1 parent c6eec14 commit 0764ebe

3 files changed

Lines changed: 34 additions & 4 deletions

File tree

‎src-tauri/mas.conf.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "Mark",
4-
"version": "2.1.16",
4+
"version": "2.1.17",
55
"app": {
66
"security": {
77
"capabilities": ["mas"]

‎src-tauri/src/m009_menu.rs‎

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ pub fn standard_menu() -> Vec<MenuItem> {
583583
accelerator: None,
584584
items: None,
585585
},
586+
#[cfg(not(feature = "app-store"))]
586587
MenuItem {
587588
id: "file.check-update".to_string(),
588589
label: "Check for Updates…".to_string(),
@@ -882,15 +883,42 @@ pub fn build_native_menu<R: tauri::Runtime>(
882883
)
883884
.build()?;
884885

886+
// ASC 2.4.5(vii): App Store builds hide the update item entirely.
887+
#[cfg(feature = "app-store")]
888+
fn cfg_helper_check_update<R: tauri::Runtime>(
889+
handle: &tauri::AppHandle<R>,
890+
) -> tauri::Result<tauri::menu::MenuItem<R>> {
891+
MenuItemBuilder::with_id("help.update-hidden", "").build(handle)
892+
}
893+
#[cfg(not(feature = "app-store"))]
894+
fn cfg_helper_check_update<R: tauri::Runtime>(
895+
handle: &tauri::AppHandle<R>,
896+
) -> tauri::Result<tauri::menu::MenuItem<R>> {
897+
MenuItemBuilder::with_id("file.check-update", "Check for Updates…").build(handle)
898+
}
899+
885900
// ── Help menu ────────────────────────────────────────────────────
886-
let version_label = format!("Version {}", env!("CARGO_PKG_VERSION"));
901+
// ASC 2.2: the App Store build must not surface "-beta" — take the
902+
// version from the tauri package info (mas.conf overlay carries the
903+
// clean numeric version); desktop keeps the full Cargo string.
904+
let version_label = {
905+
#[cfg(feature = "app-store")]
906+
{
907+
format!("Version {}", handle.package_info().version)
908+
}
909+
#[cfg(not(feature = "app-store"))]
910+
{
911+
format!("Version {}", env!("CARGO_PKG_VERSION"))
912+
}
913+
};
887914
let help_submenu = SubmenuBuilder::new(handle, "Help")
888915
.text("help.version", &version_label)
889916
.separator()
890917
.item(&MenuItemBuilder::with_id("docs.user-guide", "Documentation").build(handle)?)
918+
// ASC 2.4.5(vii): no update checks in the App Store build —
919+
// the store owns updates. Desktop keeps the in-app updater.
891920
.item(
892-
&MenuItemBuilder::with_id("file.check-update", "Check for Updates…")
893-
.build(handle)?,
921+
&cfg_helper_check_update(handle)?,
894922
)
895923
.build()?;
896924

‎src/renderer/src/commands/index.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export function applyCapabilityGate(caps) {
8383
const denied = []
8484
if (caps && caps.screenshot === false) denied.push('edit.screenshot')
8585
if (caps && caps.setDefaultHandler === false) denied.push('file.default-handler')
86+
// ASC 2.4.5(vii): store builds must not offer update checks anywhere.
87+
if (caps && caps.updater === false) denied.push('file.check-update')
8688
if (!denied.length) return
8789
const drop = (list) => {
8890
for (let i = list.length - 1; i >= 0; i--) {

0 commit comments

Comments
 (0)