We have developed an excel add-in(Custom functions).
As part of this developed a welcome guide which will be coming in a dialogue prompt. This explains how to use the add-in and get started by login to the add-in.
This welcome flow should only appear after installation of the add-in.
Is there a way in Office library to invoke this flow only after installation of the add-in.
Thanks.
What you are asking for is similar to what is sometimes called a "first run" experience.
There is no "OnInstallation" event that the add-in can handle, and there can't ever be because the add-in cannot register or run any handlers until after it is installed. The add-in can do nothing until it starts to run, so it has no reliable way of knowing whether it was just installed or installed long ago. Accordingly, there's no completely reliable way of getting it to behave differently when it runs for the first time after installation.
Here are some ideas that might get you close to what you want:
You could have a database on your web site with a table of IP addresses. When the add-in starts up, it sends the user's IP address to the web app which looks it up in the table. If the IP address isn't already there, it adds it to the table and signals the add-in's client side that this is probably the first time the add-in has been run. The client-side can react accordingly. If the IP address is already in the table, the web app signals the client side that this is not the first run.
You could use the Office.auth.getAccessToken method to get a token that contains the user's AAD OID and email address. Have a user table on your web site that lists all users who have used the add-in. When your add-in starts up it calls getAccessToken to identify the user and queries the database to see if the user has already used the add-in. See the Office Add-in documentation about Single Sign-on (SSO) for more about this.
For a per document first run experience, you could have the add-in check the current document for the presence of a custom property or custom XML when it starts up. If the custom property/XML is not present, it adds it and then presents the user with the first run experience. If the property/XML is already present, it concludes that the add-in has already been run on the current document and behaves accordingly.
You've seen web sites whose home page gives users the option to sign in, or sign up, or learn more. You could implement a similar system for your add-in.
Search the Internet for information about adding a "first run" experience to an app. (You might find more information about this for native apps than web apps, but the basic ideas will apply to web apps too.)