Hi everyone!
i have this: (xojo 2025r1.1 macos desktop app)
this is the code:
Dim App As String = CurrentBuildLocation + "/""" + CurrentBuildAppName + """.app"
Call DoShellCommand("/usr/bin/defaults write " + App + "/Contents/Info ""LSUIElement"" YES")
if i use the “.app”, it creates a info.plist and add the contents, but the name of application, will be .app.app:
inside the “.app.app”, there is only one file, info.plist:
and it’s contents have what i need:
this key is NOT present on “.app”, and it’s obvious, because the path is wrong…
BUT, if i change the code to:
Dim App As String = CurrentBuildLocation + "/""" + CurrentBuildAppName // + """.app"
Call DoShellCommand("/usr/bin/defaults write " + App + "/Contents/Info ""LSUIElement"" YES")
The command DO NOT add the KEY on info.plist…
Why?
p.s.: if i execute the command manually, on terminal, it works.
before:
after:
AlbertoD
(AlbertoD)
June 20, 2025, 2:41pm
2
What version of Xojo are you using? If 2025r1 or later you may want to use the ‘Property List Editor’ (at least that is what I think will add keys to your info.plist).
You can find it under ‘Minimum Version’ section when you click macOS under Building Settings.
Here is the blog post about it:
1 Like
I seem to remember that in some Xojo version the CurrentBuildAppName got “.app” added to the end. So you don’t need to add this anymore.
1 Like
yes, i know, as i mentioned above. with the extra “.app” the doShellCommand executes (on the wrong place), as expected.
but when i remove the extra “.app”, the doShellCommand does nothing to the correct app file.
there is a bug when loading property list editor. i included the bug to be checked.
but the curious question is why the command do not work ok real app, but do work on “.app.app”
Because you’ve commented out the part that ends the quote.
Instead of throwing the results of DoShellCommand away, you should capture them and see what they are.
2 Likes
I had an issue recently were using “defaults write” in a build script caused the group ownership to be removed from the info.plist file. I was able to work around the issue by using the new build it plist editor to add the items.