Issue with App StageCode & Retina NSHighResolutionCapable

To be compatible with Retina Displays, I added this script in Mac OS X Build Settings :

[code] Dim appName As String = CurrentBuildAppName
appName = ReplaceAll(appName, " ", "\ ") // Escape spaces for the command line

Dim appPath As String = CurrentBuildLocation + “/” + appName + “.app”

Dim command As String
command = "/usr/bin/defaults write " + appPath + “/Contents/Info ““NSHighResolutionCapable”” YES”
Call DoShellCommand(command)[/code]

My problem is that on computers with no Retina Display, the application shut down.

I tried to discover why and I found that the App StageCode (that is set to 3 - final) is equal to 0 - development on these computers, without Retina Display…

After many tries, I found that this issue is due to this code above, when I delete it, there is no problem… It’s really weird!!!

Any idea? Why this code «change» the StageCode for non-Retina computers?

shut down? With crash report?

Yes, with a MenuHasParentException due to a function that should not be called in final mode.

But as the app «believe» that the stageCode is 0-development, the app calls this function and crashes…

why not use DebugBuild constants to detect development?

Because I also use the development stagecode outside the IDE (tests by customers). So I use the App StageCode to detect if the app is running in development mode.

for that I use my own constant in a modele or in app class.
So I can switch it and build.

With your way the debug code is always there.

This is a bug with your code somewhere.