Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Multiple copies of "Install macOS*.app" may result in unexpected behavior #538

Open
pcrandom opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@pcrandom
Copy link

pcrandom commented Dec 10, 2024

Describe the bug
I noticed the "Upgrading macOS" dialog was using the "warning" icon instead of a macOS icon when I ran a simple --test-run --reinstall command. Confirmed icons were in icons directory, permissions were correct, etc., but erase-install.sh kept showing the "warning" icon instead, and only on one of my test Macs, not others.

Narrowed it down to the fact that the /Applications directory on this one test Mac had two copies of the installer, one named Install macOS Sonoma.app and one named Install macOS Sonoma Copy.app and erase-install.sh picked up the Copy instead of the regular name, and was using that in various parts of the script, including for determining the dialog icon.

Since it can't find or download /Library/Management/erase-install/icons/Install macOS Sonoma copy.png it reverts to the warning icon.

To Reproduce
Create a copy of Install macOS Sonoma.app in /Applications

  • If applicable, please provide the full command used when running the script. ./erase-install.sh --test-run --reinstall
  • Please describe how the script was run. Terminal

Expected behavior
The "Upgrade macOS" dialog to show the macOS Sonoma icon.

Code/log output

+/Library/Management/erase-install/erase-install.sh:3410> macos_app_name=+/Library/Management/erase-install/erase-install.sh:3410> basename '/Applications/Install macOS Sonoma copy.app'
+/Library/Management/erase-install/erase-install.sh:3410> macos_app_name=+/Library/Management/erase-install/erase-install.sh:3410> cut -d. -f1
+/Library/Management/erase-install/erase-install.sh:3410> macos_app_name='Install macOS Sonoma copy' 
+/Library/Management/erase-install/erase-install.sh:3413> icon_path='/Library/Management/erase-install/icons/Install macOS Sonoma copy.png' 
+/Library/Management/erase-install/erase-install.sh:3414> file -b '/Library/Management/erase-install/icons/Install macOS Sonoma copy.png'
+/Library/Management/erase-install/erase-install.sh:3414> grep 'PNG image data'
+/Library/Management/erase-install/erase-install.sh:3415> [[ ! '' == yes ]]
+/Library/Management/erase-install/erase-install.sh:3417> /bin/mkdir -p /Library/Management/erase-install/icons
+/Library/Management/erase-install/erase-install.sh:3419> macos_installer_icon_url='https://github.com/grahampugh/erase-install/blob/main/icons/Install macOS Sonoma copy.png?raw=true' 
+/Library/Management/erase-install/erase-install.sh:3420> curl -L 'https://github.com/grahampugh/erase-install/blob/main/icons/Install macOS Sonoma copy.png?raw=true' -o '/Library/Management/erase-install/icons/Install macOS Sonoma copy.png'
curl: (3) URL rejected: Malformed input to a URL function
+/Library/Management/erase-install/erase-install.sh:3425> file -b '/Library/Management/erase-install/icons/Install macOS Sonoma copy.png'
+/Library/Management/erase-install/erase-install.sh:3425> grep 'PNG image data'
+/Library/Management/erase-install/erase-install.sh:3427> [[ '' == yes ]]
+/Library/Management/erase-install/erase-install.sh:3430> dialog_install_icon=warning 

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS version 14.6.1
  • erase-install version 37.0

Additional context
This is just an example of unexpected behavior. Having a non-standard installer name for a valid installer may cause other issues, but I haven't tried to track those down. A potential solution could be to more strictly match to standard macOS installer names, but not sure if this particular situation is too much of an edge-case for real concern.

(Having multiple installers with standard install names in the same location, like both /Applications/Install macOS Sonoma.app and /Applications/Install macOS Sequoia.app may also cause unexpected behavior, though specifying --os or --version or --build would I assue mitigate most of those issues.)

@pcrandom pcrandom added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants