[quote=451737:@Christoph De Vocht]One of my apps launches on boot. This always worked by using a helper app.
But it doesn’t work with macOS 10.15 catalina.
Anyone else having luck doing this for Catalina?
Any help would be appreciated, I cannot update my app on the AppStore anymore because of this issue.[/quote]
Are you using Valdemar De SOUSA’s method ? I use it in my Char Menu app. I shall test what is going on and report.
what response do you get from SMLoginItemSetEnabled?[/quote]
Yes, the helper app is located in the Contents/Library/LoginItems
The SMLoginItemSetEnabled returns true. The helper app is launched on boot but it does not launch the main app.
It even works fine when notarised on macOS 10.14.6 - it just doesn’t on Catalina.
This is were it goes wrong in Catalina. r is return nil on Catalina (but not on all previous macOS versions).
dim w as new NSWorkspaceMBS
dim file as FolderItem
file = app.BundleFolderMBS.parent.parent.parent.parent // get the main app bundle path
dim error as NSErrorMBS
dim configuration as new Dictionary
dim options as Integer
configuration.Value(w.NSWorkspaceLaunchConfigurationArchitecture) = w.NSBundleExecutableArchitectureX86_64
options = w.NSWorkspaceLaunchAndHideOthers
dim r as NSRunningApplicationMBS
r = w.launchApplicationAtFile(file, options, configuration, error)
if r = nil then
return false
else
return true
end if
Maybe I need to codesign the helper app differently for Catalina?
Don’t forget to wrap it with [NSObject respondsToSelector:] to make sure that the replacement only gets called when it is supported, just in case Apple change their mind in the next 5 weeks.
Apple have recommended for a long time, you wrap replacement functions in a test using respondsToSelector as opposed to checking the OS version; in-case a beta function doesn’t make it into the final release. This replacement function is marked as Beta.