How to enable "use low resolution" on Retina display for an Application when shipping it?
Asked Answered
B

3

8

I have an application that breaks in HiDPI mode unless I chose "get Info" in finder and there tick the "open in low resolution" checkbox. Fixing the application is not an option as it was made using authoring software that is no longer really actively maintained by its vendor.

Now here is the thing: When I take the application, put it on the desktop, zip it and afterwards set the "open in low resolution" checkbox to true, delete the application and unzip the original one the checkbox stays checked. So wherever OS X stores the property "open in low resolution" it's not along with the file. That means that when distributing the application to other Retina Mac systems it'll be broken again until manually checking that checkbox on each system.

I found that the Info.plist got a NSHighResolutionCapable property and I added that Booleanto my app's Info.plist and set it to falsebut to no avail. That seems not to be equivalent to the "open in low resolution" option.

The linked document sais that: If the “Open in Low Resolution” checkbox is selected by default you can change the default by: Setting the NSHighResolutionCapable attribute to YES, in the Info.plist Well, the reverse does not work... What I'd like is an out of the box solution. I'd like to avoid that customers need to configure this on their own. It should simply be set when unzipping the application.

So two questions:

a) Is it possible to configure what equals the "open in low resolution" checkbox being checked along with the file - e.g. in the Info.plist?

b) Where does OS X store the choices I made for the "open in low resolution" checkboxes I get to via Finder's Info screen?

EDIT December, 7 (added plist details):

As seen in plist editor:

As seen in modern Xcode on Mavericks:

The only difference is the name that's displayed. Xcode calls it "High Resolution Capable" while in the file it's still really "NSHighResolutionCapable"

Here is the portion of the file info dialog we care for:

Buxom answered 6/12, 2013 at 14:20 Comment(6)
Setting NSHighResolutionCapable to false (NO in XCode) works for me - the app should open in low res and the "Open in Low Resolution" checkbox should be checked but greyed out. Just checked that with XCode 5.0.2 running on Mavericks. Can you show the content of your Info.plist?Currajong
@Currajong Thank you very much for your response, I added screenshots of both plist editor and Xcode, also on Mavericks and I added a download link to the App package with the problem.Buxom
C.O., try in a new user account. It's possible that unchecking the checkbox in Get Info is also saved in a separate place outside of the app, just as checking it was. Therefore, your tests with the Info.plist may be invalid because they're "overridden" by a user-specific setting. Another thing to try would be to duplicate some other app for which you've never toggled that setting in the Get Info window and see if editing the Info.plist value works for that.Profusive
@Buxom the config looks ok to me so not sure why it doesn't use that setting... Must be something else non-standard about that app...Currajong
@KenThomases thanks for the thoughts. I tried the same with a copy of the OS X TextEdit App. Now here is the thing... If you have ever viewed File Info for the App in that place the plist is without effect. The "try another user" suggestion hit the mark. Copying the app to a USB thumb drive also did the trick. So make that into an answer and I'll accept it...Buxom
Actually even right click "show package contents" and editing the plist file is enough for the "open in low resolution" checkbox to stay unaffected. I really needed the other user / other location trick even if I had never called file info before.Buxom
P
12

I'm not currently in a position to check, but it's likely that the presence or absence of the NSHighResolutionCapable key is cached in the Launch Services database. That's where most properties of an app which are specified in the Info.plist are stored. The fact that copying the app to a USB thumb drive worked seems to confirm that theory.

You might search the output of the following command for your app's bundle ID and then see if there's anything obviously related to high resolution capability:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump

If there is, then, after you modify an app's Info.plist, it might work to do:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /path/to/the/modified.app

If not, then perhaps the more powerful:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -seed

If none of that helps, then (from our above comments) it seems that trying in a new user account works.

Profusive answered 8/12, 2013 at 10:21 Comment(0)
C
2

Takes a little more finesse, you need to reset the -user- domain.

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications -all local,user

Caerleon answered 29/6, 2016 at 15:24 Comment(0)
O
2

I'll answer these the wrong way around

b) the preference key is called LSHighResolutionModeIsMagnified and is stored as per-app entries in ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.plist

a) you can write the preference for an app. I use plistbuddy as follows to set low resolution (the number 3) for OpenSCAD.app which has a bundle id of org.openscad.OpenSCAD

/usr/libexec/PlistBuddy -c "Set :LSHighResolutionModeIsMagnified:org.openscad.OpenSCAD:1 3" ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.plist

This information is adapted from an answer to a similar question I posed at: https://apple.stackexchange.com/questions/398846/where-is-the-open-in-low-resolution-setting-stored-for-an-app?noredirect=1#comment551034_398846

Obsidian answered 14/8, 2020 at 16:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.