fix(release): disable updater for app store distribution

This commit is contained in:
h3p 2026-04-17 10:49:50 +02:00
parent 6f00a27504
commit 23a9114cfc
No known key found for this signature in database
3 changed files with 38 additions and 11 deletions

View file

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 90; objectVersion = 100;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -155,7 +155,7 @@
minimizedProjectReferenceProxies = 1; minimizedProjectReferenceProxies = 1;
packageReferences = ( packageReferences = (
); );
preferredProjectObjectVersion = 90; preferredProjectObjectVersion = 100;
productRefGroup = 98EAE6342E5F15E80050E579 /* Products */; productRefGroup = 98EAE6342E5F15E80050E579 /* Products */;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
@ -362,7 +362,7 @@
CODE_SIGNING_ALLOWED = YES; CODE_SIGNING_ALLOWED = YES;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 598; CURRENT_PROJECT_VERSION = 599;
DEAD_CODE_STRIPPING = YES; DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = CS727NF72U; DEVELOPMENT_TEAM = CS727NF72U;
ENABLE_APP_SANDBOX = YES; ENABLE_APP_SANDBOX = YES;
@ -445,7 +445,7 @@
CODE_SIGNING_ALLOWED = YES; CODE_SIGNING_ALLOWED = YES;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 598; CURRENT_PROJECT_VERSION = 599;
DEAD_CODE_STRIPPING = YES; DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = CS727NF72U; DEVELOPMENT_TEAM = CS727NF72U;
ENABLE_APP_SANDBOX = YES; ENABLE_APP_SANDBOX = YES;

View file

@ -65,6 +65,13 @@
ReferencedContainer = "container:Neon Vision Editor.xcodeproj"> ReferencedContainer = "container:Neon Vision Editor.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions>
<AdditionalOption
key = "APP_DISTRIBUTOR_ID_OVERRIDE"
value = "com.apple.AppStore"
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
<StoreKitConfigurationFileReference <StoreKitConfigurationFileReference
identifier = "../../Neon Vision Editor/SupportOptional.storekit"> identifier = "../../Neon Vision Editor/SupportOptional.storekit">
</StoreKitConfigurationFileReference> </StoreKitConfigurationFileReference>

View file

@ -18,17 +18,37 @@ enum ReleaseRuntimePolicy {
#if os(macOS) #if os(macOS)
static var isMacAppStoreDistribution: Bool { static var isMacAppStoreDistribution: Bool {
// Treat both production and sandbox App Store receipts as App Store distribution. #if APP_STORE_BUILD
if let appStoreReceiptURL = Bundle.main.appStoreReceiptURL, return true
FileManager.default.fileExists(atPath: appStoreReceiptURL.path) { #else
if isForcedAppStoreDistributionForCurrentProcess {
return true return true
} }
let receiptDirectoryURL = Bundle.main.bundleURL
let legacyReceiptURL = Bundle.main.bundleURL
.appendingPathComponent("Contents", isDirectory: true) .appendingPathComponent("Contents", isDirectory: true)
.appendingPathComponent("_MASReceipt", isDirectory: true) .appendingPathComponent("_MASReceipt", isDirectory: true)
.appendingPathComponent("receipt", isDirectory: false) let fileManager = FileManager.default
return FileManager.default.fileExists(atPath: legacyReceiptURL.path) let receiptURL = receiptDirectoryURL.appendingPathComponent("receipt", isDirectory: false)
if fileManager.fileExists(atPath: receiptURL.path) {
return true
}
let sandboxReceiptURL = receiptDirectoryURL.appendingPathComponent("sandboxReceipt", isDirectory: false)
return fileManager.fileExists(atPath: sandboxReceiptURL.path)
#endif
}
private static var isForcedAppStoreDistributionForCurrentProcess: Bool {
let processInfo = ProcessInfo.processInfo
let environmentValue = processInfo.environment["APP_DISTRIBUTOR_ID_OVERRIDE"]
let argumentValue = processInfo.arguments
.first(where: { $0.hasPrefix("APP_DISTRIBUTOR_ID_OVERRIDE=") })?
.split(separator: "=", maxSplits: 1)
.last
.map(String.init)
let distributor = (environmentValue ?? argumentValue ?? "")
.trimmingCharacters(in: .whitespacesAndNewlines)
.lowercased()
return distributor == "com.apple.appstore"
} }
#endif #endif