that easy to do you can try it -
how to check app is install or not : use the file tool extension or file component and check app private directory exist or not
for checking is install or not use this extension
PkgUtils : An extension to work with Packages - Extensions - Kodular Community
if app is not install then use activity starter for opening url otherwise launch the app directly