How to check if a package is installed from startup.jl?

There are several old posts about this issue but according to me this issue has not been fully addressed.

I would like query if a package is installed, if not, install it and selectively make some additional calls to the package.

Pkg.installed() gives deprecated warnings at the startup, Pkg.status() returns “nothing” which can not be used programmatically.

How can I properly inspect if a package is installed at the startup.jl?

Thank in advance

just do a try block? It is imo a weird deprecation though: