Web PI Extensibility: Custom Feeds – Installing Custom Applications

Posted: Oct 24, 2009  12 comments  

Average Rating

Share this Post

One of the most important features of Web Platform Installer, version 2 RTW of which released in September, is that it surfaces web applications offered by Windows Web App Gallery. The Gallery is the place for open source apps that can be submitted through online submission process and be available through various sources, including Web PI, to millions of people. Both submission and admission is totally free, the application just needs to adhere to App Gallery Principles and be a Web Deploy zip package.

However, you don’t need to submit an app to the App Gallery to make Web PI install it for you. With a new feature that version 2 comes with – extensibility – deploying your custom application via Web PI becomes a piece of cake. This article will show you how to create a custom feed for Web PI to recognize your application and be able to install it.

All you need to start with this article is a Web Deploy zip package of your app and (optionally) an icon for the prettier UI display of your app.

Let the fun begin!

The feed below represents an example of how to add applications with ASP.NET/SQL and PHP/MySql dependencies, create a new tab and subtabs based on keywords, group products together and hint Web PI that your product is available in different languages. Please note that you have to define a new custom tab for your custom products, since they cannot be added to Web PI core tabs.

You can also download this feed from here or add it to Web PI by specifying this link: http://blogs.iis.net/blogs/kateroh/WebPI/SampleCustomAppsFeed.xml

 

<?xml version="1.0" encoding="utf-8"?>

<feed xmlns="http://www.w3.org/2005/Atom">
  <version>1.0.0</version>
  <title>Sample Applications for WebPI v2 RTW Feed</title>
  <link href="http://www.contoso.com/SampleApplicationsFeed.xml" />
  <updated>2009-10-5T16:30:00Z</updated>
  <author>
    <name>Sample Application Builder</name>
    <uri>http://www.contoso.com/</uri>
  </author>
  <id>http://www.contoso.com/SampleApplicationsFeed.xml</id>

  <!-- Sample ASP.NET & SQL app with dependencies -->
  <entry type="application">
    <productId>Sample_ASPNET_SQL_App</productId>
    <title>Sample ASP.NET and SQL application</title>
    <summary>ASP.NET and SQL application sample</summary>
    <longSummary>Sample ASP.NET and SQL to show how to add a feed with a custom ASP.NET application to WebPI and define all dependencies.</longSummary>

    <!-- Defines grouping for the application based on the keyword(s) -->
    <keywords>
      <keywordId>ASPNETApps</keywordId>
    </keywords>

    <version>1.0</version>
    <images>
      <icon>c:\SampleASPNETAppIcon.jpg</icon>
    </images>
    
    <updated>2009-10-5T18:30:02Z</updated>
    <published>2009-10-5T18:30:02Z</published>

    <author>
      <name>Sample Application Builder</name>
      <uri>http://www.contoso.com</uri>
    </author>
    
    <!-- Bring along SQLExpress, if it is not installed as a related/nice-to-have product, not a dependency -->
    <related>
      <relatedProduct>
        <productId>SQLExpress</productId>
      </relatedProduct>
    </related>

    <!-- 
         Minimum set of requirements/dependencies in order to successfully install the application: 
         WDeploy, SQL Management Objects and URL Rewrite.
    -->
    <dependency>
      <and>
        <dependency>
          <productId>SMO</productId>
        </dependency>
        <dependency>
          <productId>WDeployNoSMO</productId>
        </dependency>
        <dependency>
          <productId>UrlRewrite2</productId>
        </dependency>
      </and>
    </dependency>
     
    <!-- Installer for an application should be Web Deploy package -->
    <installers>
      <installer>
        <id>1</id>
        <!-- List of languages this package is localized in: English, Korean, Spanish, Traditional and Simplified Chinese -->
        <languageId>en</languageId>
        <languageId>ko</languageId>
        <languageId>es</languageId>
        <languageId>zh-tw</languageId>
        <languageId>zh-cn</languageId>

        <installerFile>
          <!-- size of the package in KBs -->
          <fileSize>1024</fileSize>
          <installerURL>http://www.contoso.com/SampleASPNETApplication.zip</installerURL>
          <displayURL>http://www.contoso.com/SampleASPNETApplication.aspx</displayURL>
          <!-- SHA of the package file for signature verification -->
          <sha1>1223334444555556666667777777888888889999</sha1>
        </installerFile>
        <helpLink>http://www.contoso.com/SampleASPNETApplicationForum.aspx</helpLink>
        <msDeploy>
          <startPage>
            <!-- start with a setup page rather than a default one -->
            <startPage>Setup.aspx</startPage>
          </startPage>
        </msDeploy>
      </installer>
    </installers>
  </entry>

  <!-- Sample PHP & MySQL app with dependencies -->
  <entry type="application">
    <productId>Sample_PHP_MySQL_App</productId>
    <title>Sample PHP and and MySQL application</title>
    <summary>PHP and MySQL application sample</summary>
    <longSummary>Sample PHP and MySQL to show how to add a feed with a custom PHP application to WebPI and define all dependencies.</longSummary>

    <!-- Display under PHPApps keyword subtab -->
    <keywords>
      <keywordId>PHPApps</keywordId>
    </keywords>

    <version>1.0</version>
    <images>
      <icon>c:\SamplePHPAppIcon.jpg</icon>
    </images>

    <updated>2009-10-5T18:30:02Z</updated>
    <published>2009-10-5T18:30:02Z</published>

    <author>
      <name>Sample Application Builder</name>
      <uri>http://www.contoso.com</uri>
    </author>

    <!-- Bring along SQLExpress, if it is not installed as a related/nice-to-have product, not a dependency -->
    <related>
      <relatedProduct>
        <productId>SQLExpress</productId>
      </relatedProduct>
    </related>

    <!-- 
         Minimum set of requirements/dependencies in order to successfully install the application: 
         PHP, WDeploy, SQL Management Objects, MySql Connector and URL Rewrite.
     -->
    <dependency>
      <and>
        <dependency>
          <productId>WDeployNoSMO</productId>
        </dependency>
        <dependency>
          <productId>PHP</productId>
        </dependency>
        <dependency>
          <productId>MySQLConnector</productId>
        </dependency>
        <dependency>
          <productId>UrlRewrite2</productId>
        </dependency>
      </and>
    </dependency>
    
    <!-- Installer for an application should be Web Deploy package -->
    <installers>
      <installer>
        <id>1</id>
        <!-- List of languages this package is localized in: English, Russian, French, German and Italian -->
        <languageId>en</languageId>
        <languageId>ru</languageId>
        <languageId>fr</languageId>
        <languageId>de</languageId>
        <languageId>it</languageId>
        
        <installerFile>
          <!-- size of the package in KBs -->
          <fileSize>1024</fileSize>
          <installerURL>http://www.contoso.com/SamplePHPApplication.zip</installerURL>
          <displayURL>http://www.contoso.com/SamplePHPApplication.aspx</displayURL>
          <!-- SHA of the package file for signature verification -->
          <sha1>1223334444555556666667777777888888889999</sha1>
        </installerFile>
        <helpLink>http://www.contoso.com/SamplePHPApplicationForum.aspx</helpLink>
        <msDeploy>
          <!-- Default page is a start page -->
          <startPage />
        </msDeploy>
      </installer>
    </installers>
  </entry>
  
  <!-- Tab definition -->
  <tabs>
    <tab>
      <keywordTab>
        <id>SampleApplications</id>
        <name>Sample Applications</name>
        <description>Select from sample applications:</description>
        
        <!-- Subtabs definitions -->
        <keywords>
          <keywordId>ASPNETApps</keywordId>
          <keywordId>PHPApps</keywordId>
        </keywords>
      </keywordTab>
    </tab>
  </tabs>

  <!-- Keyword/titles of subtabs to group apps with those keywords under -->
  <keywords>
    <keyword id="ASPNETApps">ASP.NET Apps</keyword>
    <keyword id="PHPApps">PHP Apps</keyword>
  </keywords>
</feed>

You can get a hash of your zip package, by using a free utility called File Checksum Integrity Verifier (FCIV) and running fciv.exe –sha <path to your zip package> from the command prompt.

Now, you can try the feed out by saving it locally or uploading it, opening the Options dialog and adding a feed through either a physical path or URL.

image

Note how applications are grouped based on keywords rather than product families like products do. Also, applications are grouped into keyword subtabs rather than group boxes (pillars for products). To read about adding a custom product through a custom feed refer to this article - Web PI Extensibility: Custom Feeds – Installing Custom Products.

Comments

This is great!

What is the difference between "Installing Custom Applications" and "Installing Custom Products" in the other article?

Mark

Oct 25 2009 by mark.stair

Thanks, this _very_ useful for us (sensenet.hu).

The only difference I see between the 2 types is that msDeploy sample exist only in the custom app sample xml.

Oct 25 2009 by tusmester

I'm glad this helps!

For Web PI there is not much difference between your product entries as long as you hint it one of them is of type "application", which will mean a) it is a zip package and b) Web PI should install it using Web Deploy. This way, you can actually combine feeds from both article into one feed that will define both - applications and products.

Oct 26 2009 by kateroh

The problem with the feed was that there is no more product with productId = UrlRewrite2RC1, because URL Rewrite 2 RTW just got released a couple of weeks ago and the productId changed to just UrlRewrite2. So I updated the feed and added the link to the latest version.

As for resetting Web PI, you can do it from the cmd line by specifying /reset switch:

C:\Program Files\Microsoft\Web Platform Installer\WebPlatformInstaller.exe /reset

- this will delete Web PI installer cache, clear all feeds and set the language of installers to the deafult language (language of your locale or English).

Mar 26 2010 by kateroh

Hi

I want to put together a custom feed, but I am curious if I can call shell commands. Like mkdir, rmdir, cd, etc...

The deliverables are not for IIS, thereby I will not be using Web Deploy. They will be SDKs and Developer Tools.

Apr 09 2010 by jeff00seattle

Re-phrase:

I am curious if I can call an executable within the command shell?

Apr 09 2010 by jeff00seattle

Excuse the multiple comments, just trying to get my question out correctly:

Is it possible to execute a shell command from Web PI’s sandbox?

Apr 09 2010 by jeff00seattle

As of right now executing shell commands is not supported for application installs. The reason for this is that Web PI supports remote installation of applications and having install commands defined for an application would break this scenario. We are looking into working around this in v3.

However, you can define install commands for a product. Here is a excerpt

     <installer>

       <id>1</id>

       ..............

       <installerFile>

         <fileSize>10000</fileSize>

         <installerURL>contoso.com/.../installerURL>

         <sha1>86ABCD85BFBED7702C0ED877276E725713C6840</sha1>

       </installerFile>

       <installCommands>

         <cmdline>

           <exe>%SystemRoot%\System32\net.exe</exe>

           <commandLineArguments>stop w3svc /y</commandLineArguments>

           <ignoreExitCode>true</ignoreExitCode>

         </cmdline>

         <msiInstall>

           <msi>%InstallerFile%</msi>

         </msiInstall>

         <cmdline>

           <exe>%SystemRoot%\System32\net.exe</exe>

           <commandLineArguments>start w3svc</commandLineArguments>

           <ignoreExitCode>true</ignoreExitCode>

         </cmdline>

       </installCommands>

       ..............

     </installer>

Given this, you can try the following workaround. Suppose you need to run A command before installing an application and B command after installation completes. You can define a custom product (product A), whose installer will do nothing but executing the A command for its installation and another product (product B), whose installer will execute the B command. Now, you can make the application depend on the product A and product B depend on the application. In this case choosing product B will bring the desired order of installation, since dependencies have to be installed first:

Product A (executing A command)

application install

Product B (executing B command)

Hope this helps

Apr 13 2010 by kateroh

Thanks for this sample - it was great help! What I'm unable to find documentation on is how to specify .Net v4.0 as a dependency - I expect I can specify such a dependency in an element below //dependency/productId but any information on this would be greatly appreciated.

Thanks!

Marcus Wendt

May 11 2010 by mawtex

Marcus,

You are right, you will have to specify the productId for .NET 4.0 in the <dependency /> element. If you look up the productId for .NET 4.0 in the main WebProductList.xml (www.microsoft.com/.../WebProductList.xml or fwlink: go.microsoft.com/fwlink) it is defined as "NETFramework4". So your dependency will be defined as:

     <dependency>

          <productId>NETFramework4</productId>        

     </dependency>

May 12 2010 by kateroh

Submit a Comment

  • Plain text is accepted.
  • URLs starting with http:// are converted to links.