Localized Folder Created After Installing App with Same Name as Existing Application

I have two macOS applications: Application A, named My App.app with the bundle ID com.comp.myapp, and Application B, named My App.app with the bundle ID com.comp.myapp2. Both applications have the same name. Application A is installed at /Applications/My App.app. When I run the installer for Application B, it gets installed in a folder at /Applications/My App.localized/My App.app. Even if I remove Application A using the preinstall script of Application B's installer, the result remains the same.

Does the installer determine the installation path with the new folder before the preinstall script executes?

How can it be addressed so the new folder will not be created?

Notes:

  • We have a composite package that contains multiple components. Instead of just running pkgbuild, we use our own components.plist rather than a synthesized one. The components.plist is attached.

  • The PackageInfo for Application B is also attached.

components.plist

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>BundleHasStrictIdentifier</key> <true/> <key>BundleIsRelocatable</key> <false/> <key>BundleIsVersionChecked</key> <true/> <key>BundleOverwriteAction</key> <string>upgrade</string> <key>RootRelativeBundlePath</key> <string>My App.app</string> </dict> </array> </plist>

PackageInfo

<?xml version="1.0" encoding="utf-8"?> <pkg-info overwrite-permissions="true" relocatable="false" identifier="com.comp.myapp2" postinstall-action="none" version="2.00.00" format-version="2" generator-version="InstallCmds-830.2 (22H221)" install-location="/Applications" auth="root" minimumSystemVersion="12.0"> <payload numberOfFiles="500" installKBytes="100000"/> <bundle path="./My App.app" id="com.comp.myapp2" CFBundleShortVersionString="2.00.00" CFBundleVersion="2.00.00"/> <bundle-version> <bundle id="com.comp.myapp2"/> </bundle-version> <upgrade-bundle> <bundle id="com.comp.myapp2"/> </upgrade-bundle> <update-bundle/> <atomic-update-bundle/> <strict-identifier> <bundle id="com.comp.myapp2"/> </strict-identifier> <relocate/> <scripts> <preinstall file="./preinstall"/> <postinstall file="./postinstall"/> </scripts> </pkg-info>

Localized Folder Created After Installing App with Same Name as Existing Application
 
 
Q