After working hard creating a beautiful Office App, it’s natural that we now want to share it with the rest of the world. The way we do this is by publishing our app to a central location from where users pick the app and use it. There are 3 ways to publish an Office app:
- Office Store – We can publish your app to the Office Store from where it is easily available to millions of Office subscribers.
- SharePoint App Catalog – If the app needs to be used within an organization, we can publish the app to the organization App Catalog running on SharePoint 2013.
- Network Share – We just publish the app to a network location accessible to our target audience.
- Run Visual Studio with Administrator credentials and open the solution.
- Right-click the Office project and choose “Publish“. The following dialog will be displayed which asks either to enter or create a new “Profile”.
- Profiles are easy way to remember our publishing settings. Since we have not published this app earlier, we have to create a new profile. Let’s name it “NetworkProfile”. Note that this name is arbitrary and will be available in the drop-down when we come back any time later to re-publish the app.
Next we have to specify where we want to host our app (local machine in this example). Note that specifying the location does not actually host the app at the mentioned location but just packages the app so as to use that location when deploying.
Click next to see a summary and hit Finish. This will package our app and open it in Windows Explorer.
There are many files of interest here- first being the Web.zip file. The zip file contains all the DLLs and dependencies necessary to host our app in IIS.
Next there is a handy deployment file (deploy.cmd) which will help in deploying the app to IIS by using Web Deploy.
The next file of interest is the SetParameters.xml file.This file contains parameters that are passed to Web Deploy when we use the deploy.cmd file to install the package. We can change the values of parameters present in this file as needed.
To deploy the package to IIS, open Command Prompt in admin mode and run deploy.cmd file with following switches –
- /t – Trial Mode – By specifying this flag, Web Deploy would check all scenarios which will be encountered when the deployment takes place but does not actually make any changes. It just generates a log file similar to what would be generated when actually deploying the app. After we are satisfied with the log files and settings, we can change the flag to /y to begin the actual deployment.
- /y – Yes or Update Mode – Web Deploy performs the deployment and displays a log of what it does.
Now that our app is deployed to IIS, we copy the manifest file present in “OfficeAppManifests” folder and place it on a network location. Next open Office application -> Trust Center -> Trust Center Settings -> Trusted App Catalogs.
Here specify the Catalog Url as the network path where we have placed the manifest file and check “Show in Menu” option.
There are certain limitations when publishing Office apps this way.
- Apps published to a network location cannot use Office Licensing service to license the apps.
- Apps cannot be used by general public and is only limited to people having access to the network location.
- App developer cannot monetize this app as it does not use Office Store.
In my next blog post, we will see how publishing to Office Store solves these limitations of using a network share by using the Office Licensing service.