diff --git a/apps/desktop/layer/main/src/updater/configs.ts b/apps/desktop/layer/main/src/updater/configs.ts index 9432099d3..b55ea71bc 100644 --- a/apps/desktop/layer/main/src/updater/configs.ts +++ b/apps/desktop/layer/main/src/updater/configs.ts @@ -1,4 +1,4 @@ -import { DEV, MODE, ModeEnum } from "@follow/shared/constants" +import { DEV, MICROSOFT_STORE_BUILD, MODE, ModeEnum } from "@follow/shared/constants" import path from "pathe" import { isWindows } from "../env" @@ -8,7 +8,7 @@ export const appUpdaterConfig = { enableRenderHotUpdate: !DEV && MODE !== ModeEnum.staging, enableCoreUpdate: !process.mas && - !process.windowsStore && + !MICROSOFT_STORE_BUILD && // Disable core update if platfrom is windows and application is't executing from default installion path. // If the process is not executed from the default installation path, // it is usually managed through a package manager like Scoop. diff --git a/packages/internal/shared/src/constants.ts b/packages/internal/shared/src/constants.ts index b2c0768df..2a9325916 100644 --- a/packages/internal/shared/src/constants.ts +++ b/packages/internal/shared/src/constants.ts @@ -37,3 +37,9 @@ declare const ELECTRON: boolean */ export const ELECTRON_BUILD = !!ELECTRON export const WEB_BUILD = !ELECTRON + +export const MICROSOFT_STORE_BUILD = + typeof process !== "undefined" + ? process.platform === "win32" && + (process.windowsStore || process.execPath.startsWith("C:\\Program Files\\WindowsApps")) + : false diff --git a/packages/internal/utils/src/headers.ts b/packages/internal/utils/src/headers.ts index 8e86a4a7b..e786fc650 100644 --- a/packages/internal/utils/src/headers.ts +++ b/packages/internal/utils/src/headers.ts @@ -1,4 +1,4 @@ -import { DEV, WEB_BUILD } from "@follow/shared/constants" +import { DEV, MICROSOFT_STORE_BUILD, WEB_BUILD } from "@follow/shared/constants" import { imageRefererMatches } from "./img-proxy" @@ -81,7 +81,7 @@ export const createDesktopAPIHeaders = ({ version }: { version: string }) => { break } case "win32": { - if (process.windowsStore) { + if (MICROSOFT_STORE_BUILD) { platform = DesktopPlatform.DesktopWindowsMS } else { platform = DesktopPlatform.DesktopWindowsEXE