This project has moved and is read-only. For the latest updates, please go here.

App Catalog

Topics: Feature Requests
Feb 25, 2014 at 3:45 PM
Since an App Catalog is needed for all SharePoint App Solutions, it would make sense to support creating it as part of ASPI. I've given this some thought as to how to implement this.

Since the App Store Service is also required - I believe that it should be integrated into the creation of that service. Two additional XML Elements are required

true/false - Create App Catalogs for each web app
relative path - Default AppCatalog

Add code:
for each web application
New-SPSite -Url http://webAppName/sites/AppCatalog -OwnerAlias "sp_adminAccount" -Name "GAF App Catalog" -Template "APPCATALOG#0" 

 Update-SPAppCatalogConfiguration -site http://webappurl/sites/AppCatalog  
Any thoughts about this?
Feb 26, 2014 at 7:19 PM
How about submitting a patch ( Please add your net modifications/additions to the most recent checked-in version of the script files, so I can quickly do a direct comparison and evaluate.

Feb 27, 2014 at 9:06 PM
Edited Feb 27, 2014 at 9:07 PM
Will do.
Is it safe to assume that \sites\ is the managed path for all web applications' site collections?
I'll be testing but the only proposed changes would be :

<AppManagementService Provision="SERVERNAME" Name="App Management Service" ProxyName="App Management Service" AppDomain="" >
    <DBServer />
    <DBAlias Create="false" DBInstance="SERVER\INSTANCE" DBPort="" />
==>  <AppCatalog Provision="true" Path="AppCatalog" Name="Application Catalog" />
Function CreateAppCatalogSiteCollections ([xml]$xmlinput)
    if ($xmlinput.Configuration.AppManagementService.AppCatalog.Provision -eq $true )
        if ($xmlinput.Configuration.WebApplications)
            # Get Web Application URL
            foreach ($webApp in $($xmlinput.Configuration.WebApplications.WebApplication))
                $webAppCatalogUrl = $($webApp.url)+":"+$($webApp.Port)+"/sites/"+$($xmlinput.Configuration.AppManagementService.AppCatalogPath)
                $webAppOwner = $($webapp.Configuration.Farm.Account.UserName)
                New-SPSite -Url $($webAppCatalogUrl) -OwnerAlias $(webAppOwner) -Name "App Catalog" -Template "APPCATALOG#0" 
                Update-SPAppCatalogConfiguration -site $($webAppCatalogUrl)  

Changes to AUtoSPInstallerMain.ps1 IN FUNCTION Setup-Services
    if ($env:spVer -eq "15") # These are for SP2013 only
        CreateAppManagementServiceApp $xmlinput
==>     CreateAppCatalogSiteCollections $xmlinput
        CreateSubscriptionSettingsServiceApp $xmlinput
        CreateWorkManagementServiceApp $xmlinput
        CreateMachineTranslationServiceApp $xmlinput
        CreateAccessServicesApp $xmlinput
        CreatePowerPointConversionServiceApp $xmlinput
        ConfigureDistributedCacheService $xmlinput
Mar 1, 2014 at 12:03 AM
Why assume anything? Add another config setting. At most do what other areas of the scripts do and default it to something (/sites) if left blank.

Good idea though. It's one of the first things to do after finishing the install.
Apr 7, 2014 at 10:34 PM
Edited Apr 7, 2014 at 10:36 PM
Actually, I found that this might work out of the box with no additional code.

The best thing to do is to add a site into the site collections with the following:
        <SiteCollection siteUrl="" HostNamedSiteCollection="false" Owner="northwind\SiteOwner" Name="App Catalog" Description="New Site" SearchUrl="" CustomTemplate="false" Template="APPCATALOG#0" LCID="1033" Locale="en-us" Time24="false" />
I have not yet checked to see if the AppCatalog works and there may still be a need to run the command in the post install script:
Update-SPAppCatalogConfiguration -site $($siteURL)
Thoughts? Which is the better approach?