forked from Sitefinity/feather
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeatherSetup.ps1
More file actions
70 lines (57 loc) · 3.21 KB
/
FeatherSetup.ps1
File metadata and controls
70 lines (57 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Import-Module WebAdministration
$currentPath = Split-Path $script:MyInvocation.MyCommand.Path
$variables = Join-Path $currentPath "\Variables.ps1"
. $variables
. $iisModule
$websiteConfigDir = $defaultWebsiteRootDirectory + "\App_Data\Sitefinity\Configuration"
function UpdateSystemConfig
{
$systemConfig = $websiteConfigDir+"\SystemConfig.config"
$doc = New-Object System.Xml.XmlDocument
$doc.Load($systemConfig)
$servicesNode = $doc.CreateElement("systemServices")
$addNode = $doc.CreateElement("add")
$addNode.SetAttribute("title","Telerik.Sitefinity.Frontend")
$addNode.SetAttribute("description","Telerik.Sitefinity.Frontend")
$addNode.SetAttribute("moduleId","00000000-0000-0000-0000-000000000000")
$addNode.SetAttribute("type","Telerik.Sitefinity.Frontend.FrontendService, Telerik.Sitefinity.Frontend")
$addNode.SetAttribute("startupType","OnApplicationStart")
$addNode.SetAttribute("name","Telerik.Sitefinity.Frontend")
$servicesNode.AppendChild($addNode)
$rootNode = $doc.SelectSingleNode("//systemConfig")
$rootNode.AppendChild($servicesNode)
$doc.Save($systemConfig)
}
function InstallFeather($featherBinDirectory)
{
Write-Output "----- Installing Feather ------"
Write-Output "Deploying feather assemblies to '$websiteBinariesDirectory'..."
Get-ChildItem Telerik.Sitefinity.Frontend.dll -recurse -path $featherBinDirectory | Copy-Item -destination $websiteBinariesDirectory
Get-ChildItem Ninject.dll -recurse -path $featherBinDirectory | Copy-Item -destination $websiteBinariesDirectory
Write-Output "Updating Sitefinity SystemConfig.config..."
UpdateSystemConfig
Write-Output "Restarting $appPollName application pool..."
Restart-WebAppPool $appPollName -ErrorAction Continue
GetRequest $defaultWebsiteUrl
Write-Output "----- Feather successfully installed ------"
}
function InstallFeatherWidgets($featherWidgetsBinDirectory, $featherNavigationWidgetBinDirectory)
{
Write-Output "Deploying feather widgets assembly to '$websiteBinariesDirectory'..."
Get-ChildItem ContentBlock.dll -recurse -path $featherWidgetsBinDirectory | Copy-Item -destination $websiteBinariesDirectory
Get-ChildItem Navigation.dll -recurse -path $featherNavigationWidgetBinDirectory | Copy-Item -destination $websiteBinariesDirectory
InstallFeather $featherBinDirectory
}
function InstallFeatherPackages($featherPackagesDirectory)
{
Write-Output "----- Create Resource Packages directory in SitefinityWebApp ------"
$resourcePackagesFolder = $defaultWebsiteRootDirectory + "\ResourcePackages"
if(!(Test-Path -Path $resourcePackagesFolder )){
New-Item -ItemType directory -Path $resourcePackagesFolder
}
Write-Output "----- Copy packages ------"
Get-ChildItem Bootstrap -path $featherPackagesDirectory | Copy-Item -destination $resourcePackagesFolder -recurse
Get-ChildItem Foundation -path $featherPackagesDirectory | Copy-Item -destination $resourcePackagesFolder -recurse
Get-ChildItem SemanticUI -path $featherPackagesDirectory | Copy-Item -destination $resourcePackagesFolder -recurse
Write-Output "----- Feather packages successfully installed ------"
}