Skip to content

Self-Updater Detection

Electron App Detection

AppPorts identifies Electron apps through the following three detection conditions (checked in order of priority, short-circuit evaluation):

#Detection ItemPath / Pattern
1Electron FrameworkContents/Frameworks/Electron Framework.framework directory exists
2Electron Helper variantsEntries containing Electron Helper in name exist under Contents/Frameworks/
3Info.plist identifier keysElectronDefaultApp or electron key exists in Contents/Info.plist

Electron Self-Update Detection

Additionally checks for the existence of Contents/Resources/app-update.yml file (configuration file for electron-updater). If present, the Electron app is marked as having self-update capability.

Sparkle App Detection

AppPorts identifies Sparkle apps through the following three detection conditions:

#Detection ItemPath / Pattern
1Sparkle frameworkContents/Frameworks/Sparkle.framework or Contents/Frameworks/Squirrel.framework exists
2Updater binary filesFiles matching shipit, autoupdate, updater, update exist under Contents/MacOS/ or Contents/Frameworks/
3Info.plist Sparkle keysAny of the following keys exist in Contents/Info.plist: SUFeedURL, SUPublicDSAKeyFile, SUPublicEDKey, SUScheduledCheckInterval, SUAllowsAutomaticUpdates

⚠️ Special Handling for Electron Apps

When an app has been identified as an Electron app, detection condition #2 (updater binary files) is skipped to avoid false positives from electron-updater's updater binary being detected as Sparkle.

Hybrid Electron + Sparkle Apps

Some apps contain both Electron framework and Sparkle updater. AppPorts detects both flags independently, allowing isElectron and isSparkle to both be true.

Detection Logic

text
isElectron = satisfies any of the three Electron detection conditions
isSparkle  = satisfies any of the three Sparkle detection conditions (Electron apps skip condition #2)

The two flags are independent and can both be true simultaneously.

Post-Migration Behavior

AttributeDetermination Condition
hasSelfUpdaterisSparkle or (isElectron and app-update.yml exists) or custom updater exists
needsLockisSparkle or (isElectron and app-update.yml exists)

When needsLock is true, AppPorts executes chflags -R uchg (setting immutable flag) on the external storage app after migration completes, preventing self-updaters from deleting or modifying the external copy.

Custom Updater Detection

For native self-updating apps that are neither Sparkle nor Electron (e.g., Chrome, Edge, Parallels), AppPorts identifies them through the following patterns:

Detection PathMatching PatternTypical Apps
Contents/Library/LaunchServices/Filename contains updateChrome, Edge, Thunderbird
Contents/MacOS/Binary filename contains update or upgrade (excluding electron)Parallels, Thunderbird
Contents/SharedSupport/Filename contains updateWPS Office
Contents/Info.plistKSProductID key existsGoogle Keystone (Chrome)

Legacy Strategy Identification

When restoring or unlinking, AppPorts needs to identify legacy entries created by older versions:

Local Structure CharacteristicIdentified As
Root path is a symbolic linkwholeAppSymlink
Contents/ is a symbolic linkdeepContentsWrapper
Contents/Info.plist is a symbolic linkwholeAppSymlink (legacy Sparkle hybrid scheme)
Contents/Frameworks/ is a symbolic linkwholeAppSymlink (legacy Electron hybrid scheme)
Contents/MacOS/launcher existsstubPortal
None of the above matchNot managed by AppPorts
最近更新