Installer creates .localized directory for application bundle

Originator:Arjen.van.Bochoven
Number:rdar://33005768 Date Originated:27-Jun-2017 06:04 PM
Status:Closed as duplicate of 33006519 Resolved:
Product:macOS + SDK Product Version:10.12.6 Beta
Classification:UI/Usability Reproducible:Always
 
Summary:
When installing an upgrade package that contains an application bundle that does not match the CFBundleIdentifier of the application that is being upgraded, macOS installer creates a .localized directory and installs the upgrade in this directory instead of upgrading the application in place.

Steps to Reproduce:
The issue appears in multiple apps (SPSS for instance) but for a minimal example, I created this shell script:

#!/bin/sh
# Script that creates two installer packages with the same destination app
# but different CFBundleIdentifiers.
# These trigger in macOS installer the creation of a .localized version

mkdir -p /tmp/test/Applications/Test.app/Contents
/usr/libexec/plistbuddy -c "Set :CFBundleIdentifier string macadmins.test.1" /tmp/test/Applications/Test.app/Contents/Info.plist
pkgbuild --root /tmp/test /tmp/test.1.pkg

/usr/libexec/plistbuddy -c "Set :CFBundleIdentifier string macadmins.test.2" /tmp/test/Applications/Test.app/Contents/Info.plist
pkgbuild --root /tmp/test /tmp/test.2.pkg

sudo installer -pkg /tmp/test.1.pkg  -tgt /
sudo installer -pkg /tmp/test.2.pkg  -tgt /



Expected Results:
I expect to see just one application called Test.app in /Applications which has a CFBundleIdentifier value of macadmins.test.2.

Actual Results:
After installing the second package with the above script, there is one version of Test.app in Applications and another one in /Applications/Test.localized as demonstrated in the find command below.

find /Applications/Test.*
/Applications/Test.app
/Applications/Test.app/Contents
/Applications/Test.app/Contents/Info.plist
/Applications/Test.localized
/Applications/Test.localized/.localized
/Applications/Test.localized/Test.app
/Applications/Test.localized/Test.app/Contents
/Applications/Test.localized/Test.app/Contents/Info.plist

Version:
10.12.6 Beta

Notes:

Comments

Duplicate got closed, but issue persists

I opened a new bug report with the same contents for 10.13.2 Beta. The radarid is rdar://35408558

By Arjen.van.Bochoven at Nov. 8, 2017, 8:30 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!