-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install_Hotfix_Script.ps1
201 lines (77 loc) · 4.86 KB
/
Install_Hotfix_Script.ps1
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
##############################################
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true)]
[string]
[ValidateNotNullOrEmpty()]
$SitePrefix = "sc103instance",
# The root folder with the WDP files.
[string]
$SCInstallRoot = ".",
# The root folder with the WDP files.
[string]
$PatchType = "cumulative",
# Root folder where the site is installd. If left on the default [systemdrive]:\inetpub\wwwroot will be used
[string]
$SitePhysicalRoot = "c:\inetpub\wwwroot\" ,
# Site suffix matches what is used by SIA
[string]
$SiteSuffix = ".dev.local"
)
$ErrorActionPreference = "Stop";
$SitecoreSiteName =$SitePrefix.Trim() + "sc" + $SiteSuffix
$XConnectSiteName=$SitePrefix.Trim() + "xconnect" + $SiteSuffix
$IdentityServerSiteName=$SitePrefix.Trim() + "identityserver" + $SiteSuffix
Write-Host "Unzipping the main file - " + (Get-Item "$SCInstallRoot\*.zip").FullName
# Unzip the copied over zip
Expand-Archive -Path "*.zip" -Force
if ($PatchType -eq 'cumulative')
{
# The path to the Sitecore cumulative Package to Deploy.
$SitecorePackageZipPath = "$SCInstallRoot\*\Sitecore * rev. * (OnPrem)_single.cumulative.delta.scwdp.zip"
# The path to the Identity Server cumulative Package to Deploy.
$IdentityServerPackageZipPath = "$SCInstallRoot\*\Sitecore.IdentityServer * rev. * (OnPrem)_identityserver.cumulative.delta.scwdp.zip"
# The path to the xConnect Server cumulative Package to Deploy.
$XConnectPackageZipPath = "$SCInstallRoot\*\Sitecore * rev. * (OnPrem)_xp0xconnect.cumulative.delta.scwdp.zip"
}
else
{
# The path to the Sitecore Package to Deploy.
$SitecorePackageZipPath = "$SCInstallRoot\*\Sitecore * rev. * (OnPrem)_single.delta.scwdp.zip"
# The path to the Identity Server Package to Deploy.
$IdentityServerPackageZipPath = "$SCInstallRoot\*\Sitecore.IdentityServer * rev. * (OnPrem)_identityserver.delta.scwdp.zip"
# The path to the xConnect Server Package to Deploy.
$XConnectPackageZipPath = "$SCInstallRoot\*\Sitecore * rev. * (OnPrem)_xp0xconnect.delta.scwdp.zip"
}
# The path to the Sitecore Package to Deploy.
$SitecorePackagePath = (Get-ChildItem $SitecorePackageZipPath).FullName
# The path to the Identity Server Package to Deploy.
$IdentityServerPackagePath = (Get-ChildItem $IdentityServerPackageZipPath).FullName
# The path to the xConnect Server Package to Deploy.
$XConnectPackagePath = (Get-ChildItem $XConnectPackageZipPath).FullName
$SitecorePackageUnzipPath = (Get-Item $SitecorePackageZipPath).FullName
$SitecorePackageUnzipDir = (Get-Item $SitecorePackageUnzipPath ).DirectoryName+"\sitecore"
$SitecoreIdentityServerPackageUnzipPath = (Get-Item $IdentityServerPackageZipPath).FullName
$SitecoreIdentityServerPackageUnzipDir = (Get-Item $SitecoreIdentityServerPackageUnzipPath ).DirectoryName+"\identity"
$SitecorexConnectServerPackageUnzipPath = (Get-Item $XConnectPackageZipPath).FullName
$SitecorexConnectServerPackageUnzipDir = (Get-Item $SitecorexConnectServerPackageUnzipPath ).DirectoryName+"\xconnect"
Write-Host "Unzipping the Sitecore Package file to - " + $SitecorePackageUnzipDir
Expand-Archive -Path $SitecorePackagePath -Destination $SitecorePackageUnzipDir -Force
Write-Host "Unzipping the Identity Package file to - " + $SitecoreIdentityServerPackageUnzipDir
Expand-Archive -Path $IdentityServerPackagePath -Destination $SitecoreIdentityServerPackageUnzipDir -Force
Write-Host "Unzipping the xConnect Package file to - " + $SitecorexConnectServerPackageUnzipDir
Expand-Archive -Path $XConnectPackagePath -Destination $SitecorexConnectServerPackageUnzipDir -Force
$SitecorePackageSource = "$SitecorePackageUnzipDir\Content\Website\*"
$SitecorePackageDest = $SitePhysicalRoot + $SitecoreSiteName + '\'
Write-Host "Copying the Sitecore Package file to - " + $SitecorePackageDest
Copy-Item $SitecorePackageSource -Destination $SitecorePackageDest -Force -Recurse
$SitecoreIdPackageSource = "$SitecoreIdentityServerPackageUnzipDir\Content\Website\*"
$SitecoreIdPackageDest = $SitePhysicalRoot + $IdentityServerSiteName + "\"
Write-Host "Copying the Id Package file to - $SitecoreIdPackageDest"
Copy-Item $SitecoreIdPackageSource -Destination $SitecoreIdPackageDest -Force -Recurse
$SitecorexConnectPackageSource = "$SitecorexConnectServerPackageUnzipDir\Content\Website\*"
$SitecorexConnectPackageDest = $SitePhysicalRoot + $XConnectSiteName + '\'
Write-Host "Copying the xConnect Package file to - $SitecorexConnectPackageDest"
Copy-Item $SitecorexConnectPackageSource -Destination $SitecorexConnectPackageDest -Force -Recurse
Write-Host "Process Completed!"
##############################################