mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
Fix frontend download links pointing to split Mac binaries (#6325)
This commit is contained in:
@@ -35,13 +35,8 @@ export function useOnboardingDownload(): UseOnboardingDownloadResult {
|
||||
switch (osType) {
|
||||
case "windows":
|
||||
return { label: "Windows", url: DOWNLOAD_URLS.WINDOWS };
|
||||
case "mac-apple":
|
||||
return {
|
||||
label: "Mac (Apple Silicon)",
|
||||
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
|
||||
};
|
||||
case "mac-intel":
|
||||
return { label: "Mac (Intel)", url: DOWNLOAD_URLS.MAC_INTEL };
|
||||
case "mac":
|
||||
return { label: "Mac", url: DOWNLOAD_URLS.MAC };
|
||||
case "linux-x64":
|
||||
case "linux-arm64":
|
||||
return { label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS };
|
||||
@@ -54,16 +49,7 @@ export function useOnboardingDownload(): UseOnboardingDownloadResult {
|
||||
() =>
|
||||
[
|
||||
{ label: "Windows", url: DOWNLOAD_URLS.WINDOWS, value: "windows" },
|
||||
{
|
||||
label: "Mac (Apple Silicon)",
|
||||
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
|
||||
value: "mac-apple",
|
||||
},
|
||||
{
|
||||
label: "Mac (Intel)",
|
||||
url: DOWNLOAD_URLS.MAC_INTEL,
|
||||
value: "mac-intel",
|
||||
},
|
||||
{ label: "Mac", url: DOWNLOAD_URLS.MAC, value: "mac" },
|
||||
{ label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS, value: "linux" },
|
||||
].filter((opt) => opt.url),
|
||||
[],
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Centralized download URLs for Stirling PDF desktop installers
|
||||
export const DOWNLOAD_URLS = {
|
||||
WINDOWS: "https://files.stirlingpdf.com/win-installer.exe",
|
||||
MAC_APPLE_SILICON: "https://files.stirlingpdf.com/mac-installer.dmg",
|
||||
MAC_INTEL: "https://files.stirlingpdf.com/mac-x86_64-installer.dmg",
|
||||
MAC: "https://files.stirlingpdf.com/mac-installer.dmg",
|
||||
LINUX_DOCS: "https://docs.stirlingpdf.com/Installation/Unix%20Installation/",
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@ import { useEffect, useState } from "react";
|
||||
|
||||
export type OS =
|
||||
| "windows"
|
||||
| "mac-intel"
|
||||
| "mac-apple"
|
||||
| "mac"
|
||||
| "linux-x64"
|
||||
| "linux-arm64"
|
||||
| "ios"
|
||||
@@ -23,15 +22,7 @@ function parseUA(ua: string): OS {
|
||||
|
||||
if (/android/.test(uaLower)) return "android";
|
||||
if (/windows nt/.test(uaLower)) return "windows";
|
||||
if (/mac os x/.test(uaLower)) {
|
||||
// Default to Intel; refine via hints below
|
||||
let detected: OS = "mac-intel";
|
||||
// Safari on Apple Silicon sometimes exposes both tokens
|
||||
if (ua.includes("Apple") && ua.includes("ARM")) {
|
||||
detected = "mac-apple";
|
||||
}
|
||||
return detected; // will be further refined via Client Hints if available
|
||||
}
|
||||
if (/mac os x/.test(uaLower)) return "mac";
|
||||
if (/linux|x11/.test(uaLower)) return "linux-x64";
|
||||
|
||||
return "unknown";
|
||||
@@ -64,10 +55,7 @@ export function useOs(): OS {
|
||||
else if (plat.includes("ios")) detected = "ios";
|
||||
else if (plat.includes("android")) detected = "android";
|
||||
else if (plat.includes("mac")) {
|
||||
// CH “architecture” is often "arm" on Apple Silicon
|
||||
detected = architecture?.toLowerCase().includes("arm")
|
||||
? "mac-apple"
|
||||
: "mac-intel";
|
||||
detected = "mac";
|
||||
} else if (plat.includes("linux") || plat.includes("chrome os")) {
|
||||
const archLower = (architecture || "").toLowerCase();
|
||||
const isArm =
|
||||
@@ -78,9 +66,6 @@ export function useOs(): OS {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
} else {
|
||||
// Heuristic Apple Silicon from UA when no Client Hints (Safari): uncertain, prefer not to guess
|
||||
// Keep detected as-is (often 'mac-intel').
|
||||
}
|
||||
|
||||
if (!cancelled) setOs(detected);
|
||||
|
||||
@@ -46,13 +46,8 @@ export function useSaasOnboardingState({
|
||||
switch (osType) {
|
||||
case "windows":
|
||||
return { label: "Windows", url: DOWNLOAD_URLS.WINDOWS };
|
||||
case "mac-apple":
|
||||
return {
|
||||
label: "Mac (Apple Silicon)",
|
||||
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
|
||||
};
|
||||
case "mac-intel":
|
||||
return { label: "Mac (Intel)", url: DOWNLOAD_URLS.MAC_INTEL };
|
||||
case "mac":
|
||||
return { label: "Mac", url: DOWNLOAD_URLS.MAC };
|
||||
case "linux-x64":
|
||||
case "linux-arm64":
|
||||
return { label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS };
|
||||
@@ -64,16 +59,7 @@ export function useSaasOnboardingState({
|
||||
const osOptions = useMemo(() => {
|
||||
const options = [
|
||||
{ label: "Windows", url: DOWNLOAD_URLS.WINDOWS, value: "windows" },
|
||||
{
|
||||
label: "Mac (Apple Silicon)",
|
||||
url: DOWNLOAD_URLS.MAC_APPLE_SILICON,
|
||||
value: "mac-apple",
|
||||
},
|
||||
{
|
||||
label: "Mac (Intel)",
|
||||
url: DOWNLOAD_URLS.MAC_INTEL,
|
||||
value: "mac-intel",
|
||||
},
|
||||
{ label: "Mac", url: DOWNLOAD_URLS.MAC, value: "mac" },
|
||||
{ label: "Linux", url: DOWNLOAD_URLS.LINUX_DOCS, value: "linux" },
|
||||
];
|
||||
return options.filter((opt) => opt.url);
|
||||
|
||||
Reference in New Issue
Block a user