-
Notifications
You must be signed in to change notification settings - Fork 1
/
Snittlistan.main.wxs
385 lines (366 loc) · 20.7 KB
/
Snittlistan.main.wxs
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<!-- unique identifier for this package, DO NOT CHANGE! -->
<?define UpgradeCode="{a2cb3a4e-9c6a-4a9b-ae08-55842492db9d}"?>
<?define ProductName="Snittlistan"?>
<Product Id="*"
UpgradeCode="$(var.UpgradeCode)"
Name="$(var.ProductName)"
Manufacturer="Daniel Lidstrom AB"
Language="1033"
Version="$(var.Version)">
<Package Id="*"
Description="Snittlistan installer"
InstallerVersion="500"
Languages="1033"
Compressed="yes"
SummaryCodepage="1252"
Platform="x64" />
<Media Id="1" Cabinet="service.cab" EmbedCab="yes" />
<Icon Id="icon.ico" SourceFile="Snittlistan.Web\Content\css\images\hofvet.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<MajorUpgrade DowngradeErrorMessage="A later version of this product is already installed. Setup will now exit." />
<Property Id="ALLUSERS" Value="1" />
<PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR" />
<!-- will break when supported by WiX -->
<Property Id="WIX_IS_NETFRAMEWORK_47_OR_LATER_INSTALLED" Value="0" />
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="[ProductName] Requires .NET Framework 4.7 or later to be installed"><![CDATA[Installed OR (NETFRAMEWORK45 AND NETFRAMEWORK45 >= "#460805")]]></Condition>
<Condition Message="SERVICE_ACCOUNT variable must be set in the command line">
Installed OR SERVICE_ACCOUNT
</Condition>
<Condition Message="SERVICE_PASSWORD variable must be set in the command line">
Installed OR SERVICE_PASSWORD
</Condition>
<Condition Message="EMAIL_PASSWORD variable must be set in the command line">
Installed OR EMAIL_PASSWORD
</Condition>
<Condition Message="ELMAH_EMAIL_PASSWORD variable must be set in the command line">
Installed OR ELMAH_EMAIL_PASSWORD
</Condition>
<Condition Message="DB_HOST variable must be set in the command line">
Installed OR DB_HOST
</Condition>
<Condition Message="DB_NAME variable must be set in the command line">
Installed OR DB_NAME
</Condition>
<Condition Message="DB_NAME2 variable must be set in the command line">
Installed OR DB_NAME2
</Condition>
<Condition Message="DB_USERNAME variable must be set in the command line">
Installed OR DB_USERNAME
</Condition>
<Condition Message="DB_PASSWORD variable must be set in the command line">
Installed OR DB_PASSWORD
</Condition>
<Condition Message="OWNER_EMAIL variable must be set in the command line">
Installed OR OWNER_EMAIL
</Condition>
<Condition Message="BCC_EMAIL variable must be set in the command line">
Installed OR BCC_EMAIL
</Condition>
<?include conditions.wxi?>
<CustomAction Id="VerifyMatches_Cmd"
Property="VerifyMatches_Task"
Execute="immediate"
Value=""[SystemFolder]schtasks.exe" /Create /F /RU [SERVICE_ACCOUNT] /RP [SERVICE_PASSWORD] /SC DAILY /TN VerifyMatches /ST 12:00 /TR "\"[#Snittlistan.Tool.exe]\" verifymatches"" />
<CustomAction Id="VerifyMatches_Task"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="no" />
<CustomAction Id="RegisterMatches_Cmd"
Property="RegisterMatches_Task"
Execute="immediate"
Value=""[SystemFolder]schtasks.exe" /Create /F /RU [SERVICE_ACCOUNT] /RP [SERVICE_PASSWORD] /SC MINUTE /MO 15 /TN RegisterMatches /TR "\"[#Snittlistan.Tool.exe]\" RegisterMatches"" />
<CustomAction Id="RegisterMatches_Task"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="no" />
<CustomAction Id="StartServices_Cmd"
Property="StartServices_Task"
Execute="immediate"
Value=""[SystemFolder]schtasks.exe" /Create /F /RU [SERVICE_ACCOUNT] /RP [SERVICE_PASSWORD] /SC MINUTE /MO 1 /TN StartServices /TR "\"powershell.exe\" -f \"[#StartServices.ps1]\""" />
<CustomAction Id="StartServices_Task"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="no" />
<CustomAction Id="GetRostersFromBits_Cmd"
Property="GetRostersFromBits_Task"
Execute="immediate"
Value=""[SystemFolder]schtasks.exe" /Create /F /RU [SERVICE_ACCOUNT] /RP [SERVICE_PASSWORD] /SC HOURLY /TN GetRostersFromBits /TR "\"[#Snittlistan.Tool.exe]\" GetRostersFromBits"" />
<CustomAction Id="GetRostersFromBits_Task"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="no" />
<CustomAction Id="GetPlayersFromBits_Cmd"
Property="GetPlayersFromBits_Task"
Execute="immediate"
Value=""[SystemFolder]schtasks.exe" /Create /F /RU [SERVICE_ACCOUNT] /RP [SERVICE_PASSWORD] /SC DAILY /ST 08:00 /TN GetPlayersFromBits /TR "\"[#Snittlistan.Tool.exe]\" GetPlayersFromBits"" />
<CustomAction Id="GetPlayersFromBits_Task"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="no" />
<CustomAction Id="PublishExpiredTasks_Cmd"
Property="PublishExpiredTasks_Task"
Execute="immediate"
Value=""[SystemFolder]schtasks.exe" /Create /F /RU [SERVICE_ACCOUNT] /RP [SERVICE_PASSWORD] /SC MINUTE /MO 1 /TN PublishExpiredTasks /TR "\"[#Snittlistan.Tool.exe]\" PublishExpiredTasks"" />
<CustomAction Id="PublishExpiredTasks_Task"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="no" />
<Directory Id="TARGETDIR" Name="SourceDir">
<!--<Merge Id="VCRedist" SourceFile="C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC140_CRT_x86.msm" DiskId="1" Language="0" />-->
<Directory Id="ProgramFiles64Folder" Name="PFiles">
<Directory Id="INSTALLDIR" Name="Snittlistan">
<Component Id="StartServices.ps1" Guid="*" Win64="yes">
<File KeyPath="yes" Source="StartServices.ps1" />
</Component>
<Directory Id="SnittlistanWebDir" Name="Snittlistan.Web">
<Component Id="Snittlistan.Web.config" Guid="*" Win64="yes">
<File Id="Snittlistan.Web.config"
KeyPath="yes"
Source="$(var.Snittlistan_App)\Web.config" />
<util:XmlFile Id="TemplateFilenameSetting"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/appSettings/add[\[]@key='ElitemedalsTemplateFilename'[\]]/@value"
Value="[SnittlistanWebDir]elitmarke-ifyllbar1.pdf" />
<util:XmlFile Id="OwnerEmailSetting"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/appSettings/add[\[]@key='OwnerEmail'[\]]/@value"
Value="[OWNER_EMAIL]" />
<util:XmlFile Id="BccEmailSetting"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/appSettings/add[\[]@key='BccEmail'[\]]/@value"
Value="[BCC_EMAIL]" />
<util:XmlFile Id="MailUsername"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/system.net/mailSettings/smtp/network/@userName"
Value="[OWNER_EMAIL]" />
<util:XmlFile Id="MailPassword"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/system.net/mailSettings/smtp/network/@password"
Value="[EMAIL_PASSWORD]" />
<util:XmlFile Id="ElmahSettings"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/elmah/errorMail/@password"
Value="[ELMAH_EMAIL_PASSWORD]" />
<util:XmlFile Id="ElmahFrom"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/elmah/errorMail/@from"
Value="[OWNER_EMAIL]" />
<util:XmlFile Id="ElmahTo"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/elmah/errorMail/@to"
Value="[BCC_EMAIL]" />
<util:XmlFile Id="ElmahUsername"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/elmah/errorMail/@userName"
Value="[OWNER_EMAIL]" />
<util:XmlFile Id="ConnectionString"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/connectionStrings/add[\[]@name='SnittlistanContext'[\]]/@connectionString"
Value="Server=[DB_HOST];Database=[DB_NAME];Username=[DB_USERNAME];Password=[DB_PASSWORD]" />
<util:XmlFile Id="ConnectionString2"
Action="setValue"
File="[SnittlistanWebDir]Web.config"
ElementPath="/configuration/connectionStrings/add[\[]@name='BitsContext'[\]]/@connectionString"
Value="Server=[DB_HOST];Database=[DB_NAME2];Username=[DB_USERNAME];Password=[DB_PASSWORD]" />
</Component>
<Component Id="elitmarke_ifyllbar1_pdf" Guid="*" Win64="yes">
<File KeyPath="yes" Source="elitmarke-ifyllbar1.pdf" />
</Component>
<Directory Id="SnittlistanWeb_AppData" Name="App_Data">
<Component Id="SnittlistanWeb_AppData" Guid="{3ddc6c33-9655-455a-bfb2-709023091c3c}"
SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
Win64="yes" Location="either">
<CreateFolder>
<util:PermissionEx GenericAll="yes"
CreateFile="yes"
ChangePermission="yes"
Delete="yes"
DeleteChild="yes"
User="IIS_IUSRS" />
</CreateFolder>
</Component>
</Directory>
<Directory Id="SnittlistanWeb_Logs" Name="Logs">
<Component Id="SnittlistanWeb_Logs" Guid="{07655794-20ae-4272-89f9-96adcec0eb2a}"
SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
Win64="yes" Location="either">
<CreateFolder>
<util:PermissionEx GenericAll="yes"
CreateFile="yes"
ChangePermission="yes"
Delete="yes"
DeleteChild="yes"
User="IIS_IUSRS" />
</CreateFolder>
</Component>
</Directory>
</Directory>
<Directory Id="SnittlistanToolDir" Name="Snittlistan.Tool">
<Component Id="Snittlistan.Tool.exe" Guid="*" Win64="yes">
<File KeyPath="yes"
Source="$(var.Snittlistan_App)\Snittlistan.Tool.exe" />
</Component>
<Component Id="Snittlistan.Tool.exe.config" Guid="*" Win64="yes">
<File KeyPath="yes"
Source="$(var.Snittlistan_App)\Snittlistan.Tool.exe.config" />
<util:XmlFile Id="ToolPortSetting"
Action="setValue"
File="[SnittlistanToolDir]Snittlistan.Tool.exe.config"
ElementPath="/configuration/appSettings/add[\[]@key='Port'[\]]/@value"
Value="80" />
</Component>
<Directory Id="SnittlistanTool_Logs" Name="Logs">
<Component Id="SnittlistanTool_Logs" Guid="{02c5f40d-0a22-4b54-a54e-654ae4d003d7}"
SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
Win64="yes" Location="either">
<CreateFolder>
<util:PermissionEx GenericAll="yes"
CreateFile="yes"
ChangePermission="yes"
Delete="yes"
DeleteChild="yes"
User="Users" />
</CreateFolder>
</Component>
</Directory>
</Directory>
<Directory Id="SnittlistanQueueDir" Name="Snittlistan.Queue">
<Component Id="Snittlistan.Queue.WindowsServiceHost.exe" Guid="*" Win64="yes">
<File KeyPath="yes"
Source="$(var.Snittlistan_App)\Snittlistan.Queue.WindowsServiceHost.exe" />
<ServiceInstall Id="Snittlistan.Queue.WindowsServiceHost.exe"
Name="Snittlistan.Queue.WindowsServiceHost.exe"
DisplayName="Snittlistan Queue Service"
ErrorControl="normal"
Start="auto"
Type="ownProcess"
Account="[SERVICE_ACCOUNT]"
Password="[SERVICE_PASSWORD]"
Vital="yes">
<ServiceDependency Id="MSMQ" />
<util:ServiceConfig FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="restart"
RestartServiceDelayInSeconds="300"
ResetPeriodInDays="1" />
</ServiceInstall>
<ServiceControl Id="Snittlistan.Queue.WindowsServiceHost.exe"
Name="Snittlistan.Queue.WindowsServiceHost.exe"
Start="install"
Stop="both"
Remove="uninstall"/>
</Component>
<Component Id="Snittlistan.Queue.WindowsServiceHost.exe.config" Guid="*" Win64="yes">
<File KeyPath="yes"
Source="$(var.Snittlistan_App)\Snittlistan.Queue.WindowsServiceHost.exe.config" />
<util:XmlFile Id="QueuePortSetting"
Action="setValue"
File="[SnittlistanQueueDir]Snittlistan.Queue.WindowsServiceHost.exe.config"
ElementPath="/configuration/appSettings/add[\[]@key='Port'[\]]/@value"
Value="80" />
</Component>
<Directory Id="SnittlistanQueue_Logs" Name="Logs">
<Component Id="SnittlistanQueue_Logs" Guid="{fe829ea1-9510-4cf7-ba10-34230be033bc}"
SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
Win64="yes" Location="either">
<CreateFolder>
<util:PermissionEx GenericAll="yes"
CreateFile="yes"
ChangePermission="yes"
Delete="yes"
DeleteChild="yes"
User="Users" />
</CreateFolder>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Component Id="AppPool" Guid="{84eb7913-9244-48cd-89d5-6baf98b0b0d3}" Permanent="yes" Win64="yes">
<!-- Create an application pool. Set automatic recycling to once every 24 hours.
Keep the application active until its been idle 24 hours, only then shut down the worker process. -->
<iis:WebAppPool Id="AppPool"
Name="Snittlistan"
ManagedPipelineMode="Integrated"
ManagedRuntimeVersion="v4.0"
Identity="applicationPoolIdentity"
RecycleMinutes="1440"
IdleTimeout="1440" />
</Component>
<Component Id="SnittlistanWebSite" Guid="{0c289e8a-e4de-4f0f-b585-5d42b44126ea}">
<!-- Creates the Snittlistan web site -->
<iis:WebSite Id="SnittlistanWebSite" Description="Snittlistan" Directory="SnittlistanWebDir">
<iis:WebAddress Id="Binding1" Port="443" Header="snittlistan.se" Secure="yes" />
<iis:WebAddress Id="Binding2" Port="80" Header="snittlistan.se" />
<iis:WebAddress Id="Binding3" Port="80" />
<iis:WebAddress Id="Binding4" Port="443" Header="vartansik.snittlistan.se" Secure="yes" />
<iis:WebAddress Id="Binding5" Port="80" Header="vartansik.snittlistan.se" />
<iis:WebApplication Id="SnittlistanApplication" Name="Snittlistan" WebAppPool="AppPool" />
</iis:WebSite>
</Component>
</Directory>
<InstallExecuteSequence>
<!-- add tasks on install -->
<Custom Action="VerifyMatches_Cmd" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="VerifyMatches_Task" After="VerifyMatches_Cmd">NOT Installed</Custom>
<Custom Action="RegisterMatches_Cmd" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="RegisterMatches_Task" After="RegisterMatches_Cmd">NOT Installed</Custom>
<Custom Action="StartServices_Cmd" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="StartServices_Task" After="StartServices_Cmd">NOT Installed</Custom>
<Custom Action="GetRostersFromBits_Cmd" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="GetRostersFromBits_Task" After="GetRostersFromBits_Cmd">NOT Installed</Custom>
<Custom Action="GetPlayersFromBits_Cmd" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="GetPlayersFromBits_Task" After="GetPlayersFromBits_Cmd">NOT Installed</Custom>
<Custom Action="PublishExpiredTasks_Cmd" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="PublishExpiredTasks_Task" After="PublishExpiredTasks_Cmd">NOT Installed</Custom>
</InstallExecuteSequence>
<Feature Id="Service" Level="1">
<ComponentRef Id="Snittlistan.Web.config" />
<ComponentRef Id="elitmarke_ifyllbar1_pdf" />
<ComponentRef Id="SnittlistanWeb_AppData" />
<ComponentRef Id="SnittlistanWeb_Logs" />
<ComponentRef Id="Snittlistan.Tool.exe" />
<ComponentRef Id="Snittlistan.Tool.exe.config" />
<ComponentRef Id="SnittlistanTool_Logs" />
<ComponentRef Id="Snittlistan.Queue.WindowsServiceHost.exe" />
<ComponentRef Id="Snittlistan.Queue.WindowsServiceHost.exe.config" />
<ComponentRef Id="StartServices.ps1" />
<ComponentRef Id="SnittlistanQueue_Logs" />
<ComponentRef Id="AppPool" />
<ComponentRef Id="SnittlistanWebSite" />
</Feature>
<Feature Id="Libraries" Level="1">
<ComponentGroupRef Id="SnittlistanWebLib" />
<ComponentGroupRef Id="SnittlistanToolLib" />
<ComponentGroupRef Id="SnittlistanQueueLib" />
</Feature>
<!--<Feature Id="VCRedist" Title="Visual C++ 14.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1">
<MergeRef Id="VCRedist" />
</Feature>-->
</Product>
</Wix>